Browse Source

练习卷状态及补充条件修正

mingfu 6 days ago
parent
commit
0d3f871b3e

+ 3 - 2
ie-admin/src/main/java/com/ruoyi/web/service/PaperService.java

@@ -65,7 +65,7 @@ public class PaperService {
         // buildSimulatedPaperForUniversity(20950L, 11L, 78L, 2);
         // buildSimulatedPaperForUniversity(20962L, 11L, 156L, 2);
         // test2();
-        // testCulture(2026, 911, true);
+        // testCulture(2026, 912, false); // 909-911 三套
         // corrQuestions();
     }
 
@@ -567,6 +567,7 @@ public class PaperService {
         } while(pqList.size() < total);
 
         // 补充
+        qCond.setId(null);
         typeQuestionMap.clear();
         knowTypeAssignList = Lists.newArrayList(knowTypeAssignMap.values());
         while(pqList.size() < total) {
@@ -580,7 +581,7 @@ public class PaperService {
                 if (null == questions) {
                     qCond.setKnowledgeId(knowTypeAssign.getKnowId());
                     qCond.setQtpye(knowTypeAssign.getType());
-                    qCond.setNumber(knowTypeAssign.exclCount > 500 ? (long) random.nextInt(knowTypeAssign.exclCount.intValue() - 500) : 0L);
+                    qCond.setNumber(knowTypeAssign.total > 500 ? (long) random.nextInt(knowTypeAssign.total.intValue() - 500) : 0L);
                     qCond.setIsSubType("2");
                     questions = questionsService.selectQuestionsForPaper(qCond);
                     typeQuestionMap.put(knowTypeAssign.getType(), questions);

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/service/SysRegisterService.java

@@ -254,7 +254,7 @@ public class SysRegisterService
                 if(BindStatus.Pend.code().equals(user.getBindStatus())) {
                     user.setBindStatus(BindStatus.Bind.code());
                 }
-                user.setEvalCounts("{\"1\":1,\"2\":1,\"3\":1,\"4\":1,\"9\":1,\"11\":1,\"0\":0}");
+                user.setEvalCounts("{\"1\":3,\"2\":3,\"3\":3,\"4\":3,\"9\":3,\"11\":5,\"0\":0}");
                 user.setCardId(card.getCardId());
                 user.setRegStatus(UserRegStatus.Student);
                 card.setStatus(CardStatus.Active.getVal());

+ 3 - 3
ie-system/src/main/resources/mapper/learn/LearnQuestionsMapper.xml

@@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="statByKnowledge" parameterType="map" resultMap="LearnQuestionsResult">
         SELECT kq.knowledge_id `knowledgeId`, COUNT(DISTINCT kq.`question_id`) number, COUNT(DISTINCT IF(e.`examinee_id` IS NOT NULL, kq.`question_id`, NULL)) id, COUNT(DISTINCT IF(e.`examinee_id` IS NOT NULL AND a.`state` = 1, kq.`question_id`, NULL)) year
         FROM `learn_knowledge_question` kq
-        LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
+        LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state &gt; 0 AND a.`student_id` = #{studentId}
         LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` &gt;= 4
         JOIN `learn_questions` q ON q.`id` = kq.`question_id`
         <where>
@@ -313,7 +313,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        SELECT kq.knowledge_id `knowledgeId`, q.`qtpye`, COUNT(*) number
          FROM `learn_knowledge_question` kq
          <if test="studentId != null">
-             LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
+             LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state &gt; 0 AND a.`student_id` = #{studentId}
              LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` >= 4
          </if>
         <if test="filterType != null">
@@ -336,7 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT q.`id`, kq.knowledge_id `knowledgeId`, q.title, q.isSubType
         FROM `learn_knowledge_question` kq
         <if test="id != null">
-            LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{id}
+            LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state &gt; 0  AND a.`student_id` = #{id}
             LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` >= 4
         </if>
         <if test="area != null">