智慧保安后台管理-外网-验收版本
zengh
2021-07-19 748bd2dff7201eea3adaa1adbd459be4f0cc75d3
问题修复
1 files modified
34 ■■■■■ changed files
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -75,19 +75,27 @@
                    //对比题目id
                    if (examResultVO.getSubjectChoicesId().equals(examExaminationSubject.getExamSubjectChoices().getId())) {
                        //对比答案
                        //处理多选题的答案排序
                        String[] split = examResultVO.getValue().split(",");
                        StringBuilder builder = new StringBuilder();
                        for (String s : split) {
                            builder.append(s);
                        }
                        char[] arrayCh = builder.toString().toCharArray();
                        //利用数组帮助类自动排序
                        Arrays.sort(arrayCh);
                        String sub0 = Arrays.toString(arrayCh);
                        String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ","");
                        if (sub.equals(examExaminationSubject.getExamSubjectChoices().getAnswer())) {
                            theoryGrade += examResultVO.getGrade();
                        if (examExaminationSubject.getExamSubjectChoices().getChoicesType() == 2){
                            //判断题逻辑
                            if (examResultVO.getValue().equals(examExaminationSubject.getExamSubjectChoices().getAnswer())) {
                                theoryGrade += examResultVO.getGrade();
                            }
                        }else if(examExaminationSubject.getExamSubjectChoices().getChoicesType() == 0 || examExaminationSubject.getExamSubjectChoices().getChoicesType() == 1){
                            //处理多选题的答案排序
                            String[] split = examResultVO.getValue().split(",");
                            StringBuilder builder = new StringBuilder();
                            for (String s : split) {
                                builder.append(s);
                            }
                            char[] arrayCh = builder.toString().toCharArray();
                            //利用数组帮助类自动排序
                            Arrays.sort(arrayCh);
                            String sub0 = Arrays.toString(arrayCh);
                            String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ","");
                            if (sub.equals(examExaminationSubject.getExamSubjectChoices().getAnswer())) {
                                theoryGrade += examResultVO.getGrade();
                            }
                        }
                        //移除当前试卷题目答案对象
                        examExaminationSubjects.remove(examExaminationSubject);