|
@@ -30,6 +30,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.OfflineExamService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.OfflineExamCourseInfo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordDataBean;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentBean;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.ExtractConfigCloudService;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetPaperReq;
|
|
@@ -169,10 +170,11 @@ public class OfflineExamServiceImpl implements OfflineExamService {
|
|
|
}
|
|
|
//获取考生信息
|
|
|
ExamStudentEntity examStudentEntity = examStudentRepo.findByExamStudentId(examStudentId);
|
|
|
+ ExamStudentBean bean=of(examStudentEntity);
|
|
|
//检查并获取课程信息
|
|
|
- CourseBean courseBean = checkCourse(examStudentEntity);
|
|
|
+ CourseBean courseBean = checkCourse(bean);
|
|
|
//检查并获取考试信息
|
|
|
- ExamBean examBean = checkExam(examStudentEntity);
|
|
|
+ ExamBean examBean = checkExam(bean);
|
|
|
//获取题库试卷结构(由于存在随机抽卷,所以不能缓存 )
|
|
|
GetPaperReq getPaperReq = new GetPaperReq();
|
|
|
getPaperReq.setExamId(examStudentEntity.getExamId());
|
|
@@ -181,7 +183,7 @@ public class OfflineExamServiceImpl implements OfflineExamService {
|
|
|
GetPaperResp getPaperResp = extractConfigCloudService.getPaper(getPaperReq);
|
|
|
|
|
|
//生成考试记录
|
|
|
- ExamRecordDataEntity examRecordData = examRecordDataService.createOfflineExamRecordData(examStudentEntity,
|
|
|
+ ExamRecordDataEntity examRecordData = examRecordDataService.createOfflineExamRecordData(bean,
|
|
|
examBean, courseBean, getPaperResp.getPaperId(),
|
|
|
null, getPaperResp.getDefaultPaper().getFullyObjective());
|
|
|
//生成分数
|
|
@@ -190,17 +192,17 @@ public class OfflineExamServiceImpl implements OfflineExamService {
|
|
|
examStudentRepo.updateExamStudentFinished(examStudentId);
|
|
|
}
|
|
|
|
|
|
- private CourseBean checkCourse(ExamStudentEntity examStudentEntity) {
|
|
|
- CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(examStudentEntity.getCourseId());
|
|
|
+ private CourseBean checkCourse(ExamStudentBean bean) {
|
|
|
+ CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(bean.getCourseId());
|
|
|
if (!courseBean.getEnable()) {
|
|
|
throw new StatusException("2001", "该课程已被禁用");
|
|
|
}
|
|
|
return courseBean;
|
|
|
}
|
|
|
|
|
|
- private ExamBean checkExam(ExamStudentEntity examStudentEntity) {
|
|
|
- Long examId = examStudentEntity.getExamId();
|
|
|
- Long studentId = examStudentEntity.getStudentId();
|
|
|
+ private ExamBean checkExam(ExamStudentBean bean) {
|
|
|
+ Long examId = bean.getExamId();
|
|
|
+ Long studentId = bean.getStudentId();
|
|
|
ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId, studentId);
|
|
|
|
|
|
//如果启用了了特殊设置,并且无特殊设置时结束考试 配置 设置为true..且实际未设置特殊设置则不允许考试
|
|
@@ -310,18 +312,22 @@ public class OfflineExamServiceImpl implements OfflineExamService {
|
|
|
info.setBasePaperId(record.getBasePaperId());
|
|
|
info.setPaperStructId(record.getPaperStructId());
|
|
|
info.setInfoCollector(record.getInfoCollector());
|
|
|
+ info.setExamRecordQuestionsId(record.getExamRecordQuestionsId());
|
|
|
+ info.setExamRecordStatus(record.getExamRecordStatus());
|
|
|
info.setStartTime(record.getStartTime());
|
|
|
info.setEndTime(record.getEndTime());
|
|
|
info.setCleanTime(record.getCleanTime());
|
|
|
+ info.setIsWarn(record.getIsWarn());
|
|
|
+ info.setIsAudit(record.getIsAudit());
|
|
|
+ info.setIsIllegality(record.getIsIllegality());
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- info.setExamRecordStatus(record.getExamRecordStatus());
|
|
|
info.setUsedExamTime(record.getUsedExamTime());
|
|
|
info.setExamOrder(record.getExamOrder());
|
|
|
info.setIsReexamine(record.getIsReexamine());
|
|
|
info.setIsContinued(record.getIsContinued());
|
|
|
info.setContinuedCount(record.getContinuedCount());
|
|
|
+ info.setIsAllObjectivePaper(record.getIsAllObjectivePaper());
|
|
|
+ info.setIsExceed(record.getIsExceed());
|
|
|
info.setFaceSuccessCount(record.getFaceSuccessCount());
|
|
|
info.setFaceFailedCount(record.getFaceFailedCount());
|
|
|
info.setFaceStrangerCount(record.getFaceStrangerCount());
|
|
@@ -332,4 +338,30 @@ public class OfflineExamServiceImpl implements OfflineExamService {
|
|
|
info.setFaceLandmarkVal(record.getFaceLandmarkVal());
|
|
|
return info;
|
|
|
}
|
|
|
+
|
|
|
+ private ExamStudentBean of(ExamStudentEntity et) {
|
|
|
+ ExamStudentBean b=new ExamStudentBean();
|
|
|
+ b.setId(et.getId());
|
|
|
+ b.setExamStudentId(et.getExamStudentId());
|
|
|
+ b.setExamId(et.getExamId());
|
|
|
+ b.setStudentId(et.getStudentId());
|
|
|
+ b.setStudentCode(et.getStudentCode());
|
|
|
+ b.setStudentName(et.getStudentName());
|
|
|
+ b.setIdentityNumber(et.getIdentityNumber());
|
|
|
+ b.setCourseId(et.getCourseId());
|
|
|
+ b.setCourseCode(et.getCourseCode());
|
|
|
+ b.setCourseLevel(et.getCourseLevel());
|
|
|
+ b.setOrgId(et.getOrgId());
|
|
|
+ b.setRootOrgId(et.getRootOrgId());
|
|
|
+ b.setSpecialtyCode(et.getSpecialtyCode());
|
|
|
+ b.setSpecialtyName(et.getSpecialtyName());
|
|
|
+ b.setPaperType(et.getPaperType());
|
|
|
+ b.setInfoCollector(et.getInfoCollector());
|
|
|
+ b.setFinished(et.getFinished());
|
|
|
+ b.setUsedNum(et.getUsedNum());
|
|
|
+ b.setExtraNum(et.getExtraNum());
|
|
|
+ b.setGrade(et.getGrade());
|
|
|
+ b.setEnable(et.getEnable());
|
|
|
+ return b;
|
|
|
+ }
|
|
|
}
|