|
|
@@ -58,17 +58,27 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
|
|
|
questionDao.save(question1);
|
|
|
questionDao.save(question2);
|
|
|
+
|
|
|
+ Question question3 = new Question().setQuestionId("abny").setQuestionScore(50.0);
|
|
|
+ List<String> com3 = new ArrayList<>();
|
|
|
+ List<KSScore> ksScoreList3 = new ArrayList<>();
|
|
|
+ com3.add("软件工程过程");
|
|
|
+ KSScore ksScore5 = new KSScore().setKnowledge("软件过程定义").setSkillsAndScore(Arrays.asList(skills2));
|
|
|
+ ksScoreList3.add(ksScore5);
|
|
|
+ question3.setCompetencies(com3).setKsScores(ksScoreList3);
|
|
|
+
|
|
|
+ questionDao.save(question3);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void addExamInfo(){
|
|
|
Question question1 = questionDao.findById("abc123").get();
|
|
|
Question question2 = questionDao.findById("zxc111").get();
|
|
|
- Map<String,Double> questionAndScore = new HashMap<>();
|
|
|
- questionAndScore.put(question1.getQuestionId(),question1.getQuestionScore());
|
|
|
- questionAndScore.put(question2.getQuestionId(),question2.getQuestionScore());
|
|
|
+ Map<String,Double> questionAndScore1 = new HashMap<>();
|
|
|
+ questionAndScore1.put(question1.getQuestionId(),question1.getQuestionScore());
|
|
|
+ questionAndScore1.put(question2.getQuestionId(),question2.getQuestionScore());
|
|
|
|
|
|
- EvalExamInfo evalExamInfo = new EvalExamInfo()
|
|
|
+ EvalExamInfo evalExamInfo1 = new EvalExamInfo()
|
|
|
.setExamId(1)
|
|
|
.setExamScore(question1.getQuestionScore()+question2.getQuestionScore())
|
|
|
.setUpdateTime(new Date())
|
|
|
@@ -76,35 +86,64 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
.setEndTime(new Date())
|
|
|
.setDifficulty(1)
|
|
|
.setDisposition("热情")
|
|
|
- .setQuestionAndScore(questionAndScore);
|
|
|
+ .setQuestionAndScore(questionAndScore1);
|
|
|
+
|
|
|
+ evalExamInfoDao.save(evalExamInfo1);
|
|
|
+
|
|
|
+ Question question3 = questionDao.findById("abny").get();
|
|
|
+ Map<String,Double> questionAndScore2 = new HashMap<>();
|
|
|
+ questionAndScore2.put(question1.getQuestionId(),question1.getQuestionScore());
|
|
|
+ questionAndScore2.put(question3.getQuestionId(),question3.getQuestionScore());
|
|
|
+
|
|
|
+ EvalExamInfo evalExamInfo2 = new EvalExamInfo()
|
|
|
+ .setExamId(2)
|
|
|
+ .setExamScore(question1.getQuestionScore()+question3.getQuestionScore())
|
|
|
+ .setUpdateTime(new Date())
|
|
|
+ .setStartTime(new Date())
|
|
|
+ .setEndTime(new Date())
|
|
|
+ .setDifficulty(1)
|
|
|
+ .setDisposition("责任心")
|
|
|
+ .setQuestionAndScore(questionAndScore2);
|
|
|
+
|
|
|
+ evalExamInfoDao.save(evalExamInfo2);
|
|
|
|
|
|
- evalExamInfoDao.save(evalExamInfo);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void addExamRecord(){
|
|
|
Question question1 = questionDao.findById("abc123").get();
|
|
|
Question question2 = questionDao.findById("zxc111").get();
|
|
|
- Map<String, Double> quesScore = new HashMap<>();
|
|
|
- quesScore.put(question1.getQuestionId(),question1.getQuestionScore()-10.0);
|
|
|
- quesScore.put(question2.getQuestionId(),question2.getQuestionScore()-10.0);
|
|
|
+ Map<String, Double> quesScore1 = new HashMap<>();
|
|
|
+ quesScore1.put(question1.getQuestionId(),question1.getQuestionScore()-10.0);
|
|
|
+ quesScore1.put(question2.getQuestionId(),question2.getQuestionScore()-10.0);
|
|
|
|
|
|
- EvalExamRecord evalExamRecord = new EvalExamRecord()
|
|
|
+ EvalExamRecord evalExamRecord1 = new EvalExamRecord()
|
|
|
.setRecordId(1)
|
|
|
.setExamId(1)
|
|
|
- .setScore(quesScore.get(question1.getQuestionId())+quesScore.get(question2.getQuestionId()))
|
|
|
- .setErrorQuestions(quesScore)
|
|
|
+ .setScore(quesScore1.get(question1.getQuestionId())+quesScore1.get(question2.getQuestionId()))
|
|
|
+ .setErrorQuestions(quesScore1)
|
|
|
.setSubmitTime(new Date())
|
|
|
.setUserId(2);
|
|
|
|
|
|
- evalExamRecordDao.save(evalExamRecord);
|
|
|
- }
|
|
|
+ evalExamRecordDao.save(evalExamRecord1);
|
|
|
|
|
|
- @Test
|
|
|
- void testGetTreeAfterExam(){
|
|
|
- evalDataAnalysisService.getTreeAfterExam(1);
|
|
|
+ Question question3 = questionDao.findById("abny").get();
|
|
|
+ Map<String,Double> quesScore2 = new HashMap<>();
|
|
|
+ quesScore2.put(question1.getQuestionId(),question1.getQuestionScore());
|
|
|
+ quesScore2.put(question3.getQuestionId(),0.0);
|
|
|
+
|
|
|
+ EvalExamRecord evalExamRecord2 = new EvalExamRecord()
|
|
|
+ .setRecordId(2)
|
|
|
+ .setExamId(2)
|
|
|
+ .setScore(quesScore2.get(question1.getQuestionId())+quesScore2.get(question3.getQuestionId()))
|
|
|
+ .setErrorQuestions(quesScore2)
|
|
|
+ .setSubmitTime(new Date())
|
|
|
+ .setUserId(2);
|
|
|
+
|
|
|
+ evalExamRecordDao.save(evalExamRecord2);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Test
|
|
|
void addTree(){
|
|
|
List<KSScore> L1 = new ArrayList<>();
|
|
|
@@ -141,6 +180,15 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
competencyTreeDao.save(competencyTree);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testFindByUserId(){
|
|
|
+ List<EvalExamRecord> evalExamRecordList = evalExamRecordDao.findByUserId(1);
|
|
|
+ System.out.println(evalExamRecordList.size());
|
|
|
+ for(EvalExamRecord evalExamRecord : evalExamRecordList){
|
|
|
+ System.out.println(evalExamRecord.getScore());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testModelTree(){
|
|
|
Competencies competencies = new Competencies();
|
|
|
@@ -152,16 +200,23 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
@Test
|
|
|
void testGetTreeById(){
|
|
|
CompetencyTree model = evalDataAnalysisService.getTreeById(2);
|
|
|
- model.setUserId(3);
|
|
|
- competencyTreeDao.save(model);
|
|
|
+// model.setUserId(3);
|
|
|
+// competencyTreeDao.save(model);
|
|
|
+ model.display();
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- void testFindByUserId(){
|
|
|
- List<EvalExamRecord> evalExamRecordList = evalExamRecordDao.findByUserId(1);
|
|
|
- System.out.println(evalExamRecordList.size());
|
|
|
- for(EvalExamRecord evalExamRecord : evalExamRecordList){
|
|
|
- System.out.println(evalExamRecord.getScore());
|
|
|
+ void testGetTreeAfterExam(){
|
|
|
+ evalDataAnalysisService.getTreeAfterExam(2);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void testGetStudentErrorQuestions(){
|
|
|
+ Map<String,Double> res = evalDataAnalysisService.getStudentErrorQuestions(2);
|
|
|
+ for(String questionId : res.keySet()){
|
|
|
+ System.out.println(questionId+" "+res.get(questionId));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|