|
@@ -733,7 +733,6 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
public UserExamDTO examDetail(String userExamId, boolean needAnswerFlag, boolean needAnalysis, boolean needClearBlankContent, boolean needRenderBlank) {
|
|
|
UserExamDTO dto = new UserExamDTO();
|
|
|
UserExam userExam = userExamService.listUserExam(userExamId);
|
|
|
-// System.out.println("yyz显示提交"+userExam);
|
|
|
if (Objects.isNull(userExam)) {
|
|
|
throw new JeecgBootException("考试不存在!");
|
|
|
}
|
|
@@ -821,14 +820,12 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
public UserExamDTO userExamResultDetail(String userExamId,String paperId, boolean needAnswerFlag, boolean needAnalysis, boolean needClearBlankContent, boolean needRenderBlank) {
|
|
|
UserExamDTO dto = new UserExamDTO();
|
|
|
UserExam userExam = userExamService.listUserExamYueJuan(userExamId,paperId);
|
|
|
- //显示试卷详情
|
|
|
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());
|
|
@@ -843,37 +840,66 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
|
|
|
//设置答题卡
|
|
|
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;
|
|
|
+ // UserExamDTO dto = new UserExamDTO();
|
|
|
+// UserExam userExam = userExamService.listUserExamYueJuan(userExamId,paperId);
|
|
|
+// //显示试卷详情
|
|
|
+// 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;
|
|
|
}
|
|
|
public UserExamDTO userExamResultDetails(String paperId,boolean needAnswerFlag, boolean needAnalysis, boolean needClearBlankContent, boolean needRenderBlank) {
|
|
|
UserExamDTO dto = new UserExamDTO();
|
|
@@ -953,19 +979,19 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
setAnswerTag(userExamDTO);
|
|
|
return userExamDTO;
|
|
|
}
|
|
|
-// /**
|
|
|
-// * 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
|
-// *
|
|
|
-// * @param userExamId
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @Override
|
|
|
-// public UserExamDTO userExamResultDetail(String userExamId,String paperId) {
|
|
|
-// UserExamDTO userExamDTO = userExamResultDetail(userExamId,paperId, true, true, false, true);
|
|
|
-// //设置单选题/多选题/判断题的答案tag
|
|
|
-// setAnswerTag(userExamDTO);
|
|
|
-// return userExamDTO;
|
|
|
-// }
|
|
|
+ /**
|
|
|
+ * 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
|
+ *
|
|
|
+ * @param userExamId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public UserExamDTO userExamPaperResultDetail(String userExamId,String paperId) {
|
|
|
+ UserExamDTO userExamDTO = userExamResultDetail(userExamId,paperId, true, true, false, true);
|
|
|
+ //设置单选题/多选题/判断题的答案tag
|
|
|
+ setAnswerTag(userExamDTO);
|
|
|
+ return userExamDTO;
|
|
|
+ }
|
|
|
/**
|
|
|
* 用户考试成绩详情,包括答题卡,试题(包含正确答案和解析)
|
|
|
*
|