|
@@ -127,12 +127,21 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
qk3Bo.setExamId(exam.getExamId());
|
|
|
qk3Bo.setKnowledIds(simulateConfig.getCaseQuestion().getKnowledIds());
|
|
|
qk3Bo.setKnum(simulateConfig.getCaseQuestion().getKnum());
|
|
|
- qk3Bo.setRandomNum(2); //案例强制随机
|
|
|
qk3Bo.setType(4);
|
|
|
qk3Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
qk3Bo.setFromType(bo.getFrom());
|
|
|
List<Long> qk3 = baseMapper.getKnowledQuestionList(qk3Bo);
|
|
|
|
|
|
+ ExamSimulateQueryBo qk4Bo = new ExamSimulateQueryBo(); //判断题选知识点
|
|
|
+ qk4Bo.setExamId(exam.getExamId());
|
|
|
+ qk4Bo.setKnowledIds(simulateConfig.getCaseQuestion().getKnowledIds());
|
|
|
+ qk4Bo.setKnum(simulateConfig.getCaseQuestion().getKnum());
|
|
|
+ qk4Bo.setType(3);
|
|
|
+ qk4Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
+ qk4Bo.setFromType(bo.getFrom());
|
|
|
+ List<Long> qk4 = baseMapper.getKnowledQuestionList(qk4Bo);
|
|
|
+
|
|
|
+
|
|
|
ExamSimulateQueryBo q1Bo = new ExamSimulateQueryBo(); //单选
|
|
|
q1Bo.setExamId(exam.getExamId());
|
|
|
q1Bo.setKnowledQuestionIds(qk1);
|
|
@@ -142,6 +151,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
q1Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
q1Bo.setFromType(bo.getFrom());
|
|
|
List<Long> q1 = baseMapper.getQuestionList(q1Bo);
|
|
|
+
|
|
|
ExamSimulateQueryBo q2Bo = new ExamSimulateQueryBo(); //多选
|
|
|
q2Bo.setExamId(exam.getExamId());
|
|
|
q2Bo.setKnowledQuestionIds(qk2);
|
|
@@ -151,21 +161,32 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
q2Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
q2Bo.setFromType(bo.getFrom());
|
|
|
List<Long> q2 = baseMapper.getQuestionList(q2Bo);
|
|
|
+
|
|
|
ExamSimulateQueryBo q3Bo = new ExamSimulateQueryBo(); //案例选
|
|
|
q3Bo.setExamId(exam.getExamId());
|
|
|
q3Bo.setKnowledQuestionIds(qk3);
|
|
|
q3Bo.setQnum(simulateConfig.getCaseQuestion().getQnum()-qk3.size());
|
|
|
- q3Bo.setRandomNum(2);//案例强制随机
|
|
|
q3Bo.setType(4);
|
|
|
q3Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
q3Bo.setFromType(bo.getFrom());
|
|
|
List<Long> q3 = baseMapper.getQuestionList(q3Bo);
|
|
|
+
|
|
|
+ ExamSimulateQueryBo q4Bo = new ExamSimulateQueryBo(); //判断题
|
|
|
+ q4Bo.setExamId(exam.getExamId());
|
|
|
+ q4Bo.setKnowledQuestionIds(qk4);
|
|
|
+ q4Bo.setQnum(simulateConfig.getCaseQuestion().getQnum()-qk4.size());
|
|
|
+ q4Bo.setType(3);
|
|
|
+ q4Bo.setOrderGoodsId(bo.getOrderGoodsId());
|
|
|
+ q4Bo.setFromType(bo.getFrom());
|
|
|
+ List<Long> q4 = baseMapper.getQuestionList(q4Bo);
|
|
|
+
|
|
|
qk1.addAll(q1);
|
|
|
qk2.addAll(q2);
|
|
|
qk3.addAll(q3);
|
|
|
+ qk4.addAll(q4);
|
|
|
List<Long> allQ = new ArrayList<>();
|
|
|
if(simulateConfig.getSingleChoice().getRandomNum()==1){ //题型顺序
|
|
|
- for(int i=1;i<4;i++){
|
|
|
+ for(int i=1;i<5;i++){
|
|
|
if(simulateConfig.getSingleChoice().getOrderNum()==i){
|
|
|
allQ.addAll(qk1);
|
|
|
}
|
|
@@ -175,31 +196,40 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
|
|
|
if(simulateConfig.getCaseQuestion().getOrderNum()==i){
|
|
|
allQ.addAll(qk3);
|
|
|
}
|
|
|
+ if(simulateConfig.getTrueFalseQuestion().getOrderNum()==i){
|
|
|
+ allQ.addAll(qk4);
|
|
|
+ }
|
|
|
}
|
|
|
// Collections.reverse(allQ);
|
|
|
}else{//题型随机
|
|
|
Map<Integer,Integer> map = new HashMap<>();
|
|
|
for(int i=1;i<50;i++){
|
|
|
int num = (int)(10.0*Math.random()) + 1;
|
|
|
- if(num%3==0){
|
|
|
+ if(num%4==0){
|
|
|
if(!map.containsKey(0)){
|
|
|
map.put(0,0);
|
|
|
allQ.addAll(qk1);
|
|
|
}
|
|
|
}
|
|
|
- if(num%3==1){
|
|
|
+ if(num%4==1){
|
|
|
if(!map.containsKey(1)){
|
|
|
map.put(1,1);
|
|
|
allQ.addAll(qk2);
|
|
|
}
|
|
|
}
|
|
|
- if(num%3==2){
|
|
|
+ if(num%4==2){
|
|
|
if(!map.containsKey(2)){
|
|
|
map.put(2,2);
|
|
|
allQ.addAll(qk3);
|
|
|
}
|
|
|
}
|
|
|
- if(map.size()>=3){
|
|
|
+ if(num%4==3){
|
|
|
+ if(!map.containsKey(3)){
|
|
|
+ map.put(3,3);
|
|
|
+ allQ.addAll(qk4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(map.size()>=4){
|
|
|
break;
|
|
|
}
|
|
|
}
|