|
|
@@ -1,10 +1,14 @@
|
|
|
package com.seecoder.dataanalysis;
|
|
|
|
|
|
import com.seecoder.dataanalysis.data.dao.competency.CompetencyTreeDao;
|
|
|
+import com.seecoder.dataanalysis.data.dao.eval.EvalExamInfoDao;
|
|
|
+import com.seecoder.dataanalysis.data.dao.eval.EvalExamRecordDao;
|
|
|
import com.seecoder.dataanalysis.data.entity.competency.CompetencyTree;
|
|
|
import com.seecoder.dataanalysis.data.entity.competency.DScore;
|
|
|
import com.seecoder.dataanalysis.data.entity.competency.KSDScore;
|
|
|
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 org.junit.jupiter.api.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
@@ -21,6 +25,12 @@ class DataAnalysisApplicationTests {
|
|
|
@Autowired
|
|
|
private CompetencyTreeDao competencyTreeDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EvalExamInfoDao evalExamInfoDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EvalExamRecordDao evalExamRecordDao;
|
|
|
+
|
|
|
@Test
|
|
|
void saveTree(){
|
|
|
List<KSScore> L1 = new ArrayList<>();
|
|
|
@@ -48,50 +58,28 @@ class DataAnalysisApplicationTests {
|
|
|
competencyTreeDao.save(competencyTree);
|
|
|
}
|
|
|
|
|
|
-// @Autowired
|
|
|
-// private TestMongoDBStudentDao testMongoDBStudentDao;
|
|
|
-//
|
|
|
-// @Test
|
|
|
-// void addOneStudent(){
|
|
|
-//// 插入10行
|
|
|
-// TestMongoDBStudent pre = null;
|
|
|
-// for (Integer count = 0; count < 10; count++) {
|
|
|
-// TestMongoDBStudent student = new TestMongoDBStudent()
|
|
|
-// .setStudentId("student_"+count) //如果自己不去设置id则系统会分配给一个id
|
|
|
-// .setStudentName("Godfery"+count)
|
|
|
-// .setStudentAge(count)
|
|
|
-// .setStudentScore(98.5-count)
|
|
|
-// .setStudentBirthday(new Date())
|
|
|
-// .setDeskMate(pre);
|
|
|
-// pre = student;
|
|
|
-// testMongoDBStudentDao.save(student);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ @Test
|
|
|
+ void saveExam(){
|
|
|
+ Map<Integer, Double> quesScore = new HashMap<>();
|
|
|
+ quesScore.put(1, 10.0);
|
|
|
+ quesScore.put(2, 20.0);
|
|
|
+ EvalExamInfo evalExamInfo = new EvalExamInfo()
|
|
|
+ .setExamId(1)
|
|
|
+ .setExamScore(100.0)
|
|
|
+ .setDifficulty(1)
|
|
|
+ .setStartTime(new Date())
|
|
|
+ .setEndTime(new Date())
|
|
|
+ .setQuestionAndScore(quesScore);
|
|
|
+ evalExamInfoDao.save(evalExamInfo);
|
|
|
|
|
|
-// @Test
|
|
|
-// void deleteOneStudentByStudentId(){
|
|
|
-//// 删除id为student_0的学生
|
|
|
-// studentDaoTypeOne.deleteById("student_0");
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Test
|
|
|
-// void updateOneStudent(){
|
|
|
-//// 修改姓名为Godfery1的Student年龄为22
|
|
|
-// Student student = studentDaoTypeOne.getAllByStudentName("Godfery1");
|
|
|
-// student.setStudentAge(22);
|
|
|
-// studentDaoTypeOne.save(student);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Test
|
|
|
-// void getOneStudentByStudentId(){
|
|
|
-// System.out.println(testMongoDBStudentDao.findById("student_2"));
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Test
|
|
|
-// void getAllStudent(){
|
|
|
-// List<Student> studentList = studentDaoTypeOne.findAll();
|
|
|
-// studentList.forEach(System.out::println);
|
|
|
-// }
|
|
|
+ EvalExamRecord evalExamRecord = new EvalExamRecord()
|
|
|
+ .setRecordId(1)
|
|
|
+ .setExamId(1)
|
|
|
+ .setScore(20.0)
|
|
|
+ .setErrorQuestions(quesScore)
|
|
|
+ .setSubmitTime(new Date())
|
|
|
+ .setUserId(1);
|
|
|
+ evalExamRecordDao.save(evalExamRecord);
|
|
|
+ }
|
|
|
|
|
|
}
|