王宁 пре 1 месец
родитељ
комит
2b0571c7b0
17 измењених фајлова са 396 додато и 117 уклоњено
  1. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperQtypeQuestionMapper.java
  2. 1
    2
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java
  3. 7
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaperQtypeQuestion.java
  4. 6
    6
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQtype.java
  5. 6
    2
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestion.java
  6. 10
    4
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestionObj.java
  7. 4
    4
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportsubject/MsrSubjectPoint.java
  8. 0
    4
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestion.java
  9. 177
    1
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java
  10. 3
    5
      smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrReportparamService.java
  11. 117
    80
      smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java
  12. 18
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/RankGroupVo.java
  13. 30
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/SzJsonVo.java
  14. 1
    1
      smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml
  15. 8
    0
      smarking/src/main/resources/mapper/paper/MsPaperQtypeQuestionMapper.xml
  16. 5
    5
      smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml
  17. 1
    3
      smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperQtypeQuestionMapper.java Прегледај датотеку

@@ -54,5 +54,7 @@ public interface MsPaperQtypeQuestionMapper extends TkMapper<MsPaperQtypeQuestio
54 54
     int updateBatchQuestionCoor(@Param("list") List<MsPaperQtypeQuestion> list);
55 55
     //清空试题切割坐标
56 56
     int updateQuestionCoorByMpid(@Param("mpid")Integer mpid);
57
+    //试卷中所有试题-考试报告
58
+    List<MsPaperQtypeQuestion> listQuestionsForReport(@Param("mpid")Integer mpid);
57 59
 
58 60
 }

+ 1
- 2
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java Прегледај датотеку

@@ -2,7 +2,6 @@ package com.xhkjedu.smarking.mapper.report.reportother;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
5
-import com.xhkjedu.smarking.vo.report.reportother.ReportParams;
6 5
 import org.apache.ibatis.annotations.Param;
7 6
 
8 7
 import java.util.List;
