|
@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
+import cn.com.qmth.examcloud.commons.util.UUID;
|
|
|
import cn.com.qmth.examcloud.commons.util.Util;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.enums.ExamProperties;
|
|
@@ -29,6 +30,7 @@ import cn.com.qmth.examcloud.core.oe.student.base.helper.ExamCacheTransferHelper
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.CommonUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.base.utils.QuestionTypeUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.bean.CheckExamInProgressInfo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.bean.ExamRecordPaperStruct;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.bean.StartExamInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamControlService;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamFaceLivenessVerifyService;
|
|
@@ -95,13 +97,13 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
@Autowired
|
|
|
private ExamCloudService examCloudService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private FaceBiopsyService faceBiopsyService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamFaceLivenessVerifyService examFaceLivenessVerifyService;
|
|
|
-
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public StartExamInfo startExam(Long examStudentId, User user) {
|
|
@@ -195,8 +197,10 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|
|
|
// 保存考试试卷结构
|
|
|
startTime = System.currentTimeMillis();
|
|
|
- examRecordPaperStructService.saveExamRecordPaperStruct(examRecordData.getId(),
|
|
|
- extractConfigPaper.getDefaultPaper());
|
|
|
+ ExamRecordPaperStruct paperStruct = new ExamRecordPaperStruct();
|
|
|
+ paperStruct.setId(UUID.randomUUID());
|
|
|
+ paperStruct.setDefaultPaper(extractConfigPaper.getDefaultPaper());
|
|
|
+ examRecordPaperStructService.saveExamRecordPaperStruct(examRecordData.getId(), paperStruct);
|
|
|
if (log.isDebugEnabled()) {
|
|
|
log.debug("7 保存考试试卷结构耗时:" + (System.currentTimeMillis() - startTime) + " ms");
|
|
|
}
|
|
@@ -565,7 +569,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
} else {// 非新活检,默认使用旧的活检计算方式
|
|
|
faceVerifyMinute = examFaceLivenessVerifyService.getFaceLivenessVerifyMinute(
|
|
|
examSessionInfo.getRootOrgId(), examSessionInfo.getOrgId(), examSessionInfo.getExamId(),
|
|
|
- studentId, examSessionInfo.getExamRecordDataId(), examSessionInfo.getCost().intValue()/60);
|
|
|
+ studentId, examSessionInfo.getExamRecordDataId(), examSessionInfo.getCost().intValue() / 60);
|
|
|
}
|
|
|
|
|
|
checkExamInProgressInfo.setFaceVerifyMinute(faceVerifyMinute);
|
|
@@ -581,7 +585,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
}
|
|
|
|
|
|
// 如果考试时间结束,自动交卷
|
|
|
- if (examSessionInfo.getExamDuration() <= examSessionInfo.getCost()*1000) {
|
|
|
+ if (examSessionInfo.getExamDuration() <= examSessionInfo.getCost() * 1000) {
|
|
|
delayHandInExamIfLocked(examingRecord.getId());
|
|
|
return null;
|
|
|
}
|
|
@@ -656,8 +660,8 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
|| examSessionInfo.getCost() >= examSessionInfo.getExamDuration()) {
|
|
|
throw new StatusException("8001", "无效的会话,请离开考试");
|
|
|
}
|
|
|
- //考试耗时加60秒
|
|
|
- examSessionInfo.setCost(examSessionInfo.getCost()+60);
|
|
|
+ // 考试耗时加60秒
|
|
|
+ examSessionInfo.setCost(examSessionInfo.getCost() + 60);
|
|
|
long now = System.currentTimeMillis();
|
|
|
if (now - examSessionInfo.getActiveTime() >= examSessionInfo.getExamReconnectTime().intValue() * 60 * 1000) {
|
|
|
delayHandInExamIfLocked(examSessionInfo.getExamRecordDataId());
|
|
@@ -668,7 +672,7 @@ public class ExamControlServiceImpl implements ExamControlService {
|
|
|
// 在线考生心跳打点
|
|
|
ReportsUtil.report(new OnlineExamStudentReport(user.getRootOrgId(), user.getUserId(),
|
|
|
examSessionInfo.getExamId(), examSessionInfo.getExamStudentId()));
|
|
|
- // 返回考试剩余时间
|
|
|
+ // 返回考试剩余时间
|
|
|
return examSessionInfo.getExamDuration() - (examSessionInfo.getCost() * 1000);
|
|
|
}
|
|
|
}
|