deason пре 2 година
родитељ
комит
19ade8e061

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

@@ -242,7 +242,11 @@ public class ExamControlServiceImpl implements ExamControlService {
         if (examingSession == null) {
             throw new StatusException("1002", "未找到考试会话信息");
         }
+
         if (ExamingStatus.FORMAL.equals(examingSession.getExamingStatus())) {
+            String creationTime = DateUtil.format(examingSession.getCreationTime(), DateUtil.DatePatterns.CHINA_DEFAULT);
+            log.warn("ExamingSession is exist! existExamRecordDataId:{} existExamStudentId:{} curExamStudentId:{} {}",
+                    examingSession.getExamRecordDataId(), examingSession.getExamStudentId(), examStudentId, creationTime);
             throw new StatusException("1003", "已经有考试中的科目");
         }
 
@@ -259,7 +263,16 @@ public class ExamControlServiceImpl implements ExamControlService {
 
         // 是否采用千人千卷规则
         boolean randomPaper = CallType.RANDOM_PAPER.name().equals(examBean.getCallType());
-        DefaultPaper defaultPaper = this.buildPaper(extractConfig, examingSession.getPaperType(), randomPaper);
+
+        DefaultPaper defaultPaper;
+        try {
+            defaultPaper = this.buildPaper(extractConfig, examingSession.getPaperType(), randomPaper);
+        } catch (Exception e) {
+            log.error("获取试卷失败!examId:{} courseId:{} examStudentId:{} err:{}",
+                    examingSession.getExamId(), examingSession.getCourseId(), examStudentId, e.getMessage(), e);
+            throw new StatusException("获取试卷失败,请稍候再试!");
+        }
+
         double paperScore = this.parsePaperScore(defaultPaper);
 
         // 生成考试记录