|
@@ -159,7 +159,23 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
}
|
|
}
|
|
TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
|
|
TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
|
|
if (teStudentCacheDto.getUnFinishedRecordId() != null) {
|
|
if (teStudentCacheDto.getUnFinishedRecordId() != null) {
|
|
- throw new BusinessException("有尚未完成的考试,不能再次开始候考");
|
|
|
|
|
|
+ Long recordId=teStudentCacheDto.getUnFinishedRecordId();
|
|
|
|
+
|
|
|
|
+ ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(ExamRecordCacheUtil.getPaperId(recordId));
|
|
|
|
+ ExamCourseCacheBean ec = teExamCourseService.getExamCourseCacheBean(es.getExamId(), es.getCourseCode());
|
|
|
|
+ ExamPrepareBean prepare = new ExamPrepareBean();
|
|
|
|
+ prepare.setRecordId(recordId);
|
|
|
|
+ prepare.setAudioPlayCount(ep.getAudioPlayCount());
|
|
|
|
+ prepare.setHasAudio((ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true));
|
|
|
|
+ prepare.setObjectiveShuffle(
|
|
|
|
+ (ec.getObjectiveShuffle() == null || ec.getObjectiveShuffle().intValue() == 0 ? false : true));
|
|
|
|
+ prepare.setOptionShuffle(
|
|
|
|
+ (ec.getOptionShuffle() == null || ec.getOptionShuffle().intValue() == 0 ? false : true));
|
|
|
|
+ String paperurl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getPaperPath());
|
|
|
|
+ String structurl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath());
|
|
|
|
+ prepare.setPaperUrl(paperurl);
|
|
|
|
+ prepare.setStructUrl(structurl);
|
|
|
|
+ return prepare;
|
|
}
|
|
}
|
|
if (es.getLeftExamCount() == 0) {
|
|
if (es.getLeftExamCount() == 0) {
|
|
throw new BusinessException("没有剩余考试次数");
|
|
throw new BusinessException("没有剩余考试次数");
|
|
@@ -302,7 +318,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
|
|
|
// 更新考试记录缓存
|
|
// 更新考试记录缓存
|
|
ExamRecordCacheUtil.setFirstStartTime(recordId, new Date());
|
|
ExamRecordCacheUtil.setFirstStartTime(recordId, new Date());
|
|
- ExamRecordCacheUtil.setStatus(recordId, ExamRecordStatusEnum.FIRST_PREPARE);
|
|
|
|
|
|
+ ExamRecordCacheUtil.setStatus(recordId, ExamRecordStatusEnum.ANSWERING);
|
|
//更新场次-考试记录缓存
|
|
//更新场次-考试记录缓存
|
|
ExamActivityRecordCacheUtil.setExamRecordStatus(activityId, recordId, ExamRecordCacheUtil.getStatus(recordId));
|
|
ExamActivityRecordCacheUtil.setExamRecordStatus(activityId, recordId, ExamRecordCacheUtil.getStatus(recordId));
|
|
return ret;
|
|
return ret;
|