|
@@ -548,8 +548,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
*/
|
|
|
private long calcUsedExamSeconds(Long studentId) {
|
|
|
ExamingSession examSessionInfo = examingSessionService.getExamingSession(studentId);
|
|
|
- if (examSessionInfo == null
|
|
|
- || examSessionInfo.getExamingStatus().equals(ExamingStatus.INFORMAL)) {
|
|
|
+ if (examSessionInfo == null || ExamingStatus.INFORMAL.equals(examSessionInfo.getExamingStatus())) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -835,7 +834,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
SequenceLockHelper.getLock(sequenceLockKey);
|
|
|
|
|
|
ExamingSession examingSession = examingSessionService.getExamingSession(studentId);
|
|
|
- if (examingSession == null) {
|
|
|
+ if (examingSession == null || ExamingStatus.INFORMAL.equals(examingSession.getExamingStatus())) {
|
|
|
throw new StatusException("8010", "无效的会话,请离开考试");
|
|
|
}
|
|
|
|
|
@@ -1023,7 +1022,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
ExamingSession examSessionInfo = examingSessionService.getExamingSession(examStudent.getStudentId());
|
|
|
// 判断考试是否结束
|
|
|
- if (examSessionInfo == null) {
|
|
|
+ if (examSessionInfo == null || ExamingStatus.INFORMAL.equals(examSessionInfo.getExamingStatus())) {
|
|
|
throw new StatusException("100006", "考试已结束");
|
|
|
}
|
|
|
if (examSessionInfo.getExamRecordDataId().longValue() != Long.valueOf(examRecordDataId).longValue()
|
|
@@ -1231,7 +1230,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
if (!user.getUserId().equals(examStudent.getStudentId())) {
|
|
|
throw new StatusException("100013", "无效的请求");
|
|
|
}
|
|
|
- if (examSessionInfo == null) {
|
|
|
+ if (examSessionInfo == null || ExamingStatus.INFORMAL.equals(examSessionInfo.getExamingStatus())) {
|
|
|
throw new StatusException("100006", "考试已结束");
|
|
|
}
|
|
|
if (examSessionInfo.getExamRecordDataId().longValue() != req.getExamRecordDataId().longValue()
|
|
@@ -1282,8 +1281,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
}
|
|
|
|
|
|
ExamingSession examSessionInfo = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
|
- if (examSessionInfo == null
|
|
|
- || examSessionInfo.getExamingStatus().equals(ExamingStatus.INFORMAL)) {
|
|
|
+ if (examSessionInfo == null || ExamingStatus.INFORMAL.equals(examSessionInfo.getExamingStatus())) {
|
|
|
throw new StatusException("101001", "无效的会话,请离开考试");
|
|
|
}
|
|
|
|
|
@@ -1923,8 +1921,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
public long examHeartbeat(User user, String ip) {
|
|
|
Long studentId = user.getUserId();
|
|
|
ExamingSession examSessionInfo = examingSessionService.getExamingSession(studentId);
|
|
|
- if (examSessionInfo == null
|
|
|
- || examSessionInfo.getExamingStatus().equals(ExamingStatus.INFORMAL)) {
|
|
|
+ if (examSessionInfo == null || ExamingStatus.INFORMAL.equals(examSessionInfo.getExamingStatus())) {
|
|
|
throw new StatusException("101001", "无效的会话,请离开考试");
|
|
|
}
|
|
|
|
|
@@ -2041,8 +2038,8 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
private Long checkAndComputeExamDuration(Long studentId, Boolean forceEndExam) {
|
|
|
// 获取考试会话,判断考生是否已结束考试(二次校验)
|
|
|
ExamingSession examingSession = examingSessionService.getExamingSession(studentId);
|
|
|
- if (examingSession == null) {
|
|
|
- throw new StatusException("oestudent-100100", "考试会话已过期");
|
|
|
+ if (examingSession == null || ExamingStatus.INFORMAL.equals(examingSession.getExamingStatus())) {
|
|
|
+ throw new StatusException("100100", "考试会话已过期");
|
|
|
}
|
|
|
|
|
|
//交卷时重新计算考试已用时间
|