|
@@ -605,6 +605,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
examingSession.setPaperType(examStudent.getPaperType());
|
|
examingSession.setPaperType(examStudent.getPaperType());
|
|
examingSession.setRootOrgId(studentCacheBean.getRootOrgId());
|
|
examingSession.setRootOrgId(studentCacheBean.getRootOrgId());
|
|
examingSession.setStudentId(studentCacheBean.getId());
|
|
examingSession.setStudentId(studentCacheBean.getId());
|
|
|
|
+ examingSession.setExamStageId(examStudent.getExamStageId());
|
|
|
|
|
|
redisClient.set(examingSessionKey, examingSession, 10);
|
|
redisClient.set(examingSessionKey, examingSession, 10);
|
|
redisClient.set(examBossKey, examBoss, 60);
|
|
redisClient.set(examBossKey, examBoss, 60);
|
|
@@ -1755,6 +1756,14 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
long cost = null == examingHeartbeat ? 0L : examingHeartbeat.getCost();
|
|
long cost = null == examingHeartbeat ? 0L : examingHeartbeat.getCost();
|
|
|
|
|
|
Long examUsedMilliSeconds = cost * 1000;
|
|
Long examUsedMilliSeconds = cost * 1000;
|
|
|
|
+
|
|
|
|
+ long examTotalMilliSeconds = calcExamTotalMilliSeconds(examingSession.getExamRecordDataId());
|
|
|
|
+ //如果开启场次,并且设置了定点交卷,且考试时间已经用完,则不需要校验冻结时间,直接返回考试时长
|
|
|
|
+ if (isTimingEnd(examingSession.getExamId(), studentId, examingSession.getExamStageId())
|
|
|
|
+ && examUsedMilliSeconds >= examTotalMilliSeconds) {
|
|
|
|
+ return examUsedMilliSeconds;
|
|
|
|
+ }
|
|
|
|
+
|
|
// 如果没有超过冻结时间,抛出异常
|
|
// 如果没有超过冻结时间,抛出异常
|
|
if (ExamType.ONLINE.name().equals(examingSession.getExamType())
|
|
if (ExamType.ONLINE.name().equals(examingSession.getExamType())
|
|
|| ExamType.ONLINE_HOMEWORK.name().equals(examingSession.getExamType())) {
|
|
|| ExamType.ONLINE_HOMEWORK.name().equals(examingSession.getExamType())) {
|
|
@@ -1774,6 +1783,41 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
return examUsedMilliSeconds;
|
|
return examUsedMilliSeconds;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 是否定点交卷
|
|
|
|
+ *
|
|
|
|
+ * @param examId
|
|
|
|
+ * @param studentId
|
|
|
|
+ * @param examStageId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private boolean isTimingEnd(Long examId, Long studentId, Long examStageId) {
|
|
|
|
+ //场次id为空,直接返回false
|
|
|
|
+ if (null == examStageId) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getCachedExam(examId, studentId, examStageId);
|
|
|
|
+ Boolean specialSettingsEnabled = examBean.getSpecialSettingsEnabled();
|
|
|
|
+ //未特殊设置,直接返回false
|
|
|
|
+ if (!specialSettingsEnabled) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //非场次特殊设置,直接返回false
|
|
|
|
+ if (ExamSpecialSettingsType.STAGE_BASED != examBean.getSpecialSettingsType()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //找不到相关场次id直接返回null
|
|
|
|
+ ExamStageCacheBean examStage = CacheHelper.getExamStage(examId, examStageId);
|
|
|
|
+ if (!examStage.getHasValue()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return SubmitType.TIMING_END.name().equals(examStage.getSubmitType());
|
|
|
|
+ }
|
|
|
|
+
|
|
private Integer getSubNumber(ExamRecordQuestions examRecordQuestions, Integer order) {
|
|
private Integer getSubNumber(ExamRecordQuestions examRecordQuestions, Integer order) {
|
|
List<UploadedFileAnswerInfo> list = getReSortedQuestionList(examRecordQuestions);
|
|
List<UploadedFileAnswerInfo> list = getReSortedQuestionList(examRecordQuestions);
|
|
for (UploadedFileAnswerInfo info : list) {
|
|
for (UploadedFileAnswerInfo info : list) {
|