|
|
@@ -12,6 +12,7 @@ import com.seecoder.dataanalysis.data.entity.competency.KSScore;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamInfo;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamRecord;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.Question;
|
|
|
+import com.sun.xml.internal.bind.v2.TODO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -36,12 +37,15 @@ public class EvalDataAnalysisServiceImpl implements EvalDataAnalysisService {
|
|
|
|
|
|
@Override
|
|
|
public CompetencyTree getTreeById(int student_id){
|
|
|
+ //TODO 和ModelTree进行合并,空值补0,返回可以用于可视化的结果
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public CompetencyTree getTreeAfterExam(int exam_id){
|
|
|
//TODO 测试检查
|
|
|
+ //TODO 修改Question的对应关系
|
|
|
+ //TODO 修改成逐条添加的形式
|
|
|
EvalExamRecord evalExamRecord = evalExamRecordDao.findById(exam_id).get();
|
|
|
EvalExamInfo evalExamInfo = evalExamInfoDao.findById(exam_id).get();
|
|
|
CompetencyTree competencyTree = competencyTreeDao.findByStudentId(evalExamRecord.getStudentId());
|
|
|
@@ -51,21 +55,22 @@ public class EvalDataAnalysisServiceImpl implements EvalDataAnalysisService {
|
|
|
Integer difficulty = evalExamInfo.getDifficulty();
|
|
|
String disposition = evalExamInfo.getDisposition();
|
|
|
Double tree_Score = competencyTree.getTreeScore();
|
|
|
+ double[] difficulty_percent = new double[]{1.0,1.25,1.5,1.75,2.0};
|
|
|
//得到学生所有题目的得分
|
|
|
Map<String, Double> studentScores = evalExamRecord.getErrorQuestions();
|
|
|
- Map<String,Double> questionAndScore = evalExamInfo.getQuestionAndScore();
|
|
|
+// Map<String,Double> questionAndScore = evalExamInfo.getQuestionAndScore();
|
|
|
for(Map.Entry<String, Double> entry : studentScores.entrySet()){
|
|
|
String questionId = entry.getKey();
|
|
|
Question question = questionDao.findById(questionId).get();
|
|
|
//在能力树中加成的部分 = 学生得分 * 试卷难度
|
|
|
- Double percent = difficulty * studentScores.get(questionId);
|
|
|
- tree_Score += percent;
|
|
|
+ Double addScore = difficulty_percent[difficulty] * studentScores.get(questionId);
|
|
|
+ tree_Score += addScore;
|
|
|
//根据competency找大分类
|
|
|
for(KSDScore ksdScore : subTree){
|
|
|
if(ksdScore.getCompetency().equals(question.getCompetency())){
|
|
|
//增加该能力子树的分数
|
|
|
Double total_score = ksdScore.getTotalScore();
|
|
|
- total_score += percent;
|
|
|
+ total_score += addScore;
|
|
|
ksdScore.setTotalScore(total_score);
|
|
|
//在对应的competency下进行下一步小分类
|
|
|
//修改K-S的分数
|
|
|
@@ -74,7 +79,7 @@ public class EvalDataAnalysisServiceImpl implements EvalDataAnalysisService {
|
|
|
if(ksScore.getKnowledge() == question.getKsScore().getKnowledge()){
|
|
|
List<Double> Skills = ksScore.getSkillsAndScore();
|
|
|
for(int i=0;i<Skills.size();i++){
|
|
|
- Double score = question.getKsScore().getSkillsAndScore().get(i) * percent + Skills.get(i);
|
|
|
+ Double score = question.getKsScore().getSkillsAndScore().get(i) * addScore + Skills.get(i);
|
|
|
Skills.set(i,score);
|
|
|
}
|
|
|
ksScore.setSkillsAndScore(Skills);
|
|
|
@@ -85,7 +90,7 @@ public class EvalDataAnalysisServiceImpl implements EvalDataAnalysisService {
|
|
|
//修改Disposition的分数
|
|
|
for(DScore dScore : subD){
|
|
|
if(dScore.getName().equals(disposition)){
|
|
|
- Double score = percent + dScore.getScore();
|
|
|
+ Double score = addScore + dScore.getScore();
|
|
|
dScore.setScore(score);
|
|
|
break;
|
|
|
}
|
|
|
@@ -101,5 +106,9 @@ public class EvalDataAnalysisServiceImpl implements EvalDataAnalysisService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Double> getStudentErrorQuestions(int student_id){return null;}
|
|
|
+ public Map<String, Double> getStudentErrorQuestions(int student_id){
|
|
|
+ //TODO 需要综合题目总分考虑
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|