| | |
| | | studentExamInfoVO.setStatus(examSubmitTemp.getStatus()); |
| | | studentExamInfoVO.setDoTime(examSubmitTemp.getDoTime()); |
| | | } else { |
| | | studentExamInfoVO.setMarkPaperStatus(ExamSubmitTempStatusEnum.temp); |
| | | //不存在考试记录 |
| | | studentExamInfoVO.setStatus(ExamSubmitTempStatusEnum.temp); |
| | | //根据Score表判断 |
| | | ExamPaperScore paperScore = examPaperScoreMapper.getByExamIdUserId(exam.getId(), userId); |
| | | if(paperScore==null) { |
| | | studentExamInfoVO.setMarkPaperStatus(ExamSubmitTempStatusEnum.temp); |
| | | }else { |
| | | studentExamInfoVO.setMarkPaperStatus(ExamSubmitTempStatusEnum.finish); |
| | | } |
| | | studentExamInfoVO.setDoTime(0); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Result getMarkPaperInfo(Integer examId, Integer userId) { |
| | | User student = userMapper.getUserById(userId); |
| | | //如果已经阅过卷了,查成绩表 |
| | | Result<ExamPaperMarkVO> paperMarkVO1 = checkHasJudge(examId, userId); |
| | | Result<ExamPaperMarkVO> paperMarkVO1 = checkHasJudge(examId, student); |
| | | if (paperMarkVO1 != null) return paperMarkVO1; |
| | | |
| | | User student = userMapper.getUserById(userId); |
| | | ExamVO exam = examMapper.getById(examId); |
| | | //学生答题表 |
| | | ExamSubmitTemp userExam = new LambdaQueryChainWrapper<>(examSubmitTempMapper) |
| | |
| | | } |
| | | |
| | | //检查是否阅卷 |
| | | private Result<ExamPaperMarkVO> checkHasJudge(Integer examId, Integer userId) { |
| | | ExamPaperScore examPaperScore = examPaperScoreMapper.getByExamIdUserId(examId, userId); |
| | | private Result<ExamPaperMarkVO> checkHasJudge(Integer examId, User student) { |
| | | ExamPaperScore examPaperScore = examPaperScoreMapper.getByExamIdUserId(examId, student.getId()); |
| | | if (examPaperScore != null) { |
| | | ExamPaperMarkVO paperMarkVO = new ExamPaperMarkVO(); |
| | | BeanUtils.copyProperties(examPaperScore, paperMarkVO); |
| | | paperMarkVO.setUserName(student.getRealName()); |
| | | paperMarkVO.setTotalScore(examPaperScore.getTotalScore() + ""); |
| | | paperMarkVO.setScore(examPaperScore.getScore() + ""); |
| | | if (!StringUtils.isEmpty(examPaperScore.getPaperContent())) { |
| | |
| | | paperMarkVO.setTitleItems(JSON.parseArray(userExam.getExamSubmit(), PaperFixQuestionVO.class)); |
| | | } else { |
| | | //缺考,学生没有做题信息 |
| | | paperMarkVO.setExamId(exam.getExamPaperId()); |
| | | paperMarkVO.setExamId(exam.getId()); |
| | | paperMarkVO.setUserId(student.getId()); |
| | | paperMarkVO.setScore(BigDecimal.ZERO + ""); |
| | | paperMarkVO.setDoTime(0); |