|
|
@@ -3,10 +3,12 @@ package com.seecoder.dataanalysis.eval.impl;
|
|
|
import com.seecoder.dataanalysis.analysis.EvalDataAnalysisService;
|
|
|
import com.seecoder.dataanalysis.controller.EvalController;
|
|
|
import com.seecoder.dataanalysis.data.dao.competency.CompetencyTreeDao;
|
|
|
+import com.seecoder.dataanalysis.data.dao.devcloud.ProjectDao;
|
|
|
import com.seecoder.dataanalysis.data.dao.eval.EvalExamInfoDao;
|
|
|
import com.seecoder.dataanalysis.data.dao.eval.EvalExamRecordDao;
|
|
|
import com.seecoder.dataanalysis.data.dao.eval.UserDao;
|
|
|
import com.seecoder.dataanalysis.data.entity.competency.*;
|
|
|
+import com.seecoder.dataanalysis.data.entity.devcloud.Project;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamInfo;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamRecord;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.Question;
|
|
|
@@ -32,6 +34,8 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
EvalExamInfoDao evalExamInfoDao;
|
|
|
@Autowired
|
|
|
UserDao userDao;
|
|
|
+ @Autowired
|
|
|
+ ProjectDao projectDao;
|
|
|
|
|
|
@Autowired
|
|
|
LogParsingService logParsingService;
|
|
|
@@ -98,40 +102,47 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
void addExamInfo(){
|
|
|
Question question1 = questionService.getQuestionByIdForAnalysis("43604f6f-f829-4aaf-ab97-47b99c20ede0");
|
|
|
Question question2 = questionService.getQuestionByIdForAnalysis("b39005ff-23c0-43a2-8174-f370f774eea8");
|
|
|
+ Question question3 = questionService.getQuestionByIdForAnalysis("77f7aa6b-7c4f-4695-b721-a8a1b378dc47");
|
|
|
+ Question question4 = questionService.getQuestionByIdForAnalysis("63dfd56a-ca9f-40c1-87d2-f30375fd636e");
|
|
|
+ Question question5 = questionService.getQuestionByIdForAnalysis("44de50e1-a7c0-414b-8d77-f8775f67624d");
|
|
|
Map<String,Double> questionAndScore1 = new HashMap<>();
|
|
|
- questionAndScore1.put(question1.getQuestionId(),100.0);
|
|
|
- questionAndScore1.put(question2.getQuestionId(),50.0);
|
|
|
+ questionAndScore1.put(question1.getQuestionId(),20.0);
|
|
|
+ questionAndScore1.put(question2.getQuestionId(),20.0);
|
|
|
+ questionAndScore1.put(question3.getQuestionId(),20.0);
|
|
|
+ questionAndScore1.put(question4.getQuestionId(),20.0);
|
|
|
+ questionAndScore1.put(question5.getQuestionId(),20.0);
|
|
|
|
|
|
EvalExamInfo evalExamInfo1 = new EvalExamInfo()
|
|
|
.setExamId(1)
|
|
|
- .setExamScore(150.0)
|
|
|
+ .setExamScore(100.0)
|
|
|
.setUpdateTime(new Date())
|
|
|
.setStartTime(new Date())
|
|
|
.setEndTime(new Date())
|
|
|
.setDifficulty(1)
|
|
|
+ .setDisposition("责任心")
|
|
|
.setQuestionAndScore(questionAndScore1);
|
|
|
|
|
|
evalExamInfoDao.save(evalExamInfo1);
|
|
|
|
|
|
- if(evalExamInfo1.getDisposition()==null){
|
|
|
- System.out.println("null");
|
|
|
- }else {
|
|
|
- System.out.println(evalExamInfo1.getDisposition());
|
|
|
- }
|
|
|
-
|
|
|
- Map<String,Double> questionAndScore2 = new HashMap<>();
|
|
|
- questionAndScore2.put(question1.getQuestionId(),100.0);
|
|
|
-
|
|
|
- EvalExamInfo evalExamInfo2 = new EvalExamInfo()
|
|
|
- .setExamId(2)
|
|
|
- .setExamScore(100.0)
|
|
|
- .setUpdateTime(new Date())
|
|
|
- .setStartTime(new Date())
|
|
|
- .setEndTime(new Date())
|
|
|
- .setDifficulty(1)
|
|
|
- .setQuestionAndScore(questionAndScore2);
|
|
|
-
|
|
|
- evalExamInfoDao.save(evalExamInfo2);
|
|
|
+// if(evalExamInfo1.getDisposition()==null){
|
|
|
+// System.out.println("null");
|
|
|
+// }else {
|
|
|
+// System.out.println(evalExamInfo1.getDisposition());
|
|
|
+// }
|
|
|
+//
|
|
|
+// Map<String,Double> questionAndScore2 = new HashMap<>();
|
|
|
+// questionAndScore2.put(question1.getQuestionId(),100.0);
|
|
|
+//
|
|
|
+// EvalExamInfo evalExamInfo2 = new EvalExamInfo()
|
|
|
+// .setExamId(2)
|
|
|
+// .setExamScore(100.0)
|
|
|
+// .setUpdateTime(new Date())
|
|
|
+// .setStartTime(new Date())
|
|
|
+// .setEndTime(new Date())
|
|
|
+// .setDifficulty(1)
|
|
|
+// .setQuestionAndScore(questionAndScore2);
|
|
|
+//
|
|
|
+// evalExamInfoDao.save(evalExamInfo2);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -178,34 +189,42 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
void addExamRecord(){
|
|
|
Question question1 = questionService.getQuestionByIdForAnalysis("43604f6f-f829-4aaf-ab97-47b99c20ede0");
|
|
|
Question question2 = questionService.getQuestionByIdForAnalysis("b39005ff-23c0-43a2-8174-f370f774eea8");
|
|
|
+ Question question3 = questionService.getQuestionByIdForAnalysis("77f7aa6b-7c4f-4695-b721-a8a1b378dc47");
|
|
|
+ Question question4 = questionService.getQuestionByIdForAnalysis("63dfd56a-ca9f-40c1-87d2-f30375fd636e");
|
|
|
+ Question question5 = questionService.getQuestionByIdForAnalysis("44de50e1-a7c0-414b-8d77-f8775f67624d");
|
|
|
+
|
|
|
Map<String, Double> quesScore1 = new HashMap<>();
|
|
|
-// quesScore1.put(question1.getQuestionId(),80.0);
|
|
|
- quesScore1.put(question2.getQuestionId(),30.0);
|
|
|
quesScore1.put(question1.getQuestionId(),0.0);
|
|
|
+ quesScore1.put(question2.getQuestionId(),10.0);
|
|
|
+ quesScore1.put(question3.getQuestionId(),20.0);
|
|
|
+ quesScore1.put(question4.getQuestionId(),5.0);
|
|
|
+ quesScore1.put(question5.getQuestionId(),20.0);
|
|
|
+
|
|
|
+// quesScore1.put(question1.getQuestionId(),0.0);
|
|
|
// quesScore1.put(question2.getQuestionId(),0.0);
|
|
|
|
|
|
EvalExamRecord evalExamRecord1 = new EvalExamRecord()
|
|
|
.setRecordId(1)
|
|
|
.setExamId(1)
|
|
|
- .setScore(quesScore1.get(question1.getQuestionId())+quesScore1.get(question2.getQuestionId()))
|
|
|
+ .setScore(55.0)
|
|
|
.setErrorQuestions(quesScore1)
|
|
|
.setSubmitTime(new Date())
|
|
|
.setUserId(2);
|
|
|
|
|
|
evalExamRecordDao.save(evalExamRecord1);
|
|
|
|
|
|
- Map<String, Double> quesScore2 = new HashMap<>();
|
|
|
- quesScore2.put(question1.getQuestionId(),100.0);
|
|
|
-
|
|
|
- EvalExamRecord evalExamRecord2 = new EvalExamRecord()
|
|
|
- .setRecordId(2)
|
|
|
- .setExamId(2)
|
|
|
- .setScore(quesScore2.get(question1.getQuestionId()))
|
|
|
- .setErrorQuestions(quesScore2)
|
|
|
- .setSubmitTime(new Date())
|
|
|
- .setUserId(2);
|
|
|
-
|
|
|
- evalExamRecordDao.save(evalExamRecord2);
|
|
|
+// Map<String, Double> quesScore2 = new HashMap<>();
|
|
|
+// quesScore2.put(question1.getQuestionId(),100.0);
|
|
|
+//
|
|
|
+// EvalExamRecord evalExamRecord2 = new EvalExamRecord()
|
|
|
+// .setRecordId(2)
|
|
|
+// .setExamId(2)
|
|
|
+// .setScore(quesScore2.get(question1.getQuestionId()))
|
|
|
+// .setErrorQuestions(quesScore2)
|
|
|
+// .setSubmitTime(new Date())
|
|
|
+// .setUserId(2);
|
|
|
+//
|
|
|
+// evalExamRecordDao.save(evalExamRecord2);
|
|
|
}
|
|
|
|
|
|
// @Test
|
|
|
@@ -301,7 +320,7 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
|
|
|
@Test
|
|
|
void testGetTreeAfterExam(){
|
|
|
- evalDataAnalysisService.getTreeAfterExam(2);
|
|
|
+ evalDataAnalysisService.getTreeAfterExam(1);
|
|
|
// evalController.getTreeAfterExam(1);
|
|
|
}
|
|
|
|
|
|
@@ -328,22 +347,17 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
|
|
|
@Test
|
|
|
void testUser(){
|
|
|
- User user = userDao.findById(1058).get();
|
|
|
+ User user = userDao.findByUserId(1626);
|
|
|
System.out.println(user);
|
|
|
+ System.out.println(user.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void testProject(){
|
|
|
+ Project project = projectDao.findById(7).get();
|
|
|
+ System.out.println(project);
|
|
|
}
|
|
|
|
|
|
-// @Test
|
|
|
-// void testParseLogData(){
|
|
|
-// EvalExamRecordDTO evalExamRecordDTO = new EvalExamRecordDTO();
|
|
|
-// evalExamRecordDTO.setRecordId(100);
|
|
|
-// evalExamRecordDTO.setExamId(101);
|
|
|
-// evalExamRecordDTO.setStudentId(12);
|
|
|
-// evalExamRecordDTO.setSubmitTime(new Date());
|
|
|
-// evalExamRecordDTO.setScore(0.0);
|
|
|
-// evalExamRecordDTO.setErrorQuestions(new ArrayList<>());
|
|
|
-//
|
|
|
-// logParsingService.parseLogData()
|
|
|
-// }
|
|
|
|
|
|
|
|
|
|