龚焕茏
2024-05-17 6d05f0dc6e96ead24bb7e035e16f18031b1ede78
src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
@@ -161,6 +161,9 @@
                .flatMap(t -> t.getQuestionItems().stream()
                        .map(q -> q.getId()))
                .collect(Collectors.toList());
        if (ObjectUtils.isEmpty(questionIds)) {
            throw new RuntimeException("该试卷没有题目");
        }
        List<Question> questions = questionMapper.selectByIds(questionIds);
        //单选数量
        Integer singleChoice = questions.stream().filter(e -> e.getQuestionType() == 1).collect(Collectors.toList()).size();