deason пре 1 година
родитељ
комит
183ffa6c0a

+ 1 - 0
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamControlController.java

@@ -346,6 +346,7 @@ public class ExamControlController extends ControllerSupport {
         String acknowledgeId = RedisKeyHelper.getBuilder().studentFileAnswerKey(req.getExamRecordDataId(), req.getOrder());
         ExamFileAnswer fileAnswer = examFileAnswerService.getFileAnswer(acknowledgeId);
         if (null == fileAnswer) {
+            log.warn("{} is not exist.", acknowledgeId);
             throw new StatusException("100010", "无效的数据");
         }
 

+ 1 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordDataServiceImpl.java

@@ -141,6 +141,7 @@ public class ExamRecordDataServiceImpl implements ExamRecordDataService {
         examRecordData.setIsAudit(false);
         examRecordData.setExamStageId(examStageId);
         examRecordData.setExamStageOrder(examStageOrder);
+        examRecordData.setQuestionCount(0);
         examRecordDataRepo.save(examRecordData);
 
         //更新场次的开考状态

+ 6 - 0
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamRecordQuestionsServiceImpl.java

@@ -193,6 +193,12 @@ public class ExamRecordQuestionsServiceImpl implements ExamRecordQuestionsServic
 
         // 试卷题目数量
         Integer quesCount = examRecordDataCache.getQuestionCount();
+        if (quesCount == null || quesCount == 0) {
+            // 先排查具体原因,若为无效脏数据,则将表“ec_oes_exam_record_data”的“exam_record_status”值改为“EXAM_ERROR”即可
+            log.warn("考试记录信息有误! examRecordDataId:{} questionCount:{}", examRecordDataId, quesCount);
+            throw new StatusException("1002", "考试记录信息有误!" + examRecordDataId);
+        }
+
         for (int i = 1; i <= quesCount; i++) {
             ExamQuestion questionCache = this.getExamQuestion(examRecordDataId, i);
             if (questionCache == null) {