Bladeren bron

生成考试报告

ywx
雍文秀 1 maand geleden
bovenliggende
commit
f391fc3716

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportstu/MsrStudent.java Bestand weergeven

@@ -52,4 +52,7 @@ public class MsrStudent extends BaseBean {
52 52
     @Transient
53 53
     //学生考试状态0未进场1已进场2已交卷3缺考
54 54
     private Integer sstate;
55
+    @Transient
56
+    //得分率
57
+    private Double scorerate;
55 58
 }

+ 12
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrExamService.java Bestand weergeven

@@ -58,6 +58,7 @@ public class MsrExamService {
58 58
         Integer totalnum = N_Utils.obj2Int(students.stream().map(MsClassStudent::getStudentid).distinct().count());
59 59
         Integer stunum = N_Utils.obj2Int(paperStudents.stream().filter(s -> s.getSstate().equals(2)).map(MsPaperStudent::getStudentid).distinct().count());
60 60
         Integer missnum = totalnum - stunum;
61
+        double fullscore = subjects.stream().mapToDouble(MsPaper::getPscore).sum();
61 62
         List<MsrStudent> schoolStudents = new ArrayList<>();//学校学生成绩
62 63
         List<MsrStudent> schoolSubjectStudents = new ArrayList<>();//学校科目学生成绩
63 64
         List<MsrStudent> classStudents = new ArrayList<>();//班级学生成绩
@@ -76,6 +77,7 @@ public class MsrExamService {
76 77
             cs.setStudentid(studentid);
77 78
             cs.setStuscore(list.stream().mapToDouble(MsPaperStudent::getStuscore).sum());
78 79
             cs.setSstate(list.stream().max(Comparator.comparing(MsPaperStudent::getSstate)).get().getSstate());
80
+            cs.setScorerate(N_Utils.getDoubleDivideAndMulitiply(cs.getStuscore(), fullscore));
79 81
             schoolStudents.add(cs);
80 82
         }
81 83
         List<MsrStudent> paperStudents2 = new ArrayList<>();
@@ -150,7 +152,6 @@ public class MsrExamService {
150 152
 
151 153
         //科目分析
152 154
         Map<String, List<MsPaperStudent>> subjectCollect = paperStudents.stream().collect(Collectors.groupingBy(MsPaperStudent::getSubjectid));
153
-        double fullscore = subjects.stream().mapToDouble(MsPaper::getPscore).sum();
154 155
         List<MsrSubject> msrSubjects = new ArrayList<>();
155 156
         MsrSubject msrSubject = new MsrSubject();
156 157
         msrSubject.setExamid(examid);
@@ -161,6 +162,16 @@ public class MsrExamService {
161 162
         msrSubject.setMinscore(schoolStatisticsMin);
162 163
         msrSubject.setAvgscore(schoolStatisticsAverage);
163 164
         msrSubject.setScorerate(N_Utils.getDoubleDivideAndMulitiply(schoolStatisticsAverage, fullscore));
165
+        List<Double> scores = schoolStudents2.stream().map(MsrStudent::getStuscore).sorted().collect(Collectors.toList());
166
+        double bzc = MarkingUtil.bzc(scores);
167
+        msrSubject.setBzc(bzc);
168
+        msrSubject.setCyxs(N_Utils.getDoubleDivideAndMulitiply(bzc, schoolStatisticsAverage));
169
+        msrSubject.setNd(MarkingUtil.div(schoolStatisticsAverage, fullscore));
170
+        msrSubject.setQfd(MarkingUtil.qfd(scores));
171
+        List<Double> scoreRates = schoolStudents2.stream().map(MsrStudent::getScorerate).sorted().collect(Collectors.toList());
172
+        double dfllc = MarkingUtil.sub(scoreRates.get(scoreRates.size() - 1), scoreRates.get(0));
173
+        msrSubject.setDflxdlc(MarkingUtil.div(dfllc, schoolStatisticsAverage));
174
+        msrSubject.setDfllc(dfllc);
164 175
         msrSubject.setTotalnum(totalnum);
165 176
         msrSubject.setStunum(stunum);
166 177
         msrSubject.setMissnum(missnum);

+ 26
- 0
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java Bestand weergeven

@@ -398,6 +398,32 @@ public class MarkingUtil {
398 398
         return N_Utils.formatDouble(Math.sqrt(fc(x)), 2);
399 399
     }
400 400
 
401
+    //区分度=2×(高分组平均分-低分组平均分)/100
402
+    public static double qfd(List<Double> scores) {
403
+        if (N_Utils.isListEmpty(scores)) return 0;
404
+
405
+        int totalCount = scores.size();
406
+        int highCount = (int) Math.ceil(totalCount * 0.27); // 高分组人数
407
+        int lowCount = (int) Math.ceil(totalCount * 0.27);  // 低分组人数
408
+
409
+        List<Double> highGroup = new ArrayList<>(scores.subList(totalCount - highCount, totalCount)); // 高分组
410
+        List<Double> lowGroup = new ArrayList<>(scores.subList(0, lowCount)); // 低分组
411
+        // 计算高分组和低分组的平均分
412
+        double highGroupAvg = calculateAverage(highGroup);
413
+        double lowGroupAvg = calculateAverage(lowGroup);
414
+        return div(mul(2, sub(highGroupAvg, lowGroupAvg)), 100);
415
+    }
416
+
417
+    //计算平均分
418
+    public static double calculateAverage(List<Double> scores) {
419
+        if (N_Utils.isListEmpty(scores)) return 0;
420
+        double sum = 0.0;
421
+        for (double score : scores) {
422
+            sum = add(sum, score);
423
+        }
424
+        return div(sum, scores.size());
425
+    }
426
+
401 427
 
402 428
     public static void main(String[] args) {
403 429
         String str = "ADAC-D-(C)(AB)(CD)(ACB)BB";

Laden…
Annuleren
Opslaan