Parcourir la source

客观题输出答案及解释,修正考生重复生成试卷信息

mingfu il y a 3 jours
Parent
commit
8fe1d02f3b

+ 5 - 3
ie-admin/src/main/java/com/ruoyi/web/service/ExamService.java

@@ -491,9 +491,11 @@ public class ExamService {
         examinee.setPaperId(paper.getId());
         examinee.setState(ExamineeStatus.Sign.getVal());
         examinee.setDuration(0L);
-        JSONObject info = new JSONObject();
-        info.put("paperName", paper.getPaperName());
-        examinee.setPaperInfo(info.toJSONString());
+        if(StringUtils.isBlank(examinee.getPaperInfo())) { // 定向有自己的专业信息,否则使用卷名称
+            JSONObject info = new JSONObject();
+            info.put("paperName", paper.getPaperName());
+            examinee.setPaperInfo(info.toJSONString());
+        }
         examineeMapper.insertLearnExaminee(examinee);
         AnswerSheet answerSheet = buildAnswerSheet(paper, examinee, null);
         answerSheet.setSubjectId(paper.getSubjectId());

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

@@ -355,6 +355,9 @@ public class PaperService {
             qs.setQtpye(qt.getTitle()); // TODO 兼容
             if (!chooseTypes.contains(qt)) {
                 qs.setOptions(Lists.newArrayList("会", "不会"));
+                qs.setParse(lqs.getParse());
+                qs.setAnswer1(lqs.getAnswer1());
+                qs.setAnswer2(lqs.getAnswer2());
             } else {
                 qs.setOptions(StringUtils.getOptions(lqs.getOptionA(), lqs.getOptionB(), lqs.getOptionC(), lqs.getOptionD(), lqs.getOptionE(), lqs.getOptionF(), lqs.getOptionG()));
             }