| | |
| | | if (Objects.isNull(examPaper)) { |
| | | throw new RuntimeException("试卷不存在"); |
| | | } |
| | | // 如果已经参加过考试,直接返回数据 |
| | | ExamSubmitTemp hasJoin = new LambdaQueryChainWrapper<>(examSubmitTempMapper) |
| | | .eq(ExamSubmitTemp::getExamId, id) |
| | | .eq(ExamSubmitTemp::getUserId, webContext.getCurrentUser().getId()) |
| | | .one(); |
| | | if (Objects.nonNull(hasJoin)) { |
| | | StartExamVO startExamVO = new StartExamVO(); |
| | | startExamVO.setExamName(exam.getExamName()); |
| | | startExamVO.setId(hasJoin.getExamId()); |
| | | startExamVO.setTitleList(JSON.parseArray(hasJoin.getExamSubmit(), PaperFixQuestionVO.class)); |
| | | startExamVO.setSuggestTime(examPaper.getSuggestTime()); |
| | | startExamVO.setDoTime(hasJoin.getDoTime()); |
| | | return Result.ok(startExamVO); |
| | | } |
| | | // 将题目转换为可临时保存的题目结构。固定试卷和随序试卷的题目是直接保存到content字段的 |
| | | if (ExamPaperTypeEnum.Fixed.getCode().equals(examPaper.getPaperType()) |
| | | || ExamPaperTypeEnum.RandomOrder.getCode().equals(examPaper.getPaperType())) { |