xiangpei
2024-06-21 a5722617fcb4fec61551785e55d58a2be45dcc84
src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
@@ -301,7 +301,7 @@
    }
    @Override
    public Result getMarkPaperInfo(Integer id) {
    public Result getMarkResultInfo(Integer id) {
        Exam exam = baseMapper.selectById(id);
        if (Objects.isNull(exam)) {
            throw new RuntimeException("该考试不存在");
@@ -341,4 +341,23 @@
        return Result.ok().data(markPaperVO);
    }
    @Override
    public Result getMarkPaperInfo(Integer examId, Integer userId) {
        ExamSubmitTemp userExam = new LambdaQueryChainWrapper<>(examSubmitTempMapper)
                .eq(ExamSubmitTemp::getExamId, examId)
                .eq(ExamSubmitTemp::getUserId, userId)
                .one();
        if (Objects.isNull(userExam)) {
            throw new RuntimeException("该学员考试记录不存在");
        }
        ExamSubmitVO vo = new ExamSubmitVO();
        vo.setExamId(userExam.getExamId());
        vo.setDoTime(userExam.getDoTime());
        vo.setUpdateTime(userExam.getUpdateTime());
        if (StringUtils.hasText(userExam.getExamSubmit())) {
            vo.setPaperQuestionList(JSON.parseArray(userExam.getExamSubmit(), PaperFixQuestionVO.class));
        }
        return Result.ok(vo);
    }
}