浏览代码

考卷未关闭的,如无考试的,则直接关闭

mingfu 3 周之前
父节点
当前提交
42edd4634b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      ie-admin/src/main/java/com/ruoyi/web/service/ExamService.java

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

@@ -267,13 +267,13 @@ public class ExamService {
         if(null == stdAnswer.getAnswerId()) {
             answer.setExamineeId(answerSheet.getExamineeId());
             answer.setStudentId(SecurityUtils.getUserId());
-            answer.setQuestionId(question.getId());
             answer.setSeq(question.getSeq());
-            answer.setKnowledgeId(stdAnswer.getKnowledgeId());
         } else {
             answer.setAnswerId(stdAnswer.getAnswerId());
         }
         answerList.add(answer);
+        answer.setQuestionId(question.getId()); // 错题计算要使用
+        answer.setKnowledgeId(stdAnswer.getKnowledgeId());
         answer.setAnswer(StringUtils.join(question.getAnswers(), ","));
         answer.setMark(null != question.getIsMark() && question.getIsMark());
         answer.setNotKnow(null != question.getIsNotKnow() && question.getIsNotKnow());
@@ -354,7 +354,7 @@ public class ExamService {
             learnExaminee.setPaperType(PaperType.Practice.getVal());
             learnExaminee.setState(ExamineeStatus.Exam.getVal());
             List<LearnExaminee> examineeList = examineeMapper.selectLearnExamineeList(learnExaminee);
-            if (CollectionUtils.isNotEmpty(examineeList)) {
+            if (CollectionUtils.isNotEmpty(examineeList) && ExamineeStatus.Exam.getVal().equals(examineeList.get(0).getState())) {
                 LearnExaminee examinee = examineeList.get(0);
                 LearnAnswer aCond = new LearnAnswer();
                 aCond.setExamineeId(examinee.getExamineeId());