|
@@ -92,6 +92,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ExamSimulateVo insertByAddBo(ExamSimulateAddBo bo) {
|
|
|
ExamSimulate add = BeanUtil.toBean(bo, ExamSimulate.class);
|
|
|
+ add.setFromType(bo.getFrom());
|
|
|
Exam exam = iExamService.getOne(new LambdaQueryWrapper<Exam>().eq(Exam::getExamId, bo.getExamId()));
|
|
|
if(exam.getDoType()!=2||exam.getSimulateStatus()==0){
|
|
|
throw new CustomException("该试卷没开启模拟随机考");
|
|
@@ -108,6 +109,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
qk1Bo.setKnum(simulateConfig.getSingleChoice().getKnum());
|
|
|
qk1Bo.setRandomNum(simulateConfig.getType());
|
|
|
qk1Bo.setType(1);
|
|
|
+ qk1Bo.setFrom(bo.getFrom());
|
|
|
List<Long> qk1 = baseMapper.getKnowledQuestionList(qk1Bo);
|
|
|
|
|
|
ExamSimulateQueryBo qk2Bo = new ExamSimulateQueryBo(); //多选知识点
|
|
@@ -116,6 +118,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
qk2Bo.setKnum(simulateConfig.getMultipleChoice().getKnum());
|
|
|
qk2Bo.setRandomNum(simulateConfig.getType());
|
|
|
qk2Bo.setType(2);
|
|
|
+ qk2Bo.setFrom(bo.getFrom());
|
|
|
List<Long> qk2 = baseMapper.getKnowledQuestionList(qk2Bo);
|
|
|
|
|
|
ExamSimulateQueryBo qk3Bo = new ExamSimulateQueryBo(); //案例选知识点
|
|
@@ -124,6 +127,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
qk3Bo.setKnum(simulateConfig.getCaseQuestion().getKnum());
|
|
|
qk3Bo.setRandomNum(simulateConfig.getType());
|
|
|
qk3Bo.setType(4);
|
|
|
+ qk3Bo.setFrom(bo.getFrom());
|
|
|
List<Long> qk3 = baseMapper.getKnowledQuestionList(qk3Bo);
|
|
|
|
|
|
ExamSimulateQueryBo q1Bo = new ExamSimulateQueryBo(); //单选
|
|
@@ -132,6 +136,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
q1Bo.setQnum(simulateConfig.getSingleChoice().getQnum()-qk1.size());
|
|
|
q1Bo.setRandomNum(simulateConfig.getType());
|
|
|
q1Bo.setType(1);
|
|
|
+ q1Bo.setFrom(bo.getFrom());
|
|
|
List<Long> q1 = baseMapper.getQuestionList(q1Bo);
|
|
|
|
|
|
ExamSimulateQueryBo q2Bo = new ExamSimulateQueryBo(); //多选
|
|
@@ -140,6 +145,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
q2Bo.setQnum(simulateConfig.getMultipleChoice().getQnum()-qk2.size());
|
|
|
q2Bo.setRandomNum(simulateConfig.getType());
|
|
|
q2Bo.setType(2);
|
|
|
+ q2Bo.setFrom(bo.getFrom());
|
|
|
List<Long> q2 = baseMapper.getQuestionList(q2Bo);
|
|
|
|
|
|
ExamSimulateQueryBo q3Bo = new ExamSimulateQueryBo(); //案例选
|
|
@@ -148,6 +154,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
q3Bo.setQnum(simulateConfig.getCaseQuestion().getQnum()-qk3.size());
|
|
|
q3Bo.setRandomNum(simulateConfig.getType());
|
|
|
q3Bo.setType(4);
|
|
|
+ q3Bo.setFrom(bo.getFrom());
|
|
|
List<Long> q3 = baseMapper.getQuestionList(q3Bo);
|
|
|
|
|
|
qk1.addAll(q1);
|