|
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.themis.business.bean.exam.ExamFileUploadBean;
|
|
|
import com.qmth.themis.business.bean.exam.ExamPrepareBean;
|
|
|
+import com.qmth.themis.business.bean.exam.ExamResumeBean;
|
|
|
import com.qmth.themis.business.bean.exam.ExamStartBean;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
@@ -196,7 +197,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
|
|
|
ExamPrepareBean prepare = new ExamPrepareBean();
|
|
|
prepare.setRecordId(recordId);
|
|
|
- prepare.setAudioPlayTime(ep.getAudioPlayTime());
|
|
|
+ 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));
|
|
@@ -323,6 +324,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex));
|
|
|
if (answerCache == null) {
|
|
|
answerCache = new ExamStudentAnswerCacheBean();
|
|
|
+ answerCache.setMainNumber(mainNumber);
|
|
|
+ answerCache.setSubNumber(subNumber);
|
|
|
+ answerCache.setSubIndex(subIndex);
|
|
|
answerCache.setContent(answer);
|
|
|
answerCache.setVersion(version);
|
|
|
answerCache.setDuration(durationSeconds);
|
|
@@ -405,4 +409,32 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
|
|
|
return UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ExamResumeBean resume(Long studentId, Long recordId) {
|
|
|
+ ExamRecordCacheBean er = (ExamRecordCacheBean) redisUtil.get(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
|
+ if (er == null) {
|
|
|
+ throw new BusinessException("未找到考试记录");
|
|
|
+ }
|
|
|
+ ExamStudentCacheBean es = (ExamStudentCacheBean) redisUtil
|
|
|
+ .get(RedisKeyHelper.examStudentCacheKey(er.getExamStudentId()));
|
|
|
+ if (es == null) {
|
|
|
+ throw new BusinessException("未找到考生");
|
|
|
+ }
|
|
|
+ if (studentId.equals(es.getStudentId())) {
|
|
|
+ throw new BusinessException("考试记录的学生Id和当前登录用户不一致");
|
|
|
+ }
|
|
|
+ ExamPaperCacheBean ep = teExamPaperService.getExamPaperCacheBean(er.getPaperId());
|
|
|
+ if (ep == null) {
|
|
|
+ throw new BusinessException("未找到试卷");
|
|
|
+ }
|
|
|
+
|
|
|
+ ExamResumeBean ret=new ExamResumeBean();
|
|
|
+ ret.setDurationSeconds(er.getDurationSeconds());
|
|
|
+ ret.setPaperUrl(OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getPaperPath()));
|
|
|
+ ret.setStructUrl(OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath()));
|
|
|
+ ret.setHasAudio((ep.getHasAudio()!=null&&ep.getHasAudio().intValue()==1?true:false));
|
|
|
+ ret.setAudioPlayCount(ep.getAudioPlayCount());
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
}
|