|
@@ -1,7 +1,6 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.student.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
|
|
|
-import cn.com.qmth.examcloud.api.commons.enums.ExamStageStartExamStatus;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamType;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.SubmitType;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
@@ -38,9 +37,7 @@ import cn.com.qmth.examcloud.core.oe.task.api.ExamCaptureCloudService;
|
|
|
import cn.com.qmth.examcloud.core.oe.task.api.request.SaveExamCaptureSyncCompareResultReq;
|
|
|
import cn.com.qmth.examcloud.core.oe.task.api.request.UpdateExamCaptureQueuePriorityReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
|
-import cn.com.qmth.examcloud.examwork.api.ExamStageCloudService;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamPropertyReq;
|
|
|
-import cn.com.qmth.examcloud.examwork.api.request.ModifyExamStageStartExamStatusReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamPropertyResp;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultPaper;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionGroup;
|
|
@@ -138,8 +135,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
@Autowired
|
|
|
SyncExamDataCloudService syncExamDataCloudService;
|
|
|
- @Autowired
|
|
|
- private ExamStageCloudService examStageCloudService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamRecordDataRepo examRecordDataRepo;
|
|
|
@Autowired
|
|
@@ -288,20 +284,6 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
eb.setStartCount(eb.getStartCount() + 1);
|
|
|
examBossService.saveExamBoss(examStudentId, eb);
|
|
|
|
|
|
- //更新场次的开考状态
|
|
|
- if (null != examStudent.getExamStageId()) {
|
|
|
- ExamSettingsCacheBean cachedExam =
|
|
|
- ExamCacheTransferHelper.getCachedExam(examId, studentId, examStudent.getExamStageId());
|
|
|
- if (cachedExam.getSpecialSettingsEnabled()
|
|
|
- && ExamSpecialSettingsType.STAGE_BASED == cachedExam.getSpecialSettingsType()) {
|
|
|
- //更改考务中的考试状态 TODO 高并发下此处可能会影响开考的性能
|
|
|
- ModifyExamStageStartExamStatusReq req = new ModifyExamStageStartExamStatusReq();
|
|
|
- req.setExamStageId(examStudent.getExamStageId());
|
|
|
- req.setExamStageStartExamStatus(ExamStageStartExamStatus.STARTED.name());
|
|
|
- examStageCloudService.modifyExamStageStartExamStatus(req);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//设置并保存上次活动时间
|
|
|
setAndSaveActiveTime(examRecordData.getId(), ip);
|
|
|
|
|
@@ -1502,7 +1484,9 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
//考试过程记录(断点)打点
|
|
|
ExamingActivityTime lastExamingActivityTime = getExamingActivityTime(examingRecord.getId());
|
|
|
ReportsUtil.report(
|
|
|
- new ExamProcessRecordReport(examingRecord.getId(), ExamProcess.BREAK_OFF, new Date(lastExamingActivityTime.getActiveTime()))
|
|
|
+ new ExamProcessRecordReport(examingRecord.getId(),
|
|
|
+ ExamProcess.BREAK_OFF,
|
|
|
+ lastExamingActivityTime.getActiveTime() == null ? new Date() : new Date(lastExamingActivityTime.getActiveTime()))
|
|
|
);
|
|
|
//考试过程记录(断点续考)打点
|
|
|
ReportsUtil.report(new ExamProcessRecordReport(examingRecord.getId(), ExamProcess.CONTINUE, new Date()));
|
|
@@ -1549,10 +1533,10 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
ExamingActivityTime examingActiveTime = getExamingActivityTime(examSessionInfo.getExamRecordDataId());
|
|
|
|
|
|
- long activeTime = examingActiveTime.getActiveTime();
|
|
|
+ long now = System.currentTimeMillis();
|
|
|
+ long activeTime = examingActiveTime.getActiveTime() == null ? now : examingActiveTime.getActiveTime();
|
|
|
|
|
|
// 如果已经过了断点续考时间,自动交卷
|
|
|
- long now = System.currentTimeMillis();
|
|
|
if (now - activeTime >= examSessionInfo.getExamReconnectTime().intValue() * 60 * 1000) {
|
|
|
delayHandInExamIfLocked(examingRecord.getId());
|
|
|
return null;
|
|
@@ -1700,7 +1684,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
//ip如果发生变更,则记录ip变更记录
|
|
|
String lastIp = examingActiveTime.getRealIp();
|
|
|
- if (StringUtils.isNotEmpty(ip) && !ip.equals(lastIp)) {
|
|
|
+ if (StringUtils.isNotEmpty(ip) && StringUtils.isNotEmpty(lastIp) && !ip.equals(lastIp)) {
|
|
|
ReportsUtil.report(
|
|
|
new ExamProcessRecordReport(examRecrodDataId, ExamProcess.IP_CHANGE, new Date(now))
|
|
|
);
|