|
@@ -9,6 +9,7 @@ import com.seecoder.dataanalysis.data.entity.competency.*;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamInfo;
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamInfo;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamRecord;
|
|
import com.seecoder.dataanalysis.data.entity.eval.EvalExamRecord;
|
|
|
import com.seecoder.dataanalysis.data.entity.eval.Question;
|
|
import com.seecoder.dataanalysis.data.entity.eval.Question;
|
|
|
|
|
+import com.seecoder.dataanalysis.data.entity.eval.display.FormatQuestion;
|
|
|
import com.seecoder.dataanalysis.logic.question.QuestionService;
|
|
import com.seecoder.dataanalysis.logic.question.QuestionService;
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -95,7 +96,7 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
|
|
|
|
|
EvalExamInfo evalExamInfo1 = new EvalExamInfo()
|
|
EvalExamInfo evalExamInfo1 = new EvalExamInfo()
|
|
|
.setExamId(1)
|
|
.setExamId(1)
|
|
|
- .setExamScore(100.0)
|
|
|
|
|
|
|
+ .setExamScore(150.0)
|
|
|
.setUpdateTime(new Date())
|
|
.setUpdateTime(new Date())
|
|
|
.setStartTime(new Date())
|
|
.setStartTime(new Date())
|
|
|
.setEndTime(new Date())
|
|
.setEndTime(new Date())
|
|
@@ -109,8 +110,23 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
}else {
|
|
}else {
|
|
|
System.out.println(evalExamInfo1.getDisposition());
|
|
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);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// @Test
|
|
// @Test
|
|
|
// void addExamInfo(){
|
|
// void addExamInfo(){
|
|
|
// Question question1 = questionDao.findById("abc123").get();
|
|
// Question question1 = questionDao.findById("abc123").get();
|
|
@@ -169,6 +185,19 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
.setUserId(2);
|
|
.setUserId(2);
|
|
|
|
|
|
|
|
evalExamRecordDao.save(evalExamRecord1);
|
|
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);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// @Test
|
|
// @Test
|
|
@@ -264,8 +293,8 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
void testGetTreeAfterExam(){
|
|
void testGetTreeAfterExam(){
|
|
|
-// evalDataAnalysisService.getTreeAfterExam(2);
|
|
|
|
|
- evalController.getTreeAfterExam(1);
|
|
|
|
|
|
|
+ evalDataAnalysisService.getTreeAfterExam(2);
|
|
|
|
|
+// evalController.getTreeAfterExam(1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -277,5 +306,18 @@ public class EvalDataAnalysisServiceImplTest {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void testGetStudentQuestionsList(){
|
|
|
|
|
+ List<String> types = new ArrayList<>();
|
|
|
|
|
+ types.add("SR");
|
|
|
|
|
+// List<FormatQuestion> formatQuestionList = evalDataAnalysisService.getStudentQuestionsList(2,types);
|
|
|
|
|
+ List<FormatQuestion> formatQuestionList = (List<FormatQuestion>)evalController.getStudentQuestionsList(2,types).getContent();
|
|
|
|
|
+// System.out.println(formatQuestionList.size());
|
|
|
|
|
+ for(FormatQuestion formatQuestion : formatQuestionList){
|
|
|
|
|
+ formatQuestion.display();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|