|
@@ -322,6 +322,9 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
log.debug("9 初始化考试会话耗时:" + (System.currentTimeMillis() - startTime) + " ms");
|
|
log.debug("9 初始化考试会话耗时:" + (System.currentTimeMillis() - startTime) + " ms");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //设置并保存上次活动时间
|
|
|
|
+ setAndSaveActiveTime(examRecordData.getId());
|
|
|
|
+
|
|
if (log.isDebugEnabled()) {
|
|
if (log.isDebugEnabled()) {
|
|
log.debug("10 合计 耗时:" + (System.currentTimeMillis() - st) + " ms");
|
|
log.debug("10 合计 耗时:" + (System.currentTimeMillis() - st) + " ms");
|
|
}
|
|
}
|
|
@@ -1432,23 +1435,31 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
redisClient.set(examingHeartbeatKey, examingHeartbeat);
|
|
redisClient.set(examingHeartbeatKey, examingHeartbeat);
|
|
|
|
|
|
|
|
+ setAndSaveActiveTime(examSessionInfo.getExamRecordDataId());
|
|
|
|
+
|
|
|
|
+ // 在线考生心跳打点
|
|
|
|
+ ReportsUtil.report(new OnlineExamStudentReport(user.getRootOrgId(), user.getUserId(),
|
|
|
|
+ examSessionInfo.getExamId(), examSessionInfo.getExamStudentId()));
|
|
|
|
+ // 返回考试剩余时间
|
|
|
|
+ return examSessionInfo.getExamDuration() - (examingHeartbeat.getCost() * 1000);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 设置并保存活动时间
|
|
|
|
+ * @param examRecrodDataId 考试记录id
|
|
|
|
+ */
|
|
|
|
+ private void setAndSaveActiveTime(Long examRecrodDataId) {
|
|
String examingActiveTimeKey = RedisKeyHelper.getBuilder()
|
|
String examingActiveTimeKey = RedisKeyHelper.getBuilder()
|
|
- .examingActiveTimeKey(examSessionInfo.getExamRecordDataId());
|
|
|
|
|
|
+ .examingActiveTimeKey(examRecrodDataId);
|
|
ExamingActivityTime examingActiveTime = redisClient.get(examingActiveTimeKey,
|
|
ExamingActivityTime examingActiveTime = redisClient.get(examingActiveTimeKey,
|
|
ExamingActivityTime.class);
|
|
ExamingActivityTime.class);
|
|
if (null == examingActiveTime) {
|
|
if (null == examingActiveTime) {
|
|
examingActiveTime = new ExamingActivityTime();
|
|
examingActiveTime = new ExamingActivityTime();
|
|
- examingActiveTime.setExamRecordDataId(examSessionInfo.getExamRecordDataId());
|
|
|
|
|
|
+ examingActiveTime.setExamRecordDataId(examRecrodDataId);
|
|
}
|
|
}
|
|
examingActiveTime.setActiveTime(System.currentTimeMillis());
|
|
examingActiveTime.setActiveTime(System.currentTimeMillis());
|
|
|
|
|
|
redisClient.set(examingActiveTimeKey, examingActiveTime);
|
|
redisClient.set(examingActiveTimeKey, examingActiveTime);
|
|
-
|
|
|
|
- // 在线考生心跳打点
|
|
|
|
- ReportsUtil.report(new OnlineExamStudentReport(user.getRootOrgId(), user.getUserId(),
|
|
|
|
- examSessionInfo.getExamId(), examSessionInfo.getExamStudentId()));
|
|
|
|
- // 返回考试剩余时间
|
|
|
|
- return examSessionInfo.getExamDuration() - (examingHeartbeat.getCost() * 1000);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|