From 65c6651f36f292674ad5f3966937dd22e5968326 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期二, 16 七月 2024 09:07:35 +0800 Subject: [PATCH] feat:补考保留最高分 --- src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java index 3dec741..f0145f1 100644 --- a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java +++ b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java @@ -171,6 +171,7 @@ throw new RuntimeException("璇ヨ瘯鍗锋病鏈夐鐩�"); } List<Question> questions = questionMapper.selectByIds(questionIds); + //鍗曢�夋暟閲� Integer singleChoice = questions.stream().filter(e -> e.getQuestionType() == 1).collect(Collectors.toList()).size(); //澶氶�夋暟閲� @@ -186,6 +187,7 @@ List<ExamQuestionVO> questionItemsVM = t.getQuestionItems().stream().map(i -> { Question question = questions.stream().filter(q -> q.getId().equals(i.getId())).findFirst().get(); ExamQuestionVO questionEditRequestVM = questionService.getQuestionEditRequestVM(question); + questionEditRequestVM.setTitle("(" + QuestionTypeEnum.fromCode(questionEditRequestVM.getQuestionType()).getName() + ") " + questionEditRequestVM.getTitle()); questionEditRequestVM.setItemOrder(generateRandomNumber(questionEditRequestVM.getQuestionType() == 1 ? 0 : ((questionEditRequestVM.getQuestionType() == 2 ? singleChoice : multipleChoice + singleChoice)), questionEditRequestVM.getQuestionType() == 1 ? singleChoice : ((questionEditRequestVM.getQuestionType() == 2 ? multipleChoice + singleChoice : trueFalse + multipleChoice + singleChoice)), @@ -269,6 +271,7 @@ if(userDepartments.size() != 0){ Department byId = departmentService.getById(userDepartments.get(0).getDepartmentId()); e.setDepartmentName(byId.getName()); + e.setDeptId(byId.getId()); } return e; }).collect(Collectors.toList()); @@ -527,9 +530,10 @@ Integer order = 0; for (QuestionTypeVM questionTypeVM : questionTypeVMList) { - List<Integer> questions = questionSubjectService.getSubject(questionTypeVM.getSubjectId()) + List<Integer> questions = questionSubjectService.getSubjectBySubjectIds(examPaperEditRequestVM.getSubjectId()) .stream().map(QuestionSubject::getQuestionId).collect(Collectors.toList()); List<Question> list = questionService.selectByIds(questions); + // List<Question> list = questionService.getAll(); Map<Integer, Integer> multiple = new HashMap<>(); //澶氶�� -- Gitblit v1.8.0