|
@@ -262,7 +262,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
initializeExamRecordSession(examingSession, examRecordData, examBean);
|
|
|
|
|
|
//设置并保存上次活动时间
|
|
|
- setAndSaveActiveTime(examRecordData.getId(), ip);
|
|
|
+ setAndSaveActiveTime(examRecordData.getId(), ip, "startExam");
|
|
|
|
|
|
// 保存考试次数控制信息
|
|
|
ExamBoss eb = examBossService.getExamBoss(examingSession.getExamStudentId());
|
|
@@ -833,6 +833,9 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
log.error("updateExamCaptureQueuePriority examRecordDataId:{}, error: db deadlock {}", examRecordDataId, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //设置并保存上次活动时间
|
|
|
+ setAndSaveActiveTime(examRecordDataId, ip, "handInExam");
|
|
|
} else if (handInExamType == HandInExamType.AUTO) {
|
|
|
examRecordData.setExamRecordStatus(ExamRecordStatus.EXAM_AUTO_HAND_IN);
|
|
|
examRecordData.setCleanTime(new Date());
|
|
@@ -845,13 +848,10 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
if (examingActiveTime.getActiveTime() != null) {
|
|
|
examRecordData.setLastActiveTime(new Date(examingActiveTime.getActiveTime()));
|
|
|
} else {
|
|
|
- // activeTime is null ? todo
|
|
|
+ // activeTime is null ??
|
|
|
examRecordData.setLastActiveTime(new Date());
|
|
|
}
|
|
|
|
|
|
- //设置并保存上次活动时间
|
|
|
- setAndSaveActiveTime(examRecordDataId, ip);
|
|
|
-
|
|
|
//特殊处理:如果考试类型为 在线练习,则需要将部分数据提前入库,并更新相关状态
|
|
|
if (ExamType.PRACTICE == examRecordData.getExamType()) {
|
|
|
|
|
@@ -1773,7 +1773,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
checkExamInProgressInfo.setFaceVerifyMinute(faceVerifyMinute);
|
|
|
|
|
|
//设置并保存上次活动时间
|
|
|
- setAndSaveActiveTime(examRecordDataId, ip);
|
|
|
+ setAndSaveActiveTime(examRecordDataId, ip, "checkExamInProgress");
|
|
|
|
|
|
//考试过程记录(断点)打点
|
|
|
ExamingActivityTime lastExamingActivityTime = getExamingActivityTime(examRecordDataId);
|
|
@@ -1833,7 +1833,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
long activeTime = examingActiveTime.getActiveTime() == null ? now : examingActiveTime.getActiveTime();
|
|
|
|
|
|
// 如果已经过了断点续考时间,自动交卷
|
|
|
- if (now - activeTime >= examSessionInfo.getExamReconnectTime().intValue() * 60 * 1000) {
|
|
|
+ if ((now - activeTime) >= examSessionInfo.getExamReconnectTime() * 60L * 1000L) {
|
|
|
delayHandInExamIfLocked(examingRecord.getId());
|
|
|
return null;
|
|
|
}
|
|
@@ -1949,7 +1949,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
redisClient.set(examingHeartbeatKey, examingHeartbeat);//更新心跳缓存
|
|
|
|
|
|
//设置并保存上次活动时间
|
|
|
- setAndSaveActiveTime(examSessionInfo.getExamRecordDataId(), ip);
|
|
|
+ setAndSaveActiveTime(examSessionInfo.getExamRecordDataId(), ip, "examHeartbeat");
|
|
|
|
|
|
// 在线考生心跳打点
|
|
|
ReportsUtil.report(new OnlineExamStudentReport(user.getRootOrgId(), user.getUserId(),
|
|
@@ -1970,11 +1970,12 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
* 设置并保存活动时间
|
|
|
*
|
|
|
* @param examRecordDataId 考试记录id
|
|
|
+ * @param ip IP地址
|
|
|
+ * @param operate 操作
|
|
|
*/
|
|
|
@Override
|
|
|
- public void setAndSaveActiveTime(Long examRecordDataId, String ip) {
|
|
|
- String examingActiveTimeKey = RedisKeyHelper.getBuilder()
|
|
|
- .examingActiveTimeKey(examRecordDataId);
|
|
|
+ public void setAndSaveActiveTime(Long examRecordDataId, String ip, String operate) {
|
|
|
+ String examingActiveTimeKey = RedisKeyHelper.getBuilder().examingActiveTimeKey(examRecordDataId);
|
|
|
ExamingActivityTime examingActiveTime = redisClient.get(examingActiveTimeKey, ExamingActivityTime.class);
|
|
|
if (null == examingActiveTime) {
|
|
|
examingActiveTime = new ExamingActivityTime();
|
|
@@ -1991,6 +1992,8 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
examingActiveTime.setRealIp(ip);
|
|
|
|
|
|
redisClient.set(examingActiveTimeKey, examingActiveTime);
|
|
|
+
|
|
|
+ log.warn("setAndSaveActiveTime examRecordDataId:{} ip:{} operate:{}", examRecordDataId, ip, operate);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2000,8 +2003,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
* @return
|
|
|
*/
|
|
|
private ExamingActivityTime getExamingActivityTime(Long examRecordDataId) {
|
|
|
- String examingActiveTimeKey = RedisKeyHelper.getBuilder()
|
|
|
- .examingActiveTimeKey(examRecordDataId);
|
|
|
+ String examingActiveTimeKey = RedisKeyHelper.getBuilder().examingActiveTimeKey(examRecordDataId);
|
|
|
ExamingActivityTime examingActiveTime = redisClient.get(examingActiveTimeKey, ExamingActivityTime.class);
|
|
|
if (null == examingActiveTime) {
|
|
|
examingActiveTime = new ExamingActivityTime();
|