he2802 2 vuotta sitten
vanhempi
commit
e1a87e57bd

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamSimulateServiceImpl.java

@@ -316,7 +316,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
 
     private List<Long> getWrongQuestion(Long orderGoodsId,Long examId,Integer fromType,Integer orderType,Integer maxQnum,List<Long> knowledQuestionIds,Integer qType){
         if(orderType==2){
-            int num = ((int)(maxQnum*Math.random()) + 1)/2;//最多一半是错题
+            int num = ((int)(maxQnum*Math.random()) + 1)/2;
             ExamSimulateQueryBo queryBo = new ExamSimulateQueryBo();
             queryBo.setOrderGoodsId(orderGoodsId);
             queryBo.setExamId(examId);
@@ -324,7 +324,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
             queryBo.setKnowledQuestionIds(knowledQuestionIds);
             queryBo.setType(qType);
             queryBo.setQnum(num);
-            queryBo.setRandomNum(2);
+            queryBo.setRandomNum(orderType);
             List<Long> questionlist = baseMapper.getWrongQuestionList(queryBo);
             return questionlist;
         }else {

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamSimulateMapper.xml

@@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getWrongQuestionList" parameterType="com.zhongzheng.modules.bank.bo.ExamSimulateQueryBo" resultType="Long">
         SELECT
-        q.question_id
+        DISTINCT q.question_id
         FROM
         user_exam_wrong_record uwr
         LEFT JOIN question q ON uwr.question_id = q.question_id