yangfeng 1 рік тому
батько
коміт
9f56d67f26

+ 7 - 2
web/src/main/java/com/ynfy/buss/exam/exam/dto/ExamAnswerDTO.java

@@ -10,9 +10,14 @@ import lombok.Data;
 public class ExamAnswerDTO {
 
     /**
-     * 试序号
+     * 试序号
      */
-    private Integer index;
+    private String index;
+
+    /**
+     * 题型
+     */
+    private Integer questionType;
 
     /**
      * 试题答案(客观题---单选/多选/判断题)

+ 2 - 2
web/src/main/java/com/ynfy/buss/exam/exam/service/impl/ExamServiceImpl.java

@@ -435,8 +435,8 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
 
                 //设置答题卡
                 setAnswerCard(rootQuestionList, answerCardList);
+                dto.setUserExamQuestionList(rootQuestionList);
             }
-
         }
         dto.setAnswerCardList(answerCardList);
         return dto;
@@ -802,7 +802,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
             }
 
             //获取回答过的题目
-            List<Integer> indexList = examAnswers.stream().map(ExamAnswerDTO::getIndex).collect(toList());
+            List<String> indexList = examAnswers.stream().map(ExamAnswerDTO::getIndex).collect(toList());
             //获取没回答的客观题题目
             List<UserExamQuestion> objectiveNoAnswerList = userExamQuestionList.stream().filter(o -> !indexList.contains(o.getQuestionIndex())).filter(o -> !o.getQuestionType().equals(QuestionType.SIMPLE.getCode())).collect(Collectors.toList());
             objectiveNoAnswerList.stream().forEach(o -> o.setIsRight(false));