|
@@ -836,6 +836,71 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
dto.setExamPapersList(examPapersList);
|
|
dto.setExamPapersList(examPapersList);
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
+ public UserExamDTO userExamResultDetails(String paperId,boolean needAnswerFlag, boolean needAnalysis, boolean needClearBlankContent, boolean needRenderBlank) {
|
|
|
|
+ UserExamDTO dto = new UserExamDTO();
|
|
|
|
+ List<UserExam> listuserExam = userExamService.listUserExamYueJuans(paperId);
|
|
|
|
+ UserExam userExam = new UserExam();
|
|
|
|
+ String userExamId="";
|
|
|
|
+ if (listuserExam.size()>0) {
|
|
|
|
+ userExam=listuserExam.get(0);
|
|
|
|
+ userExamId=userExam.getId();
|
|
|
|
+ }else {
|
|
|
|
+ throw new JeecgBootException("没有可阅卷的试卷!");
|
|
|
|
+ }
|
|
|
|
+ //显示试卷详情
|
|
|
|
+ if (Objects.isNull(userExam)) {
|
|
|
|
+ throw new JeecgBootException("考试不存在!");
|
|
|
|
+ }
|
|
|
|
+ BeanUtils.copyProperties(userExam, dto);
|
|
|
|
+ List<UserExamQuestion> userExamQuestionList = dto.getUserExamQuestionList();
|
|
|
|
+ List<Map<String, AnswerCardDTO>> answerCardList = new ArrayList<>();
|
|
|
|
+ List< AnswerCardDTO> answerCardList2 = new ArrayList<>();
|
|
|
|
+ if (!CollectionUtils.isEmpty(userExamQuestionList)) {
|
|
|
|
+ List<UserExamQuestion> rootQuestionList = userExamQuestionList.stream().filter(r -> !Objects.isNull(r.getChild()) && !r.getChild())
|
|
|
|
+ .sorted(Comparator.comparing(UserExamQuestion::getQuestionIndex)).collect(Collectors.toList());
|
|
|
|
+ List<UserExamQuestion> childQuestionList = userExamQuestionList.stream().filter(r -> !Objects.isNull(r.getChild()) && r.getChild())
|
|
|
|
+ .sorted(Comparator.comparing(UserExamQuestion::getQuestionIndex)).collect(Collectors.toList());
|
|
|
|
+ if (!CollectionUtils.isEmpty(rootQuestionList)) {
|
|
|
|
+ //获取题目和答案
|
|
|
|
+ assembleUserExamQuestion(userExamId, rootQuestionList, childQuestionList, needAnswerFlag, needAnalysis, false, true, needClearBlankContent);
|
|
|
|
+
|
|
|
|
+ //设置题目
|
|
|
|
+ setUserExamQuestion(rootQuestionList, needRenderBlank);
|
|
|
|
+
|
|
|
|
+ //设置答题卡
|
|
|
|
+ setAnswerCard(rootQuestionList, answerCardList);
|
|
|
|
+ setAnswerCard2(rootQuestionList, answerCardList2);
|
|
|
|
+ dto.setUserExamQuestionList(rootQuestionList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dto.setAnswerCardList(answerCardList);
|
|
|
|
+ dto.setAnswerCardList2(answerCardList2);
|
|
|
|
+// //获取有没有正在考试的试卷信息
|
|
|
|
+// LambdaQueryWrapper<UserExamPapers> wrapperpaper = new LambdaQueryWrapper<UserExamPapers>();
|
|
|
|
+// wrapperpaper.eq(UserExamPapers::getUserExamId, userExam.getId())
|
|
|
|
+// .eq(UserExamPapers::getState, PaperState.ING);
|
|
|
|
+// List<UserExamPapers> userExamPapersList=BeanContext.getApplicationContext().getBean(IUserExamPapersService.class).list(wrapperpaper);
|
|
|
|
+// //获取本地当前时间
|
|
|
|
+// userExamPapersList.get(0).setSystemTime(new Date());
|
|
|
|
+// //在返回值中添加考试试卷信息
|
|
|
|
+// dto.setUserExamPapersList(userExamPapersList);
|
|
|
|
+ //添加当前考试的所有试卷信息
|
|
|
|
+ List<ExamPapers> examPapersList=iExamPapersService.getExamIdPaper(userExam.getExamId());
|
|
|
|
+ List<UserExamPapers> userExamPapersList1=new ArrayList<UserExamPapers>();
|
|
|
|
+ for (ExamPapers examPapers : examPapersList) {
|
|
|
|
+ //获取是否考试状态并赋值
|
|
|
|
+ userExamPapersList1 = iUserExamPapersService.UserExamPapersList(userExamId, examPapers.getPaperId());
|
|
|
|
+ if (userExamPapersList1.size() == 0) {
|
|
|
|
+ examPapers.setState(9);
|
|
|
|
+ } else {
|
|
|
|
+ examPapers.setState(userExamPapersList1.get(0).getState());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dto.setExamPapersList(examPapersList);
|
|
|
|
+ return dto;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
* 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
*
|
|
*
|
|
@@ -849,7 +914,19 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
setAnswerTag(userExamDTO);
|
|
setAnswerTag(userExamDTO);
|
|
return userExamDTO;
|
|
return userExamDTO;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
|
|
+ *
|
|
|
|
+ * @param paperId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public UserExamDTO userExamResultDetails(String paperId) {
|
|
|
|
+ UserExamDTO userExamDTO = userExamResultDetails(paperId, true, true, false, true);
|
|
|
|
+ //设置单选题/多选题/判断题的答案tag
|
|
|
|
+ setAnswerTag(userExamDTO);
|
|
|
|
+ return userExamDTO;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 设置单选题/多选题/判断题的答案tag
|
|
* 设置单选题/多选题/判断题的答案tag
|
|
*
|
|
*
|