@@ -15,7 +14,7 @@ import java.util.List;
15 14
 public interface MsrReportparamMapper extends TkMapper<MsrReportparam> {
16 15
 
17 16
     //获取考试指定图例对应参数
18
-    List<MsrReportparam> listReportparamByRpbelong(@Param("rp") ReportParams reportParams);
17
+    List<MsrReportparam> listReportparamByRpbelong(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode);
19 18
 
20 19
     //批量删除
21 20
     int deleteBatchReportparam(@Param("list") List<Integer> list);

+ 7
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaperQtypeQuestion.java Прегледај датотеку

@@ -60,4 +60,11 @@ public class MsPaperQtypeQuestion extends BaseBean {
60 60
     //试题知识点
61 61
     @Transient
62 62
     private List<MsPaperQtypeQuestionPoint> points;
63
+
64
+    @Transient
65
+    private String mptqn;//大题题号
66
+    @Transient
67
+    private Integer mptnum;//题型下试题数量
68
+    @Transient
69
+    private Double mptscore;//题型下试题分值
63 70
 }

+ 6
- 6
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQtype.java Прегледај датотеку

@@ -40,15 +40,15 @@ public class MsrClassQtype extends BaseBean {
40 40
     //满分
41 41
     private Double fullscore;
42 42
     //满分人数
43
-    private Integer fullnum;
43
+    private Integer mfnum;
44 44
     //满分人ids
45
-    private String fullids;
45
+    private String mfids;
46 46
     //满人人数占比
47
-    private Double fullrate;
47
+    private Double mfrate;
48 48
     //零分人数
49
-    private Integer zeronum;
49
+    private Integer lfnum;
50 50
     //零分人ids
51
-    private String zeroids;
51
+    private String lfids;
52 52
     //零分人数占比
53
-    private Double zerorate;
53
+    private Double lfrate;
54 54
 }

+ 6
- 2
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestion.java Прегледај датотеку

@@ -19,7 +19,7 @@ public class MsrClassQuestion extends BaseBean {
19 19
     private Integer cqid;
20 20
     //考试ID
21 21
     private Integer examid;
22
-    //科目ID(含总分)
22
+    //科目ID
23 23
     private String subjectid;
24 24
     //班级ID(含全体)
25 25
     private Integer classid;
@@ -60,7 +60,7 @@ public class MsrClassQuestion extends BaseBean {
60 60
     //标准差
61 61
     private Double bzc;
62 62
     //差异系数
63
-    private Double cxxs;
63
+    private Double cyxs;
64 64
     //区分度
65 65
     private Double qfd;
66 66
     //区分度描述
@@ -73,10 +73,14 @@ public class MsrClassQuestion extends BaseBean {
73 73
     private Double zqrate;
74 74
     //零分人数
75 75
     private Integer lfnum;
76
+    //零分人数ID
77
+    private String lfids;
76 78
     //零分率
77 79
     private Double lfrate;
78 80
     //满分人数
79 81
     private Integer mfnum;
82
+    //满分人数ID
83
+    private String mfids;
80 84
     //满分人数占比
81 85
     private Double mfrate;
82 86
 }

+ 10
- 4
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestionObj.java Прегледај датотеку

@@ -17,14 +17,20 @@ public class MsrClassQuestionObj extends BaseBean {
17 17
     @Id
18 18
     //阅卷报告-班级试题小题分析-客观题答案分析ID
19 19
     private Integer cqoid;
20
-    //班级试题小题分析表ID
21
-    private Integer cqid;
20
+    //考试ID
21
+    private Integer examid;
22
+    //科目ID
23
+    private String subjectid;
24
+    //班级ID(含全体)
25
+    private Integer classid;
26
+    //试卷试题id
27
+    private Integer mptqid;
22 28
     //选项答案
23 29
     private String xxda;
24 30
     //人数
25
-    private Integer onum;
31
+    private Integer xxnum;
26 32
     //比例
27
-    private Double orate;
33
+    private Double xxrate;
28 34
     //生学id字符串
29 35
     private String stuids;
30 36
 }

+ 4
- 4
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportsubject/MsrSubjectPoint.java Прегледај датотеку

@@ -30,13 +30,13 @@ public class MsrSubjectPoint extends BaseBean {
30 30
     //满分
31 31
     private Double fullscore;
32 32
     //满分人数
33
-    private Integer fullnum;
33
+    private Integer mfnum;
34 34
     //满分人数ids
35
-    private String fullids;
35
+    private String mfids;
36 36
     //零分人数
37
-    private Integer zeronum;
37
+    private Integer lfnum;
38 38
     //零分人数id
39
-    private String zeroids;
39
+    private String lfids;
40 40
     //最高分
41 41
     private Double maxscore;
42 42
     //最低分

+ 0
- 4
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestion.java Прегледај датотеку

@@ -113,8 +113,4 @@ public class MsPaperStudentQuestion extends BaseBean {
113 113
     private Integer hasanswer;//试卷是否设置了正确
114 114
     @Transient
115 115
     private String qanswer;//试题正确答案
116
-    @Transient
117
-    private Integer qtype;//类型1客观题2主观题
118
-    @Transient
119
-    private String mptqn;//题型题号
120 116
 }

+ 177
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java Прегледај датотеку

@@ -1,11 +1,25 @@
1 1
 package com.xhkjedu.smarking.service.report.generate;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.smarking.mapper.exam.MsClassStudentMapper;
5
+import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
6
+import com.xhkjedu.smarking.mapper.paper.MsPaperQtypeQuestionMapper;
7
+import com.xhkjedu.smarking.mapper.report.reportother.MsrReportparamMapper;
3 8
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
9
+import com.xhkjedu.smarking.model.exam.MsClassStudent;
10
+import com.xhkjedu.smarking.model.paper.MsPaper;
11
+import com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion;
12
+import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
13
+import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
4 14
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
15
+import com.xhkjedu.smarking.utils.MarkingUtil;
16
+import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
5 17
 import org.springframework.stereotype.Service;
6 18
 
7 19
 import javax.annotation.Resource;
20
+import java.util.ArrayList;
8 21
 import java.util.List;
22
+import java.util.stream.Collectors;
9 23
 
10 24
 /**
11 25
  * @Description:试题对应报告内容
@@ -16,10 +30,172 @@ import java.util.List;
16 30
 public class ReportGenerateQuestionService {
17 31
     @Resource
18 32
     private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
33
+    @Resource
34
+    private MsClassStudentMapper msClassStudentMapper;
35
+    @Resource
36
+    private MsSubjectMapper msSubjectMapper;
37
+    @Resource
38
+    private MsPaperQtypeQuestionMapper msPaperQtypeQuestionMapper;
39
+    @Resource
40
+    private MsrReportparamMapper msrReportparamMapper;
19 41
 
20
-    public void generateQuestion(Integer examid){
42
+    public void generateQuestion(Integer examid,Integer exammode){
21 43
         //查询所有学生试题
22 44
         List<MsPaperStudentQuestion> stuQuestions = msPaperStudentQuestionMapper.listAllStuQuesByExamid(examid);
45
+        List<MsClassStudent> classStudents = msClassStudentMapper.listStudentByExamId(examid);
46
+        List<MsPaper> subjects = msSubjectMapper.listReportSubject(examid, exammode);
47
+        //获取考试参数
48
+        List<MsrReportparam> params = msrReportparamMapper.listReportparamByRpbelong(examid,"quesummary",null);
49
+
50
+        //根据科目进行区分
51
+        for(MsPaper subject : subjects){
52
+            String subjectid = subject.getSubjectid();
53
+            //获取科目下所有学生试题
54
+            List<MsPaperStudentQuestion> subjectStuQuestions = stuQuestions.stream().filter(stuQuestion -> stuQuestion.getSubjectid().equals(subjectid)).collect(Collectors.toList());
55
+            //科目下所有班级学生
56
+            List<MsClassStudent> subjectClassStudents = classStudents.stream().filter(classStudent -> classStudent.getSubjectid().equals(subjectid)).collect(Collectors.toList());
57
+            //获取试卷中所有小题基础信息包含大题信息
58
+            List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsForReport(subject.getMpid());
59
+
60
+            List<MsrReportparam> subjectParams = params.stream().filter(p -> p.getRpbelong().equals(subjectid)).collect(Collectors.toList());
61
+        }
62
+    }
63
+
64
+    //处理单个试题分析
65
+    private void handleQuestion(List<MsPaperStudentQuestion> subjectStuQuestions, List<MsClassStudent> subjectClassStudents,List<MsPaperQtypeQuestion> questions,List<MsrReportparam> params,Integer examid,String subjectid){
66
+
67
+        List<MsrClassQuestion> saveQuestions = new ArrayList<>();//小题分析
68
+
69
+        //处理小题信息
70
+        for(MsPaperQtypeQuestion question : questions){
71
+            //获取第一小题所有作答情况,全校作答情况
72
+            List<MsPaperStudentQuestion> stuQuestions = subjectStuQuestions.stream().filter(q -> q.getMptqid().equals(question.getMptqid())).collect(Collectors.toList());
73
+            int stunum = stuQuestions.size();//学生数量
74
+            Double sumQScore = question.getQscore() * stunum;//小题得分
75
+            List<Double> stuScores = stuQuestions.stream().map(q -> q.getStuscore()).collect(Collectors.toList());//所有学生得分
76
+
77
+            Double maxScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).max().orElse(0.0);//最高分
78
+            Double minScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).min().orElse(0.0);//最低分
79
+            Double avgScore = MarkingUtil.calculateAverage(stuScores);//平均分
80
+            Double avgScoreRate = MarkingUtil.calculateRate(avgScore,sumQScore);//平均得分率
81
+
82
+            MsrClassQuestion schoolQ = new MsrClassQuestion();
83
+            schoolQ.setClassid(0);//全体班级
84
+            schoolQ.setExamid(examid);
85
+            schoolQ.setSubjectid(subjectid);
86
+            schoolQ.setSchoolmaxscore(maxScore);
87
+            schoolQ.setSchoolminscore(minScore);
88
+            schoolQ.setSchoolavgscore(avgScore);
89
+            schoolQ.setSchoolavgrate(avgScoreRate);
90
+            //班级试题情况
91
+            MsrClassQuestion schoolQue = handleQuestionClass(stuQuestions,question,params,schoolQ);
92
+            saveQuestions.add(schoolQue);
93
+
94
+            //班级试题--客观题选项情况
95
+
96
+
97
+            //处理班级情况
98
+            for(MsClassStudent classStudent : subjectClassStudents){
99
+                //获取班级下学生id
100
+                List<Integer> classStuIds = subjectClassStudents.stream().map(MsClassStudent::getStudentid).collect(Collectors.toList());
101
+                //获取班级下学生试题
102
+                List<MsPaperStudentQuestion> classStuQuestions = stuQuestions.stream().filter(q -> classStuIds.contains(q.getStudentid())).collect(Collectors.toList());
103
+                MsrClassQuestion classQue = handleQuestionClass(classStuQuestions,question,params,schoolQ);
104
+                saveQuestions.add(classQue);
105
+            }
106
+
107
+
108
+        }
109
+    }
110
+
111
+    //处理单个试题分析-学校、班级分析
112
+    private MsrClassQuestion handleQuestionClass(List<MsPaperStudentQuestion> stuQuestions,MsPaperQtypeQuestion question,List<MsrReportparam> params,MsrClassQuestion schoolQ){
113
+        int stunum = stuQuestions.size();//学生数量
114
+        Double qScore = question.getQscore();//试题分值
115
+        Double sumQScore = question.getQscore() * stunum;//小题得分
116
+        List<Double> stuScores = stuQuestions.stream().map(q -> q.getStuscore()).collect(Collectors.toList());//所有学生得分
117
+        Double sumStuScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();//综合
118
+
119
+        Double maxScore;//最高分
120
+        Double minScore;//最低分
121
+        Double avgScore;//平均分
122
+        Double avgScoreRate;//平均得分率
123
+        if(schoolQ.getClassid() == 0){
124
+            //代表是校级
125
+            maxScore = schoolQ.getSchoolmaxscore();
126
+            minScore = schoolQ.getSchoolminscore();
127
+            avgScore = schoolQ.getSchoolavgscore();
128
+            avgScoreRate = schoolQ.getSchoolavgrate();
129
+        }else{
130
+            //指定班级
131
+            maxScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).max().orElse(0.0);//最高分
132
+            minScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).min().orElse(0.0);//最低分
133
+            avgScore = MarkingUtil.calculateAverage(stuScores);//平均分
134
+            avgScoreRate = MarkingUtil.calculateRate(avgScore,sumQScore);//平均得分率
135
+        }
136
+        Double stuScoreRate = MarkingUtil.calculateRate(sumStuScore,sumQScore);//学生得分率
137
+        MsrClassQuestion classQ = new MsrClassQuestion();
138
+        classQ.setExamid(schoolQ.getExamid());
139
+        classQ.setSubjectid(schoolQ.getSubjectid());
140
+        classQ.setClassid(schoolQ.getClassid());//班级id
141
+        classQ.setMptqid(question.getMptqid());
142
+        classQ.setQtype(question.getQtype());
143
+        classQ.setQn(question.getMptqn() + "." + question.getQn());
144
+        classQ.setFullscore(question.getQscore());
145
+        classQ.setStunum(stunum);
146
+        classQ.setClassmaxscore(maxScore);
147
+        classQ.setClassminscore(minScore);
148
+        classQ.setClassavgscore(avgScore);
149
+        classQ.setClassavgrate(avgScoreRate);
150
+
151
+        classQ.setSchoolmaxscore(schoolQ.getSchoolmaxscore());
152
+        classQ.setSchoolminscore(schoolQ.getSchoolminscore());
153
+        classQ.setSchoolavgscore(schoolQ.getSchoolavgscore());
154
+        classQ.setSchoolavgrate(schoolQ.getSchoolavgrate());
155
+
156
+        classQ.setScorerate(stuScoreRate);
157
+        classQ.setScoreratec(MarkingUtil.sub(MarkingUtil.calculateRate(maxScore,qScore),MarkingUtil.calculateRate(minScore,qScore)));//得分率差=最高得分率-最低得分率
158
+        classQ.setNd(MarkingUtil.div(stuScoreRate,qScore));//难度
159
+        classQ.setNdms(handleQuestionNdAndQfd(params,1,classQ.getNd()));//难度描述
160
+        classQ.setQfd(MarkingUtil.qfd(stuScores));//区分度
161
+        classQ.setQfdms(handleQuestionNdAndQfd(params,2, classQ.getQfd()));//区分度描述
162
+        classQ.setBzc(MarkingUtil.bzc(stuScores));//标准差
163
+        classQ.setCyxs(MarkingUtil.div(classQ.getBzc(),avgScore));//差异系数
164
+        classQ.setJbzs(MarkingUtil.jbzs(stuScores,stuScoreRate));//鉴别指数
165
+        //获取所有满分学生
166
+        List<MsPaperStudentQuestion> fullStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore().equals(q.getQscore())).collect(Collectors.toList());
167
+        String mfids = fullStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));//满分学生id
168
+        classQ.setMfnum(fullStuQuestions.size());
169
+        classQ.setMfrate(MarkingUtil.div(classQ.getMfnum(), stunum));////正确率、满分人数占比
170
+        classQ.setMfids(mfids);
171
+        //获取零分学生
172
+        List<MsPaperStudentQuestion> lfStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore().equals(0)).collect(Collectors.toList());
173
+        String lfids = lfStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));//零分学生id
174
+        classQ.setLfnum(lfStuQuestions.size());
175
+        classQ.setLfrate(MarkingUtil.div(lfStuQuestions.size(),stunum));////零分人数占比
176
+        classQ.setLfids(lfids);
177
+        return classQ;
178
+    }
23 179
 
180
+    private String handleQuestionNdAndQfd(List<MsrReportparam> params,Integer rptype,Double nd){
181
+        //获取难度或者区分度
182
+        MsrReportparam ndParam = params.stream().filter(p -> p.getRptype().equals(rptype)).findFirst().orElse(null);//难度
183
+        String ndms = "";
184
+        if(ndParam!= null){
185
+            List<SzJsonVo> szList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
186
+            for (SzJsonVo sz : szList) {
187
+                if (nd == 1 && sz.getMaxvalue() == 1) {
188
+                    ndms = sz.getDjkey();
189
+                    break;
190
+                } else if (nd == 0 && sz.getMinvalue() == 0) {
191
+                    ndms = sz.getDjkey();
192
+                    break;
193
+                } else if(nd >= sz.getMinvalue() && nd < sz.getMaxvalue()) {
194
+                    ndms = sz.getDjkey();
195
+                    break;
196
+                }
197
+            }
198
+        }
199
+        return ndms;
24 200
     }
25 201
 }

+ 3
- 5
smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrReportparamService.java Прегледај датотеку

@@ -37,7 +37,7 @@ public class MsrReportparamService {
37 37
      **/
38 38
     @Transactional(rollbackFor = Exception.class)
39 39
     public void saveReportparam(ReportParams reportParams) {
40
-        List<MsrReportparam> originalParams = msrReportparamMapper.listReportparamByRpbelong(reportParams);
40
+        List<MsrReportparam> originalParams = msrReportparamMapper.listReportparamByRpbelong(reportParams.getExamid(),reportParams.getRpbelong(),reportParams.getReportcode());
41 41
 
42 42
         Integer timestamp = N_Utils.getSecondTimestamp();
43 43
         List<MsrReportparam> params = reportParams.getParams();
@@ -78,7 +78,7 @@ public class MsrReportparamService {
78 78
      * @Return java.util.List<com.xhkjedu.smarking.model.report.reportother.MsrReportparam>
79 79
      **/
80 80
     public List<MsrReportparam> listReportparamByRpbelong(ReportParams reportParams) {
81
-        return msrReportparamMapper.listReportparamByRpbelong(reportParams);
81
+        return msrReportparamMapper.listReportparamByRpbelong(reportParams.getExamid(),reportParams.getRpbelong(),reportParams.getReportcode());
82 82
     }
83 83
 
84 84
     /*
@@ -90,9 +90,7 @@ public class MsrReportparamService {
90 90
      **/
91 91
     public List<MsrReportparam> initReportparam(Integer schoolid,Integer gradeid,Integer examid,Integer handleid) {
92 92
         //初始化时判断参数是否已经存在
93
-        ReportParams ep = new ReportParams();
94
-        ep.setExamid(examid);
95
-        List<MsrReportparam> examParams = msrReportparamMapper.listReportparamByRpbelong(ep);
93
+        List<MsrReportparam> examParams = msrReportparamMapper.listReportparamByRpbelong(examid,null,null);
96 94
         if(examParams!= null && examParams.size() > 0){
97 95
             //说明考试已经有参数存在
98 96
             return examParams;

+ 117
- 80
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java Прегледај датотеку

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
4 4
 import com.alibaba.fastjson.JSONArray;
5 5
 import com.xhkjedu.smarking.config.ConfigKey;
6 6
 import com.xhkjedu.smarking.vo.paper.PaperFileVo;
7
+import com.xhkjedu.smarking.vo.report.reportother.RankGroupVo;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import com.xhkjedu.vo.ResultVo;
9 10
 import lombok.extern.slf4j.Slf4j;
@@ -34,7 +35,6 @@ public class MarkingUtil {
34 35
 
35 36
     /**
36 37
      * 删除Html标签
37
-     *
38 38
      */
39 39
     public static String htmlRemoveTag(String inputString) {
40 40
         if (inputString == null)
@@ -48,9 +48,9 @@ public class MarkingUtil {
48 48
         java.util.regex.Pattern p_html;
49 49
         java.util.regex.Matcher m_html;
50 50
         try {
51
-            //定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
51
+            // 定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
52 52
             String regEx_script = "<[\\s]*?script[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?script[\\s]*?>";
53
-            //定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
53
+            // 定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
54 54
             String regEx_style = "<[\\s]*?style[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?style[\\s]*?>";
55 55
             String regEx_html = "<[^>]+>"; // 定义HTML标签的正则表达式
56 56
             p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
@@ -76,17 +76,17 @@ public class MarkingUtil {
76 76
      * @Param [str1, str2]
77 77
      * @Return int
78 78
      **/
79
-    public static int isEqualStringCheck(String str1,String str2){
79
+    public static int isEqualStringCheck(String str1, String str2) {
80 80
         char[] charArray1 = str1.toCharArray();
81 81
         char[] charArray2 = str2.toCharArray();
82 82
         Arrays.sort(charArray1);
83 83
         Arrays.sort(charArray2);
84
-        int eqResult = 0;//0代表不相等 1表示两个字符串相等 2代表字符串1包含字符串2
85
-        if(Arrays.equals(charArray1, charArray2)){
84
+        int eqResult = 0;// 0代表不相等 1表示两个字符串相等 2代表字符串1包含字符串2
85
+        if (Arrays.equals(charArray1, charArray2)) {
86 86
             eqResult = 1;
87 87
         }
88 88
 
89
-        if(Collections.singletonList(charArray1).contains(charArray2)){
89
+        if (Collections.singletonList(charArray1).contains(charArray2)) {
90 90
             eqResult = 2;
91 91
         }
92 92
 
@@ -100,21 +100,21 @@ public class MarkingUtil {
100 100
      * @Param [stuanswer, q]
101 101
      * @Return java.lang.Double
102 102
      **/
103
-    public static Double checkObjectiveStuAnswer(String stuanswer, int ctype,String qanswer,Double loseoption,Double qscore){
104
-        String qanswerCort = JSON.parseArray(qanswer, String.class).get(0);//试题正确答案
103
+    public static Double checkObjectiveStuAnswer(String stuanswer, int ctype, String qanswer, Double loseoption, Double qscore) {
104
+        String qanswerCort = JSON.parseArray(qanswer, String.class).get(0);// 试题正确答案
105 105
         Double stuscore = 0D;
106
-        if(N_Utils.isNotEmpty(stuanswer)){
107
-            if(ctype == 1 || ctype == 4 || ctype == 5 || ctype == 6){
108
-                if(qanswerCort.equalsIgnoreCase(stuanswer)){
106
+        if (N_Utils.isNotEmpty(stuanswer)) {
107
+            if (ctype == 1 || ctype == 4 || ctype == 5 || ctype == 6) {
108
+                if (qanswerCort.equalsIgnoreCase(stuanswer)) {
109 109
                     stuscore = qscore;
110 110
                 }
111
-            }else if(ctype == 2){
112
-                //多选题进行判断,
111
+            } else if (ctype == 2) {
112
+                // 多选题进行判断,
113 113
                 int isEqualStr = isEqualStringCheck(qanswerCort, stuanswer);
114
-                if(isEqualStr == 1){
114
+                if (isEqualStr == 1) {
115 115
                     stuscore = qscore;
116
-                }else if(isEqualStr == 2){
117
-                    stuscore = loseoption;//少选得分
116
+                } else if (isEqualStr == 2) {
117
+                    stuscore = loseoption;// 少选得分
118 118
                 }
119 119
             }
120 120
         }
@@ -135,7 +135,7 @@ public class MarkingUtil {
135 135
         return b1.add(b2).doubleValue();
136 136
     }
137 137
 
138
-    //两数相减
138
+    // 两数相减
139 139
     public static long subtract(long a, long b) {
140 140
         BigInteger biginta = new BigInteger(a + "");
141 141
         BigInteger bigintb = new BigInteger(b + "");
@@ -143,7 +143,7 @@ public class MarkingUtil {
143 143
 
144 144
     }
145 145
 
146
-    //两数相减
146
+    // 两数相减
147 147
     public static Integer subtractInt(Integer a, Integer b) {
148 148
         BigInteger biginta = new BigInteger(a + "");
149 149
         BigInteger bigintb = new BigInteger(b + "");
@@ -166,6 +166,7 @@ public class MarkingUtil {
166 166
 
167 167
     /**
168 168
      * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后2位,以后的数字舍弃。
169
+     *
169 170
      * @param v1 被除数
170 171
      * @param v2 除数
171 172
      * @return 两个参数的商
@@ -189,7 +190,8 @@ public class MarkingUtil {
189 190
 
190 191
     /**
191 192
      * 向上取值
192
-     * @param score 原始得分
193
+     *
194
+     * @param score    原始得分
193 195
      * @param interval 取值间隔
194 196
      * @return 向上取值后的结果
195 197
      */
@@ -199,7 +201,8 @@ public class MarkingUtil {
199 201
 
200 202
     /**
201 203
      * 向下取值
202
-     * @param score 原始得分
204
+     *
205
+     * @param score    原始得分
203 206
      * @param interval 取值间隔
204 207
      * @return 向下取值后的结果
205 208
      */
@@ -209,7 +212,8 @@ public class MarkingUtil {
209 212
 
210 213
     /**
211 214
      * 计算总分并处理超过满分的情况
212
-     * @param scores 得分数组
215
+     *
216
+     * @param scores   得分数组
213 217
      * @param interval 取值间隔
214 218
      * @param maxScore 满分
215 219
      * @return 最终总分
@@ -226,6 +230,7 @@ public class MarkingUtil {
226 230
 
227 231
     /**
228 232
      * 计算两个分数之间的分差
233
+     *
229 234
      * @param score1 第一个分数
230 235
      * @param score2 第二个分数
231 236
      * @return 分差
@@ -248,7 +253,7 @@ public class MarkingUtil {
248 253
         return b1.subtract(b2).doubleValue();
249 254
     }
250 255
 
251
-    //字符串转为时间戳(秒)
256
+    // 字符串转为时间戳(秒)
252 257
     public static long strToTimestamp(String str) {
253 258
         if (str == null || str.isEmpty()) return 0;
254 259
         DateTimeFormatter ftf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -263,15 +268,15 @@ public class MarkingUtil {
263 268
      * @Author wn
264 269
      * @Date 2022/10/27 11:36
265 270
      **/
266
-    public static long getTimestrToTimetamp(String time){
271
+    public static long getTimestrToTimetamp(String time) {
267 272
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
268 273
         Date date = new Date();
269 274
         try {
270 275
             date = sdf.parse(time);
271
-        }catch (Exception e){
276
+        } catch (Exception e) {
272 277
             log.error("字符串转时间戳出错:" + e.getMessage());
273 278
         }
274
-        return date.getTime()/1000;
279
+        return date.getTime() / 1000;
275 280
     }
276 281
 
277 282
     /*
@@ -281,32 +286,32 @@ public class MarkingUtil {
281 286
      * @Param [stupic, merged, saveFloder]
282 287
      * @Return java.lang.String
283 288
      **/
284
-    public static String uploadBase64Img(String stupic,Integer merged,String saveFloder) {
289
+    public static String uploadBase64Img(String stupic, Integer merged, String saveFloder) {
285 290
         String apiMethod;
286
-        if(merged == 1){
287
-            //说明上传的图片为单张保存
291
+        if (merged == 1) {
292
+            // 说明上传的图片为单张保存
288 293
             apiMethod = "bs/base";
289
-        }else{
290
-            //上传的多张图片需要合并为一张
294
+        } else {
295
+            // 上传的多张图片需要合并为一张
291 296
             apiMethod = "bs/mbase_merge";
292 297
         }
293
-        String stubase64;//防止内容被更改
298
+        String stubase64;// 防止内容被更改
294 299
         try {
295 300
             stubase64 = URLEncoder.encode(stupic, "UTF-8");
296 301
         } catch (UnsupportedEncodingException e) {
297 302
             log.error("base64格式化内容出错" + e.getMessage());
298 303
             throw new RuntimeException(e);
299 304
         }
300
-        //处理字段那种图片路径,base64转图片
305
+        // 处理字段那种图片路径,base64转图片
301 306
         String params = "base64path=" + stubase64 + "&savefolder=" + saveFloder;
302 307
         String fileInfoStr = N_Utils.sendPost(ConfigKey.fileapi + apiMethod, params);
303
-        if(N_Utils.isEmpty(fileInfoStr)){
308
+        if (N_Utils.isEmpty(fileInfoStr)) {
304 309
             return "";
305 310
         }
306 311
         ResultVo fileResult = JSON.parseObject(fileInfoStr, ResultVo.class);
307 312
         if (fileResult.getCode() == 0 && N_Utils.isNotEmpty(fileResult.getObj())) {
308 313
             return fileResult.getObj().toString();
309
-        }else{
314
+        } else {
310 315
             return "";
311 316
         }
312 317
     }
@@ -318,8 +323,8 @@ public class MarkingUtil {
318 323
      * @Param [stupic, saveFloder]
319 324
      * @Return java.util.List<java.lang.String>
320 325
      **/
321
-    public static PaperFileVo uploadBatchBase64ImgPdf(List<String> imgList, String saveFloder){
322
-        //处理字段那种图片路径,base64转图片
326
+    public static PaperFileVo uploadBatchBase64ImgPdf(List<String> imgList, String saveFloder) {
327
+        // 处理字段那种图片路径,base64转图片
323 328
         String base64path = JSON.toJSONString(imgList);
324 329
         try {
325 330
             base64path = URLEncoder.encode(base64path, "UTF-8");
@@ -333,7 +338,7 @@ public class MarkingUtil {
333 338
         ResultVo fileResult = JSON.parseObject(fileInfoStr, ResultVo.class);
334 339
         if (fileResult.getCode() == 0 && N_Utils.isNotEmpty(fileResult.getObj())) {
335 340
             return JSONArray.parseObject(fileResult.getObj().toString(), PaperFileVo.class);
336
-        }else{
341
+        } else {
337 342
             return null;
338 343
         }
339 344
     }
@@ -351,12 +356,12 @@ public class MarkingUtil {
351 356
         Matcher matcher = pattern.matcher(input);
352 357
 
353 358
         while (matcher.find()) {
354
-            if (matcher.group(1)!= null) {
359
+            if (matcher.group(1) != null) {
355 360
                 result.add(matcher.group(1));
356
-            } else if (matcher.group(2)!= null) {
361
+            } else if (matcher.group(2) != null) {
357 362
                 String str = matcher.group(2);
358
-                for(char c : str.toCharArray()){
359
-                    result.add(c+"");
363
+                for (char c : str.toCharArray()) {
364
+                    result.add(c + "");
360 365
                 }
361 366
             }
362 367
         }
@@ -364,44 +369,44 @@ public class MarkingUtil {
364 369
         return result;
365 370
     }
366 371
 
367
-    public static String[] qnArr = {"一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
368
-            "二十一","二十二","二十三","二十四","二十五","二十六","二十七","二十八","二十九","三十"};
372
+    public static String[] qnArr = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十",
373
+            "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十"};
369 374
 
370
-    //获取题号
371
-    public static String getQnByOrder(Integer qorder){
375
+    // 获取题号
376
+    public static String getQnByOrder(Integer qorder) {
372 377
         String rtnStr;
373
-        if(qorder == null || qorder == 0 || qorder > 30){
378
+        if (qorder == null || qorder == 0 || qorder > 30) {
374 379
             rtnStr = qnArr[0];
375 380
         }
376
-        rtnStr = qnArr[qorder-1];
381
+        rtnStr = qnArr[qorder - 1];
377 382
         return rtnStr;
378 383
     }
379 384
 
380
-    //方差s^2=[(x1-x)^2 +...(xn-x)^2]/n 或者s^2=[(x1-x)^2 +...(xn-x)^2]/(n-1)
385
+    // 方差s^2=[(x1-x)^2 +...(xn-x)^2]/n 或者s^2=[(x1-x)^2 +...(xn-x)^2]/(n-1)
381 386
     public static double fc(List<Double> x) {
382 387
         if (N_Utils.isListEmpty(x)) return 0;
383 388
         int m = x.size();
384 389
         double sum = 0;
385
-        for (int i = 0; i < m; i++) {//求和
390
+        for (int i = 0; i < m; i++) {// 求和
386 391
             sum += x.get(i);
387 392
         }
388
-        double dAve = sum / m;//求平均值
393
+        double dAve = sum / m;// 求平均值
389 394
         double dVar = 0;
390
-        for (int i = 0; i < m; i++) {//求方差
395
+        for (int i = 0; i < m; i++) {// 求方差
391 396
             dVar += (x.get(i) - dAve) * (x.get(i) - dAve);
392 397
         }
393 398
         return dVar / m;
394 399
     }
395 400
 
396
-    //标准差σ=sqrt(s^2)
401
+    // 标准差σ=sqrt(s^2)
397 402
     public static double bzc(List<Double> x) {
398 403
         if (N_Utils.isListEmpty(x)) return 0;
399 404
         return N_Utils.formatDouble(Math.sqrt(fc(x)), 2);
400 405
     }
401 406
 
402 407
 
403
-    //中位数
404
-    public static double zws(List<Double> list){
408
+    // 中位数
409
+    public static double zws(List<Double> list) {
405 410
         if (N_Utils.isListEmpty(list)) return 0;
406 411
         // 先对列表进行排序
407 412
         List<Double> sorteList = list.stream().sorted().collect(Collectors.toList());
@@ -418,7 +423,7 @@ public class MarkingUtil {
418 423
         }
419 424
     }
420 425
 
421
-    //区分度=2×(高分组平均分-低分组平均分)/100
426
+    // 区分度=2×(高分组平均分-低分组平均分)/100
422 427
     public static double qfd(List<Double> scores) {
423 428
         if (N_Utils.isListEmpty(scores)) return 0;
424 429
 
@@ -434,7 +439,7 @@ public class MarkingUtil {
434 439
         return div(mul(2, sub(highGroupAvg, lowGroupAvg)), 100);
435 440
     }
436 441
 
437
-    //计算平均分
442
+    // 计算平均分
438 443
     public static double calculateAverage(List<Double> scores) {
439 444
         if (N_Utils.isListEmpty(scores)) return 0;
440 445
         double sum = 0.0;
@@ -444,14 +449,23 @@ public class MarkingUtil {
444 449
         return div(sum, scores.size());
445 450
     }
446 451
 
447
-    //众数
448
-    public static List<Double> zs(List<Double> list){
452
+    //计算占比
453
+    public static double calculateRate(Object v1,Object v2){
454
+        BigDecimal b1 = new BigDecimal(v1.toString());
455
+        BigDecimal b2 = new BigDecimal(v2.toString());
456
+
457
+        BigDecimal b3 = b1.divide(b2, 4, BigDecimal.ROUND_DOWN);
458
+        return b3.multiply(new BigDecimal("100")).doubleValue();
459
+    }
460
+
461
+    // 众数
462
+    public static List<Double> zs(List<Double> list) {
449 463
         List<Double> modes = new ArrayList<>();
450 464
         if (N_Utils.isListEmpty(list)) return modes;
451 465
 
452 466
         // 使用HashMap来统计每个元素出现的次数
453 467
         Map<Double, Long> countMap = list.stream()
454
-                                            .collect(Collectors.groupingBy(e -> e, Collectors.counting()));
468
+                                         .collect(Collectors.groupingBy(e -> e, Collectors.counting()));
455 469
 
456 470
         long maxCount = 0;
457 471
         // 找出最大的出现次数
@@ -468,22 +482,22 @@ public class MarkingUtil {
468 482
         return modes;
469 483
     }
470 484
 
471
-    //超均率 =(个人单科得分-全校平均分)÷全校平均分
472
-    public static double cjl(Object v1,Object v2){
473
-        if(v2 == null || "0".equals(v2)) return 0;
485
+    // 超均率 =(个人单科得分-全校平均分)÷全校平均分
486
+    public static double cjl(Object v1, Object v2) {
487
+        if (v2 == null || "0".equals(v2)) return 0;
474 488
 
475 489
         BigDecimal b1 = new BigDecimal(v1.toString());
476 490
         BigDecimal b2 = new BigDecimal(v2.toString());
477 491
         return b1.subtract(b2).divide(b2, 2, BigDecimal.ROUND_DOWN).doubleValue();
478 492
     }
479 493
 
480
-    //标准分 班级标准分 =(班级得分-全校平均分)÷年级标准差
494
+    // 标准分 班级标准分 =(班级得分-全校平均分)÷年级标准差
481 495
     public static double bzf(Double score, Double avgscore, Double bzc) {
482 496
         double bzscore = div(sub(score, avgscore), bzc);
483 497
         return N_Utils.formatDouble(bzscore, 2);
484 498
     }
485 499
 
486
-    //综合率 固定计算=平均得分率*50%+优秀率*25%+及格率*25%
500
+    // 综合率 固定计算=平均得分率*50%+优秀率*25%+及格率*25%
487 501
     public static double zhl(Double v1, Double v2, Double v3) {
488 502
         double s1 = mul(v1, 0.5);
489 503
         double s2 = mul(v2, 0.25);
@@ -491,41 +505,64 @@ public class MarkingUtil {
491 505
         return add(s1, add(s2, s3));
492 506
     }
493 507
 
494
-    //学科上线贡献率  班级学科上线贡献率=(班级学科上线率-班级总分上线率)-(学校学科的上线率-学校总分上线率)
495
-    public static double sxgxl(Double v1,Double v2,Double v3,Double v4){
496
-        double s1 = sub(v1,v2);
497
-        double s2 = sub(v3,v4);
498
-        return sub(s1,s2);
508
+    // 学科上线贡献率  班级学科上线贡献率=(班级学科上线率-班级总分上线率)-(学校学科的上线率-学校总分上线率)
509
+    public static double sxgxl(Double v1, Double v2, Double v3, Double v4) {
510
+        double s1 = sub(v1, v2);
511
+        double s2 = sub(v3, v4);
512
+        return sub(s1, s2);
499 513
     }
500 514
 
501
-    //短板学生 学科短板学生:偏科指数=(单科分值-全科平均分)÷全科标准差 ,如果偏科指数>1,标识此科为短板学科
502
-    public static double dbxs(Double v1,Double v2,Double v3){
503
-        return div(sub(v1,v2),v3);
515
+    // 短板学生 学科短板学生:偏科指数=(单科分值-全科平均分)÷全科标准差 ,如果偏科指数>1,标识此科为短板学科
516
+    public static double dbxs(Double v1, Double v2, Double v3) {
517
+        return div(sub(v1, v2), v3);
504 518
     }
505 519
 
506
-    //鉴别指数 试题鉴别指数 = 前27%的学生得分率-后27%的学生得分率
507
-    //将学生按总分排序(去掉缺考的学生),取前27%、后27%的学生,分别计算在该题上的得分率,两者之差即为鉴别指数
508
-    public static double jbzs(List<Double> list,Double qscore){
520
+    // 鉴别指数 试题鉴别指数 = 前27%的学生得分率-后27%的学生得分率
521
+    // 将学生按总分排序(去掉缺考的学生),取前27%、后27%的学生,分别计算在该题上的得分率,两者之差即为鉴别指数
522
+    public static double jbzs(List<Double> list, Double scoreRate) {
509 523
         List<Double> sortList = list.stream().sorted().collect(Collectors.toList());
510 524
         int size = sortList.size();
511
-        int count = (int)(size * 0.27);//27%学生数量
525
+        int count = (int) (size * 0.27);// 27%学生数量
512 526
 
513 527
         // 前27%的学生
514 528
         List<Double> topGroup = sortList.subList(0, count);
515 529
         double topScore = topGroup.stream().mapToDouble(Double::doubleValue).sum();
516
-        double topRate = div(topScore, mul(qscore, count));
530
+        double topRate = div(topScore, mul(scoreRate, count));
517 531
 
518 532
         // 后27%的学生
519 533
         List<Double> bottomGroup = sortList.subList(size - count, size);
520 534
         double bottomScore = bottomGroup.stream().mapToDouble(Double::doubleValue).sum();
521
-        double bottomRate = div(bottomScore, mul(qscore, count));
535
+        double bottomRate = div(bottomScore, mul(scoreRate, count));
522 536
 
523 537
         // 鉴别指数
524 538
         return sub(topRate, bottomRate);
525 539
     }
526 540
 
541
+    //排名分组计算 用于第一组(第1-10名)
542
+    public static List<RankGroupVo> rankGroup(Integer total) {
543
+        List<RankGroupVo> rtnList = new ArrayList<>();
544
+
545
+        int count = total / 10;
546
+        for (int i = 0; i < count; i++) {
547
+            RankGroupVo rg = new RankGroupVo();
548
+            rg.setMaxvalue((i + 1) * 10);
549
+            rg.setMinvalue(i * 10 + 1);
550
+            rtnList.add(rg);
551
+        }
552
+
553
+        if (total % 10 > 0) {
554
+            //未被整除,添加最后一组
555
+            RankGroupVo rg = new RankGroupVo();
556
+            rg.setMaxvalue(total);
557
+            rg.setMinvalue(count * 10 + 1);
558
+            rtnList.add(rg);
559
+        }
560
+        return rtnList;
561
+    }
562
+
527 563
     public static void main(String[] args) {
528
-        System.out.println(cjl(50,40));
564
+        System.out.println(cjl(50, 40));
565
+
529 566
     }
530 567
 
531 568
 

+ 18
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/RankGroupVo.java Прегледај датотеку

@@ -0,0 +1,18 @@
1
+package com.xhkjedu.smarking.vo.report.reportother;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:分段分值
7
+ * @Author: WN
8
+ * @Date: 2024/12/10 16:44:02
9
+ **/
10
+@Data
11
+public class RankGroupVo {
12
+
13
+    //最大值
14
+    private Integer maxvalue;
15
+
16
+    //最小值
17
+    private Integer minvalue;
18
+}

+ 30
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/SzJsonVo.java Прегледај датотеку

@@ -0,0 +1,30 @@
1
+package com.xhkjedu.smarking.vo.report.reportother;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:数值json解析对象
7
+ * @Author: WN
8
+ * @Date: 2024/12/11 10:48:19
9
+ **/
10
+@Data
11
+public class SzJsonVo {
12
+    private String djkey;//数据项key
13
+    private Object djvalue;//数据项值
14
+    private Double djscore;//数据项值对应分值
15
+
16
+    private Double maxvalue;//最大值
17
+    private Double minvalue;//最小值
18
+
19
+    private String calformula;//综合率-计算
20
+    private String custname;//综合率-名称
21
+    private String selname;//综合率-指标名称
22
+
23
+    private Integer alltop;//全体考生前多少名
24
+    private Integer allbottom;//全体考生后多少名
25
+    private Integer goodtype;//优秀学生类型1按名次 2按比例
26
+    private Integer goodvalue;//优秀学生前N名
27
+    private Integer badtype;//提高学生类型1按名次 2按比例
28
+    private Integer badvalue;//待提高学生前N名
29
+
30
+}

+ 1
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml Прегледај датотеку

@@ -167,7 +167,7 @@
167 167
     </select>
168 168
     <!--考试报告科目列表-->
169 169
     <select id="listReportSubject" resultType="com.xhkjedu.smarking.model.paper.MsPaper">
170
-        select s.subjectid,s.subjectname,p.mpid,p.pnum,p.mergepnum,p.pscore,p.correcttype
170
+        select s.subjectid,s.subjectname,p.mpid,p.pnum,p.mergepnum,p.pscore,p.correcttype,p.ptype
171 171
         from ms_subject s inner join ms_paper p on s.msid=p.msid
172 172
         where s.examid=#{examid}
173 173
         <if test="exammode!=3">

+ 8
- 0
smarking/src/main/resources/mapper/paper/MsPaperQtypeQuestionMapper.xml Прегледај датотеку

@@ -134,4 +134,12 @@
134 134
     <update id="updateQuestionCoorByMpid">
135 135
         update ms_paper_qtype_question set pagenum=0,stemcoor=null,quecoor=null where mpid=#{mpid}
136 136
     </update>
137
+
138
+    <!--试卷中所有试题-考试报告-->
139
+    <select id="listQuestionsForReport" resultType="com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion">
140
+        select q.mptqid,q.mptid,q.mpid,q.ctype,q.qtype,q.questionid,q.qtypeid,q.qtypename,q.qn,
141
+        q.qscore,q.qorder,q.optionnum,q.qanswer,qt.mptqn,qt.mptnum,qt.mptscore
142
+        from ms_paper_qtype_question q left join ms_paper_qtype qt on q.mptid=qt.mptid
143
+        where q.mpid=#{mpid} order by qt.mptorder,q.qorder
144
+    </select>
137 145
 </mapper>

+ 5
- 5
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml Прегледај датотеку

@@ -4,12 +4,12 @@
4 4
 
5 5
     <!--获取考试对应参数-->
6 6
     <select id="listReportparamByRpbelong" resultType="com.xhkjedu.smarking.model.report.reportother.MsrReportparam">
7
-        select * from msr_reportparam where examid=#{rp.examid}
8
-        <if test="rp.rpbelong!= null and rp.rpbelong!= ''">
9
-            and rpbelong = #{rp.rpbelong}
7
+        select * from msr_reportparam where examid=#{examid}
8
+        <if test="rpbelong!= null and rpbelong!= ''">
9
+            and rpbelong = #{rpbelong}
10 10
         </if>
11
-        <if test="rp.reportcode!= null and rp.reportcode!= ''">
12
-            and reportcode = #{rp.reportcode}
11
+        <if test="reportcode!= null and reportcode!= ''">
12
+            and reportcode = #{reportcode}
13 13
         </if>
14 14
         order by rpid
15 15
     </select>

+ 1
- 3
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml Прегледај датотеку

@@ -331,11 +331,9 @@
331 331
     <!--获取考试所有参考学生作答情况-->
332 332
     <select id="listAllStuQuesByExamid" resultType="com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion">
333 333
         select sq.mpsqid,sq.studentid,sq.subjectid,sq.mpid,sq.mpsid,sq.mptid,sq.mptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,
334
-        sq.qscore,sq.answered,sq.answertype,sq.stuanswer,sq.stuscore,sq.stumerge,sq.hasgood,sq.hasbad,q.qtype,q.qanswer,qt.mptqn
334
+        sq.qscore,sq.answered,sq.answertype,sq.stuanswer,sq.stuscore,sq.stumerge,sq.hasgood,sq.hasbad
335 335
         from ms_paper_student_question sq
336 336
         left join ms_paper_student ps on sq.mpsid=ps.mpsid
337
-        left join ms_paper_qtype_question q on sq.mptqid=q.mptqid
338
-        left join ms_paper_qtype qt on q.mptid=qt.mptid
339 337
         where sq.examid=#{examid} and ps.sstate=2 order by sq.mpid,sq.studentid
340 338
     </select>
341 339
 </mapper>

Loading…
Откажи
Сачувај