|
@@ -404,7 +404,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
}
|
|
}
|
|
|
|
|
|
ExamingSession examingSession = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
ExamingSession examingSession = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
- if (null == examingSession) {
|
|
|
|
|
|
+ if (examingSession == null || ExamingStatus.INFORMAL.equals(examingSession.getExamingStatus())) {
|
|
throw new StatusException("100002", "无效的会话,请离开考试");
|
|
throw new StatusException("100002", "无效的会话,请离开考试");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -415,7 +415,6 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
if (null == examRecordData.getIsContinued() || !examRecordData.getIsContinued()) {
|
|
if (null == examRecordData.getIsContinued() || !examRecordData.getIsContinued()) {
|
|
//如果已经调用过开始作答接口,则不做任何处理
|
|
//如果已经调用过开始作答接口,则不做任何处理
|
|
if (null != examRecordData.getStartTime()) {
|
|
if (null != examRecordData.getStartTime()) {
|
|
- examingSession = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
|
|
resultInfo.setDuration(examingSession.getExamDuration());//直接返回考试会话中的考试时长
|
|
resultInfo.setDuration(examingSession.getExamDuration());//直接返回考试会话中的考试时长
|
|
resultInfo.setUsedExamSeconds(calcUsedExamSeconds(examRecordData.getStudentId()));
|
|
resultInfo.setUsedExamSeconds(calcUsedExamSeconds(examRecordData.getStudentId()));
|
|
return resultInfo;
|
|
return resultInfo;
|
|
@@ -427,12 +426,12 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
examRecordDataService.saveExamRecordDataCache(examRecordDataId, examRecordData);
|
|
examRecordDataService.saveExamRecordDataCache(examRecordDataId, examRecordData);
|
|
|
|
|
|
//更新考试会话中的作答时间,实际考试总时长
|
|
//更新考试会话中的作答时间,实际考试总时长
|
|
- examingSession = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
|
|
examingSession.setStartTime(now.getTime());
|
|
examingSession.setStartTime(now.getTime());
|
|
long actualExamTotalMilliSeconds = calcExamTotalMilliSeconds(examRecordDataId);
|
|
long actualExamTotalMilliSeconds = calcExamTotalMilliSeconds(examRecordDataId);
|
|
actualExamTotalMilliSeconds = actualExamTotalMilliSeconds < 0 ? 0 : actualExamTotalMilliSeconds;
|
|
actualExamTotalMilliSeconds = actualExamTotalMilliSeconds < 0 ? 0 : actualExamTotalMilliSeconds;
|
|
examingSession.setExamDuration(actualExamTotalMilliSeconds);
|
|
examingSession.setExamDuration(actualExamTotalMilliSeconds);
|
|
examingSessionService.saveExamingSession(examRecordData.getStudentId(), examingSession);
|
|
examingSessionService.saveExamingSession(examRecordData.getStudentId(), examingSession);
|
|
|
|
+
|
|
resultInfo.setUsedExamSeconds(calcUsedExamSeconds(examRecordData.getStudentId()));
|
|
resultInfo.setUsedExamSeconds(calcUsedExamSeconds(examRecordData.getStudentId()));
|
|
resultInfo.setDuration(actualExamTotalMilliSeconds);
|
|
resultInfo.setDuration(actualExamTotalMilliSeconds);
|
|
|
|
|