|
@@ -1629,21 +1629,9 @@ public class KmtExerciseServiceImpl implements KmtExerciseService {
|
|
|
|
|
|
List<ExerciseBookCourseClassDto> list = kmtExerciseMapperService.findClassifyQuestionsByIds(questionErrors.stream().map(question -> question.getQuestionId()).collect(Collectors.toList()));
|
|
|
if (list != null){
|
|
|
- for (ExerciseBookCourseClassDto parentQuetion : list){
|
|
|
- for (ExerciseQuetionDto childQuestion : parentQuetion.getList()){
|
|
|
- for (KmtExerciseQuestionErrors qe : questionErrors){
|
|
|
- if (qe.getQuestionId().equals(childQuestion.getQuestionId())){
|
|
|
- childQuestion.setFromUserId(qe.getSetErrorUserId());
|
|
|
- childQuestion.setToUserId(qe.getErrorUserId());
|
|
|
- childQuestion.appendUserNameByIds(users);
|
|
|
- childQuestion.setFromUser(kmtExerciseQuestionService.getAuthorityByType(qe.getSetErrorUserAuth()) + childQuestion.getFromUser());
|
|
|
- childQuestion.setToUser(kmtExerciseQuestionService.getAuthorityByType(qe.getErrorUserAuth()) + childQuestion.getToUser());
|
|
|
- childQuestion.setReason(qe.getErrorReason());
|
|
|
- childQuestion.setErrorReasonImage(qe.getErrorReasonImage());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //相同的题在不同的角色下被报错
|
|
|
+ for (KmtExerciseQuestionErrors qe : questionErrors){
|
|
|
+ appendErrorInfo2QuestionList(list, qe, users);
|
|
|
}
|
|
|
data.put("list", list);
|
|
|
}
|
|
@@ -1655,6 +1643,33 @@ public class KmtExerciseServiceImpl implements KmtExerciseService {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 合并题目列表和错题列表的信息
|
|
|
+ * @param list
|
|
|
+ * @param qe
|
|
|
+ * @param users
|
|
|
+ */
|
|
|
+ private void appendErrorInfo2QuestionList (List<ExerciseBookCourseClassDto> list, KmtExerciseQuestionErrors qe,
|
|
|
+ List<TbLibManager> users){
|
|
|
+ if (list != null && qe != null){
|
|
|
+ for (ExerciseBookCourseClassDto parentQuetion : list){
|
|
|
+ for (ExerciseQuetionDto childQuestion : parentQuetion.getList()){
|
|
|
+ if (qe.getQuestionId().equals(childQuestion.getQuestionId())
|
|
|
+ && StringUtil.isBlank(childQuestion.getFromUser()) && StringUtil.isBlank(childQuestion.getToUser())){
|
|
|
+ childQuestion.setFromUserId(qe.getSetErrorUserId());
|
|
|
+ childQuestion.setToUserId(qe.getErrorUserId());
|
|
|
+ childQuestion.appendUserNameByIds(users);
|
|
|
+ childQuestion.setFromUser(kmtExerciseQuestionService.getAuthorityByType(qe.getSetErrorUserAuth()) + childQuestion.getFromUser());
|
|
|
+ childQuestion.setToUser(kmtExerciseQuestionService.getAuthorityByType(qe.getErrorUserAuth()) + childQuestion.getToUser());
|
|
|
+ childQuestion.setReason(qe.getErrorReason());
|
|
|
+ childQuestion.setErrorReasonImage(qe.getErrorReasonImage());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> findErrorExerciseBooks (String userId, String bookName){
|
|
|
List<ExerciseBookEditDto> books = kmtExerciseMapper.findErrorExerciseBooks(bookName, userId);
|