| | |
| | | Map<Integer, Integer> multiple = new HashMap<>(); |
| | | //多选 |
| | | Map<Integer, Integer> multipleMap = list.stream() |
| | | .filter(e -> e.getQuestionType().equals(QuestionTypeEnum.MultipleChoice.getCode())) |
| | | .filter(e -> Objects.equals(QuestionTypeEnum.MultipleChoice.getCode(), e.getQuestionType())) |
| | | .collect(Collectors.toMap(Question::getId, Question::getScore)); |
| | | Integer multipleSource = questionTypeVM.getMultipleChoice() * 2; |
| | | selectRandomScores(multiple, multipleMap, questionTypeVM.getMultipleChoice(), multipleSource); |
| | | |
| | | |
| | | //判断 |
| | | List<Question> collect1 = list.stream().filter(e -> e.getQuestionType().equals(QuestionTypeEnum.TrueFalse.getCode())).collect(Collectors.toList()); |
| | | List<Question> collect1 = list.stream().filter(e -> Objects.equals(e.getQuestionType(), QuestionTypeEnum.TrueFalse.getCode())).collect(Collectors.toList()); |
| | | Map<Integer, Integer> judgmentMap = collect1.stream().collect(Collectors.toMap(Question::getId, Question::getScore)); |
| | | Integer trueFalse1 = questionTypeVM.getTrueFalse(); |
| | | Integer trueFalse = trueFalse1 * 2; |
| | |
| | | Integer radioSource = questionTypeVM.getSingleChoice() * 4; |
| | | //单选 |
| | | Map<Integer, Integer> radioMap = list.stream() |
| | | .filter(e -> e.getQuestionType().equals(QuestionTypeEnum.SingleChoice.getCode())) |
| | | .filter(e -> Objects.equals(e.getQuestionType(), QuestionTypeEnum.SingleChoice.getCode())) |
| | | .collect(Collectors.toMap(Question::getId, Question::getScore)); |
| | | selectRandomScores(multiple, radioMap, questionTypeVM.getSingleChoice(), radioSource); |
| | | |