| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result examSubmit(ExamSubmitVO submitData) { |
| | | public Result examSubmit(StartExamVO submitData) { |
| | | // 校验 |
| | | Exam exam = examMapper.selectById(submitData.getExamId()); |
| | | Exam exam = examMapper.selectById(submitData.getId()); |
| | | if (Objects.isNull(exam)) { |
| | | throw new RuntimeException("该考试不存在"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result timingSubmit(ExamSubmitVO submitData) { |
| | | public Result timingSubmit(StartExamVO submitData) { |
| | | saveTempExam(submitData, ExamSubmitTempStatusEnum.TEMP); |
| | | return Result.ok(); |
| | | } |
| | |
| | | * @param submitData 前端传递的试卷数据 |
| | | * @param status 试卷的状态 |
| | | */ |
| | | public void saveTempExam(ExamSubmitVO submitData, ExamSubmitTempStatusEnum status) { |
| | | public void saveTempExam(StartExamVO submitData, ExamSubmitTempStatusEnum status) { |
| | | ExamSubmitTemp one = new LambdaQueryChainWrapper<>(examSubmitTempMapper) |
| | | .eq(ExamSubmitTemp::getExamId, submitData.getExamId()) |
| | | .eq(ExamSubmitTemp::getExamId, submitData.getId()) |
| | | .eq(ExamSubmitTemp::getUserId, webContext.getCurrentUser().getId()) |
| | | .one(); |
| | | if (Objects.nonNull(one)) { |
| | |
| | | return; |
| | | } |
| | | one.setDoTime(submitData.getDoTime()); |
| | | one.setExamSubmit(JSON.toJSONString(submitData.getPaperQuestionList())); |
| | | one.setExamSubmit(JSON.toJSONString(submitData.getTitleList())); |
| | | one.setCreateTime(new Date()); |
| | | one.setStatus(status); |
| | | examSubmitTempMapper.updateById(one); |
| | | } else { |
| | | ExamSubmitTemp examSubmitTemp = new ExamSubmitTemp(); |
| | | examSubmitTemp.setExamId(submitData.getExamId()); |
| | | examSubmitTemp.setExamId(submitData.getId()); |
| | | examSubmitTemp.setDoTime(submitData.getDoTime()); |
| | | examSubmitTemp.setStatus(status); |
| | | examSubmitTemp.setUserId(webContext.getCurrentUser().getId()); |
| | | examSubmitTemp.setExamSubmit(JSON.toJSONString(submitData.getPaperQuestionList())); |
| | | examSubmitTemp.setExamSubmit(JSON.toJSONString(submitData.getTitleList())); |
| | | examSubmitTemp.setMarkPaperStatus(ExamSubmitTempStatusEnum.TEMP); |
| | | examSubmitTempMapper.insert(examSubmitTemp); |
| | | } |