|
@@ -198,10 +198,24 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
|
|
|
int easyMultiple = er.getMultipleChoiceCount();
|
|
|
int chapterId = er.getChapterId();
|
|
|
|
|
|
+ int total2 = easyJudge + easyChoice + easyMultiple;
|
|
|
+
|
|
|
QuestionInfoTestDTO questionInfoTestDTO = new QuestionInfoTestDTO();
|
|
|
questionInfoTestDTO.setChapterId(chapterId);
|
|
|
questionInfoTestDTO.setDiffDegree(diffDegree);
|
|
|
questionInfoTestDTO.setQuestionType(1);
|
|
|
+
|
|
|
+ if ("mtc".equals(qt.getGs())) {
|
|
|
+ questionInfoTestDTO.setLiceMoto("1");
|
|
|
+ } else if ("xc".equals(qt.getGs())) {
|
|
|
+ questionInfoTestDTO.setLiceCar("1");
|
|
|
+ } else if ("hc".equals(qt.getGs())) {
|
|
|
+ questionInfoTestDTO.setLiceTruck("1");
|
|
|
+ } else if ("kc".equals(qt.getGs())) {
|
|
|
+ questionInfoTestDTO.setLiceBus("1");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
int judgeTotal = questionInfoMapper.selectQuestionInfoCount(questionInfoTestDTO); //章节判断难题总数
|
|
|
questionInfoTestDTO.setQuestionType(2);
|
|
|
int choiceTotal = questionInfoMapper.selectQuestionInfoCount(questionInfoTestDTO); //章节选择难题总数
|
|
@@ -241,13 +255,16 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// System.out.println("简单判断:" + easyJudge);
|
|
|
-// System.out.println("简单选择:" + easyChoice);
|
|
|
-// System.out.println("简单多选:" + easyMultiple);
|
|
|
-// System.out.println("难题判断:" + p);
|
|
|
-// System.out.println("难题选择:" + d);
|
|
|
-// System.out.println("难题多择:" + m);
|
|
|
-// System.out.println("---------------------------------------------");
|
|
|
+
|
|
|
+ System.out.println("简单判断:" + easyJudge);
|
|
|
+ System.out.println("简单选择:" + easyChoice);
|
|
|
+ System.out.println("简单多选:" + easyMultiple);
|
|
|
+ System.out.println("难题判断:" + p);
|
|
|
+ System.out.println("难题选择:" + d);
|
|
|
+ System.out.println("难题多择:" + m);
|
|
|
+ System.out.println("总题数:" + total2);
|
|
|
+
|
|
|
+ System.out.println("---------------------------------------------");
|
|
|
|
|
|
//判断简单
|
|
|
qt.setChapterId(er.getChapterId()); //章节ID
|
|
@@ -267,7 +284,12 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
|
|
|
qt.setQuestionType(3); //判断题
|
|
|
qt.setNum(easyMultiple); //题数
|
|
|
List<QuestionInfo> easyMultipleList = this.selectTestQuestionInfoList(qt);
|
|
|
-
|
|
|
+ if (easyMultiple != easyMultipleList.size()) { //简单题不够的情况下,加到难题上
|
|
|
+ System.out.println("easyMultiple != easyMultipleList.size()");
|
|
|
+ int easyMultipleQ = easyMultiple - easyMultipleList.size();
|
|
|
+ m = m + easyMultipleQ;
|
|
|
+ qt.setNum(easyMultipleList.size());
|
|
|
+ }
|
|
|
//判断难题
|
|
|
qt.setChapterId(er.getChapterId()); //章节ID
|
|
|
qt.setDiffDegree(diffDegree); //高难度
|
|
@@ -306,12 +328,15 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
|
|
|
choiceList.addAll(diffChoiceList);
|
|
|
multipleList.addAll(easyMultipleList);
|
|
|
multipleList.addAll(diffMultipleList);
|
|
|
+ System.out.println("easyMultipleList = " + easyMultipleList.size());
|
|
|
+ System.out.println("diffMultipleList = " + diffMultipleList.size());
|
|
|
}
|
|
|
allList.addAll(judgeList);
|
|
|
allList.addAll(choiceList);
|
|
|
allList.addAll(multipleList);
|
|
|
-// System.out.println("error:" + error);
|
|
|
-// System.out.println("allList:" + allList.size());
|
|
|
+ System.out.println("judgeList = "+judgeList.size());
|
|
|
+ System.out.println("choiceList = " + choiceList.size());
|
|
|
+ System.out.println("multipleList = " + multipleList.size());
|
|
|
return allList;
|
|
|
}
|
|
|
|