Browse Source

知识点分析

ywx
王宁 3 weeks ago
parent
commit
d7743f6016

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassQuestionMapper.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.smarking.mapper.report.reportclass;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 /**
7 8
  * @Description 阅卷报告-班级试题小题分析表 Mapper 接口
@@ -9,4 +10,6 @@ import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
9 10
  * @Date 2024-12-09
10 11
  */
11 12
 public interface MsrClassQuestionMapper extends TkMapper<MsrClassQuestion> {
13
+
14
+    void deleteReportByExamid(@Param("examid") Integer examid);
12 15
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrExamMapper.java View File

@@ -2,6 +2,7 @@ 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.MsrExam;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 /**
7 8
  * @Description 阅卷报告-总体分析表 Mapper 接口
@@ -9,4 +10,7 @@ import com.xhkjedu.smarking.model.report.reportother.MsrExam;
9 10
  * @Date 2024-12-09
10 11
  */
11 12
 public interface MsrExamMapper extends TkMapper<MsrExam> {
13
+
14
+    //清除单次考试所有报告
15
+    void deleteReportByExamid(@Param("examid") int examid);
12 16
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java View File

@@ -14,4 +14,6 @@ import java.util.List;
14 14
 public interface MsrStudentMapper extends TkMapper<MsrStudent> {
15 15
     //获取学生考试得分和排名
16 16
     List<MsrStudent> listStuScoreAndRankByExamid(@Param("examid") int examid);
17
+    //批量修改学生主观题、客观题分值
18
+    void updateBatchObjSubScore(@Param("list") List<MsrStudent> list);
17 19
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsTemplateBlock.java View File

@@ -27,6 +27,8 @@ public class MsTemplateBlock extends BaseBean {
27 27
     private String blockname;
28 28
     //类型1客观题2主观题
29 29
     private Integer mttype;
30
+    //客观题方向1横向2纵向
31
+    private Integer direct;
30 32
     //排序/首题号
31 33
     private Integer mtborder;
32 34
     //定位区坐标

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQobjsub.java View File

@@ -23,6 +23,8 @@ public class MsrClassQobjsub extends BaseBean {
23 23
     private String subjectid;
24 24
     //班级ID
25 25
     private Integer classid;
26
+    //参考人数
27
+    private Integer stunum;
26 28
     //类型1客观题2主观题
27 29
     private Integer qtype;
28 30
     //满分

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportother/MsrReportparam.java View File

@@ -23,7 +23,7 @@ public class MsrReportparam extends BaseBean {
23 23
     //归属报告模块编码:zh综合报告 xj校级报告 xk学科报告 bj班级报告 xs学生报告 mtzl命题质量报告 jxzl教学质量报告 xksy学科素养报告
24 24
     private String reportcode;
25 25
 
26
-    //归属:rank排行榜 scorerate班级对比得分率 allrate班级对比表综合率  allrate班级对比表综合率 quesummary试题汇总 scoresection分数分段统计
26
+    //归属:rank排行榜 scorerate班级对比得分率 allrate班级对比表综合率 quesummary试题汇总 scoresection分数分段统计
27 27
     // rankrate名次和比例分析  gradescore分档分数线 nearline临界生群体分析 subjectshow学科考试表现 keystu重点学生信息
28 28
     private String rpbelong;
29 29
     //类型

+ 0
- 2
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportsubject/MsrSubjectQuestionRankgroup.java View File

@@ -25,8 +25,6 @@ public class MsrSubjectQuestionRankgroup extends BaseBean {
25 25
     private Integer qntype;
26 26
     //试题ID
27 27
     private Integer mptqid;
28
-    //分数值
29
-    private Double rgscore;
30 28
     //组别和名次 第1组(1~70名)
31 29
     private String rgroup;
32 30
     //类型1客观题选项 2客/主分值

+ 59
- 31
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGeneratePointService.java View File

@@ -2,7 +2,10 @@ package com.xhkjedu.smarking.service.report.generate;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.xhkjedu.smarking.mapper.paper.MsPaperAnalyzeMapper;
5
+import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentPointMapper;
5 6
 import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectPointMapper;
7
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectPointRankgroupMapper;
8
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectPointSectionMapper;
6 9
 import com.xhkjedu.smarking.model.exam.MsClassStudent;
7 10
 import com.xhkjedu.smarking.model.paper.MsPaperAnalyze;
8 11
 import com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion;
@@ -39,6 +42,12 @@ public class ReportGeneratePointService {
39 42
     private MsPaperAnalyzeMapper msPaperAnalyzeMapper;
40 43
     @Resource
41 44
     private MsrSubjectPointMapper msrSubjectPointMapper;
45
+    @Resource
46
+    private MsrSubjectPointSectionMapper msrSubjectPointSectionMapper;
47
+    @Resource
48
+    private MsrSubjectPointRankgroupMapper msrSubjectPointRankgroupMapper;
49
+    @Resource
50
+    private MsrStudentPointMapper msrStudentPointMapper;
42 51
 
43 52
     //知识点分析,题库知识点按母题分析
44 53
     public void generatePoint(List<MsPaperStudentQuestion> stuSubjectQuestions, List<MsPaperQtypeQuestion> qtypeQuestions,List<MsClassStudent> classStus,
@@ -86,7 +95,7 @@ public class ReportGeneratePointService {
86 95
 
87 96
         //学科总分区间学生
88 97
         List<MsrSubjectPointSection> pointSections = setPointSection(sturanks,pscore);
89
-        Map<Integer,String> qnMap = qtypeQuestions.stream().collect(Collectors.toMap(q-> q.getMptqid(), q -> q.getMptqn() + "." + q.getQn()));
98
+        Map<Integer,String> qnMap = qtypeQuestions.stream().collect(Collectors.toMap(MsPaperQtypeQuestion::getMptqid, q -> q.getMptqn() + "." + q.getQn()));
90 99
 
91 100
         //知识点本分分析(三级知识点分析)
92 101
         for(PointQuestionVo pqvo : pointques){
@@ -177,6 +186,11 @@ public class ReportGeneratePointService {
177 186
                 pointTopAndUpForOther(stuPoints,ques,qnMap,pointParams,classStus,pointSections,sturanks,saveStuPoints,saveSubjectPoints,savePointSections,savePointRankgroups);
178 187
             }
179 188
         }
189
+
190
+        if(!saveStuPoints.isEmpty()) msrStudentPointMapper.insertList(saveStuPoints);
191
+        if(!saveSubjectPoints.isEmpty()) msrSubjectPointMapper.insertList(saveSubjectPoints);
192
+        if(!savePointSections.isEmpty()) msrSubjectPointSectionMapper.insertList(savePointSections);
193
+        if(!savePointRankgroups.isEmpty()) msrSubjectPointRankgroupMapper.insertList(savePointRankgroups);
180 194
     }
181 195
 
182 196
     // 知识点:设置每个学生每个试题知识点得分
@@ -214,7 +228,6 @@ public class ReportGeneratePointService {
214 228
         List<Double> stuScores = pointStuScores.stream().map(PointStudentVo::getStuscore).collect(Collectors.toList());
215 229
         double sumScore = pointStuScores.stream().mapToDouble(PointStudentVo::getStuscore).sum();
216 230
         int stuNum = pointStuScores.size();
217
-        double stuScoreRate = MarkingUtil.calculateRate(sumScore, pointStuScores.stream().mapToDouble(PointStudentVo::getScore).sum());
218 231
         MsrSubjectPoint classPoint = new MsrSubjectPoint();
219 232
         classPoint.setExamid(subjectPoint.getExamid());
220 233
         classPoint.setSubjectid(subjectPoint.getSubjectid());
@@ -231,7 +244,7 @@ public class ReportGeneratePointService {
231 244
         classPoint.setBzc(MarkingUtil.bzc(stuScores));
232 245
         classPoint.setCyxs(MarkingUtil.div(classPoint.getBzc(), classPoint.getAvgscore()));
233 246
         classPoint.setQfd(MarkingUtil.qfd(stuScores));
234
-        classPoint.setJbzs(MarkingUtil.jbzs(stuScores, stuScoreRate));
247
+        classPoint.setJbzs(MarkingUtil.jbzs(stuScores, subjectPoint.getFullscore()));
235 248
         classPoint.setQns(subjectPoint.getQns());
236 249
         classPoint.setMptqids(subjectPoint.getMptqids());
237 250
         return classPoint;
@@ -263,25 +276,36 @@ public class ReportGeneratePointService {
263 276
         return sections;
264 277
     }
265 278
     //知识点-与总分分数区间相关性分析
266
-    private List<MsrSubjectPointSection> pointSection(List<PointStudentVo> pointStuScores,List<MsrSubjectPointSection> sections,PointQuestionVo pqvo,Integer pointlevel){
279
+    private List<MsrSubjectPointSection> pointSection(List<PointStudentVo> pointStuScores,List<MsrSubjectPointSection> sections,PointParams pointParams){
267 280
         List<MsrSubjectPointSection> rtnList = new ArrayList<>();
268 281
         for(MsrSubjectPointSection section : sections){
269 282
             String[] userids = section.getFdids().split(",");
270 283
             List<String> useridList = Arrays.asList(userids);
271 284
             List<PointStudentVo> sectionStuPoints = pointStuScores.stream().filter(q -> useridList.contains(q.getStudentid().toString())).collect(Collectors.toList());
272
-            // 获取总分
273
-            double sumScore = sectionStuPoints.stream().mapToDouble(PointStudentVo::getStuscore).sum();
274
-            int stuNum = sectionStuPoints.size();
275
-            // 获取平均分
276
-            double avgScore = MarkingUtil.div(sumScore, stuNum);
277
-            // 获取平均得分率
278
-            double avgScoreRate = MarkingUtil.calculateRate(avgScore, pqvo.getScore());
279
-            section.setAvgrate(avgScoreRate);
280
-            section.setAvgscore(avgScore);
281
-            section.setPointlevel(pointlevel);
282
-            section.setPointid(pqvo.getPointid());
283
-            section.setPointname(pqvo.getPointname());
284
-            rtnList.add(section);
285
+
286
+            MsrSubjectPointSection sps = new MsrSubjectPointSection();
287
+            sps.setExamid(pointParams.getExamid());
288
+            sps.setSubjectid(pointParams.getSubjectid());
289
+            sps.setPointlevel(pointParams.getPointlevel());
290
+            sps.setPointid(pointParams.getPointid());
291
+            sps.setPointname(pointParams.getPointname());
292
+            sps.setFdfw(section.getFdfw());
293
+            if(!sectionStuPoints.isEmpty()){
294
+                // 获取总分
295
+                double sumScore = sectionStuPoints.stream().mapToDouble(PointStudentVo::getStuscore).sum();
296
+                int stuNum = sectionStuPoints.size();
297
+                // 获取平均分
298
+                double avgScore = MarkingUtil.div(sumScore, stuNum);
299
+                // 获取平均得分率
300
+                double avgScoreRate = MarkingUtil.calculateRate(avgScore, pointParams.getFullscore());
301
+                sps.setAvgrate(avgScoreRate);
302
+                sps.setAvgscore(avgScore);
303
+            }else{
304
+                sps.setAvgrate(0.0);
305
+                sps.setAvgscore(0.0);
306
+            }
307
+
308
+            rtnList.add(sps);
285 309
         }
286 310
         return rtnList;
287 311
     }
@@ -294,8 +318,6 @@ public class ReportGeneratePointService {
294 318
         List<RankGroupVo> rankGroups = MarkingUtil.rankGroup(totalRank,7);
295 319
         //获取知识点分段,1分1段
296 320
         List<RankGroupVo> sectionScores = MarkingUtil.fdScore(pqvo.getScore(),5);
297
-
298
-
299 321
         List<MsrSubjectPointRankgroup> rtnList = new ArrayList<>();
300 322
         for (RankGroupVo rankGroup : rankGroups) {
301 323
             //名次下学生信息
@@ -341,6 +363,7 @@ public class ReportGeneratePointService {
341 363
                     }else{
342 364
                         sectionStuQuestions = groupStuPoints.stream().filter(q -> q.getStuscore() >= sectionScore.getMinvalue() && q.getStuscore() < sectionScore.getMaxvalue()).collect(Collectors.toList());
343 365
                     }
366
+
344 367
                     sqrg.setStunum(sectionStuQuestions.size());
345 368
                     sqrg.setStuids(sectionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
346 369
                 }else{
@@ -373,8 +396,9 @@ public class ReportGeneratePointService {
373 396
             topPoint.setPointname(point.getPointname());
374 397
 
375 398
             //获取知识点的详细信息
376
-            if(pointMap.containsKey(point.getPointid())){
399
+            if(pointMap.containsKey(point.getPointid()) && pointMap.get(point.getPointid()).getPointpid()!= null){
377 400
                 PointVo pointVo = pointMap.get(point.getPointid());
401
+                //说明知识点的上层知识点不为空
378 402
                 PointVo parentNode =pointVo.getParent(points);//上层知识点
379 403
                 upPoint.setTopPointid(parentNode.getPointid());
380 404
                 upPoint.setTopPointname(parentNode.getPointname());
@@ -389,6 +413,7 @@ public class ReportGeneratePointService {
389 413
                     topPoint.setTopPointname(point.getPointname());
390 414
                 }
391 415
             }else{
416
+                //知识点的父知识点为空,即上层、顶层知识点都是知识点本身
392 417
                 upPoint.setTopPointid(point.getPointid());
393 418
                 upPoint.setTopPointname(point.getPointname());
394 419
 
@@ -452,17 +477,20 @@ public class ReportGeneratePointService {
452 477
     private void pointTopAndUpForOther(List<PointStudentVo> levelStuPoints, List<QuestionPointVo> ques, Map<Integer,String> qnMap, PointParams pointParam,
453 478
                                         List<MsClassStudent> classStus, List<MsrSubjectPointSection> pointSections, List<MsrStudent> sturanks,List<MsrStudentPoint> saveStuPoints,
454 479
                                         List<MsrSubjectPoint> saveSubjectPoints, List<MsrSubjectPointSection> savePointSections, List<MsrSubjectPointRankgroup> savePointRankgroups){
480
+        List<Integer> mptqids = new ArrayList<>();
481
+        for(QuestionPointVo qpointvo : ques){
482
+            mptqids.addAll(qpointvo.getMptqids());
483
+        }
455 484
 
456
-        List<Integer> mptqids = ques.stream().map(QuestionPointVo::getMptqid).distinct().collect(Collectors.toList());
457
-        String qnStr="";
485
+        StringBuilder qnStr= new StringBuilder();
458 486
         String mptqidStr = mptqids.stream().map(Object::toString).collect(Collectors.joining(","));
459 487
         for(Map.Entry<Integer,String> qnentry : qnMap.entrySet()){
460 488
             if(mptqids.contains(qnentry.getKey())){
461
-                qnStr = qnStr + qnentry.getValue() + ",";
489
+                qnStr.append(qnentry.getValue()).append(",");
462 490
             }
463 491
         }
464
-        if(N_Utils.isNotEmpty(qnStr)){
465
-            qnStr = qnStr.substring(0,qnStr.length()-1);
492
+        if(N_Utils.isNotEmpty(qnStr.toString())){
493
+            qnStr = new StringBuilder(qnStr.substring(0, qnStr.length() - 1));
466 494
         }
467 495
 
468 496
         //知识点多个试题,处理成单个学生试题总分值
@@ -484,12 +512,12 @@ public class ReportGeneratePointService {
484 512
         subjectPoint.setExamid(pointParam.getExamid());
485 513
         subjectPoint.setSubjectid(pointParam.getSubjectid());
486 514
         subjectPoint.setPointid(pointParam.getPointid());
515
+        subjectPoint.setPointname(pointParam.getPointname());
487 516
         subjectPoint.setClassid(0);
488
-        subjectPoint.setPointname(pointParam.getPointid());
489 517
         subjectPoint.setFullscore(pointParam.getFullscore());
490 518
         subjectPoint.setPointlevel(pointParam.getPointlevel());
491 519
         subjectPoint.setMptqids(mptqidStr);
492
-        subjectPoint.setQns(qnStr);
520
+        subjectPoint.setQns(qnStr.toString());
493 521
 
494 522
         //校知识点分析
495 523
         MsrSubjectPoint schoolPoint = pointLevelClass(pointStuScores, subjectPoint);
@@ -522,7 +550,7 @@ public class ReportGeneratePointService {
522 550
         pqvo.setScore(pointParam.getFullscore());
523 551
 
524 552
         //知识点分段分析(知识点与总分的相关性)
525
-        List<MsrSubjectPointSection> pointSecs = pointSection(pointStuScores, pointSections, pqvo, pointParam.getPointlevel());
553
+        List<MsrSubjectPointSection> pointSecs = pointSection(pointStuScores, pointSections, pointParam);
526 554
         savePointSections.addAll(pointSecs);
527 555
 
528 556
         //知识点考生分组分析
@@ -547,7 +575,7 @@ public class ReportGeneratePointService {
547 575
                 stuPoint.setSturate(MarkingUtil.calculateRate(pstuvo.getStuscore(), pqvo.getScore()));
548 576
                 stuPoint.setSchoolavg(schoolAvgScore);
549 577
                 stuPoint.setSchoolrate(schoolScoreRate);
550
-                stuPoint.setQns(qnStr);
578
+                stuPoint.setQns(qnStr.toString());
551 579
                 stuPoint.setMptqid(mptqidStr);
552 580
                 saveStuPoints.add(stuPoint);
553 581
             }
@@ -673,8 +701,8 @@ public class ReportGeneratePointService {
673 701
                 pqvo.setScore(pointscore);
674 702
 
675 703
                 //知识点结构与总分的相关性(三级知识点)
676
-                List<MsrSubjectPointSection> pointSecs = pointSection(pointStuScores, pointSections, pqvo, pointlevel);
677
-                savePointSections.addAll(pointSecs);
704
+                // List<MsrSubjectPointSection> pointSecs = pointSection(pointStuScores, pointSections, PointParams);
705
+                // savePointSections.addAll(pointSecs);
678 706
 
679 707
                 //知识点考生分组分析
680 708
                 List<MsrSubjectPointRankgroup> pointRankg = pointRankGroup(pointStuScores,sturanks, pqvo, examid, subjectid, pointlevel);

+ 116
- 42
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java View File

@@ -31,6 +31,7 @@ import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
31 31
 import com.xhkjedu.smarking.vo.report.reportsubject.SectionScoreVo;
32 32
 import com.xhkjedu.utils.N_Utils;
33 33
 import org.springframework.stereotype.Service;
34
+import org.springframework.transaction.annotation.Transactional;
34 35
 
35 36
 import javax.annotation.Resource;
36 37
 import java.util.*;
@@ -70,6 +71,7 @@ public class ReportGenerateQuestionService {
70 71
     @Resource
71 72
     private ReportGeneratePointService reportGeneratePointService;
72 73
 
74
+    @Transactional(rollbackFor = Exception.class)
73 75
     public void generateQuestion(Integer examid, Integer exammode) {
74 76
         // 查询所有学生试题
75 77
         List<MsPaperStudentQuestion> stuQuestions = msPaperStudentQuestionMapper.listAllStuQuesByExamid(examid);
@@ -79,6 +81,8 @@ public class ReportGenerateQuestionService {
79 81
         // 获取考试参数
80 82
         List<MsrReportparam> params = msrReportparamMapper.listReportparamByRpbelong(examid, "quesummary", null);
81 83
 
84
+        msrClassQuestionMapper.deleteReportByExamid(examid);//清除数据
85
+
82 86
         // 根据科目进行区分
83 87
         for (MsPaper subject : subjects) {
84 88
             String subjectid = subject.getSubjectid();
@@ -94,6 +98,8 @@ public class ReportGenerateQuestionService {
94 98
             // 获取学生科目得分及排名
95 99
             List<MsrStudent> subjectStuPapers = stuPapers.stream().filter(p -> p.getSubjectid().equals(subjectid)).collect(Collectors.toList());
96 100
 
101
+            // 处理学生客观题、主观题得分
102
+            handleStudentObjSub(subjectStuQuestions, subjectStuPapers, questions);
97 103
             // 处理小题
98 104
             handleQuestion(subjectStuQuestions, subjectClassStudents, questions, subjectParams, subjectStuPapers, examid, subjectid,subject.getPscore());
99 105
             //处理题型
@@ -101,8 +107,36 @@ public class ReportGenerateQuestionService {
101 107
             //客观题、主观题
102 108
             handleObjSub(subjectStuQuestions, subjectClassStudents, questions, subjectStuPapers, examid, subjectid,subject.getPscore());
103 109
             //知识点相关分析
104
-            reportGeneratePointService.generatePoint(subjectStuQuestions,questions,classStudents,stuPapers,examid,subjectid,subject.getMpid(),subject.getPscore());
110
+            reportGeneratePointService.generatePoint(subjectStuQuestions,questions,classStudents,subjectStuPapers,examid,subjectid,subject.getMpid(),subject.getPscore());
111
+        }
112
+    }
113
+
114
+    //学生客观题、主观题得分
115
+    private void handleStudentObjSub(List<MsPaperStudentQuestion> subjectStuQuestions, List<MsrStudent> stus, List<MsPaperQtypeQuestion> questions){
116
+        //获取试卷中所有主观题、客观题
117
+        List<Integer> objMptqids = questions.stream().filter(q -> q.getQtype()==1).map(MsPaperQtypeQuestion::getMptqid).distinct().collect(Collectors.toList());
118
+        List<Integer> subMptqids = questions.stream().filter(q -> q.getQtype()==2).map(MsPaperQtypeQuestion::getMptqid).distinct().collect(Collectors.toList());
119
+        //学生试题按学生分组
120
+        Map<Integer,List<MsPaperStudentQuestion>> stuQuestionMap = subjectStuQuestions.stream().collect(Collectors.groupingBy(MsPaperStudentQuestion::getStudentid));
121
+
122
+        for(MsrStudent stu:stus){
123
+            Integer studentid = stu.getStudentid();
124
+            if(stuQuestionMap.containsKey(studentid)){
125
+                List<MsPaperStudentQuestion> stuQuestions = stuQuestionMap.get(studentid);
126
+                List<MsPaperStudentQuestion> objStuQues = stuQuestions.stream().filter(q -> objMptqids.contains(q.getMptqid())).collect(Collectors.toList());
127
+                List<MsPaperStudentQuestion> subStuQues = stuQuestions.stream().filter(q -> subMptqids.contains(q.getMptqid())).collect(Collectors.toList());
128
+                //学生客观题得分
129
+                double objScore = objStuQues.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
130
+                //学生主观题得分
131
+                double subScore = subStuQues.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
132
+                stu.setObjscore(N_Utils.formatDouble(objScore,1));
133
+                stu.setSubscore(N_Utils.formatDouble(subScore,1));
134
+            }else{
135
+                stu.setObjscore(0.0);
136
+                stu.setSubscore(0.0);
137
+            }
105 138
         }
139
+        msrStudentMapper.updateBatchObjSubScore(stus);
106 140
     }
107 141
 
108 142
     // 单个试题分析
@@ -139,6 +173,7 @@ public class ReportGenerateQuestionService {
139 173
             schoolQ.setSchoolavgscore(avgScore);
140 174
             schoolQ.setSchoolavgrate(avgScoreRate);
141 175
             schoolQ.setMptqid(question.getMptqid());
176
+            schoolQ.setZqda(question.getQanswer());
142 177
             schoolQ.setQn(question.getMptqn() + "." + question.getQn());
143 178
             // 全校班级试题情况
144 179
             MsrClassQuestion schoolQue = questionClass(stuQuestions, question, params, schoolQ);
@@ -238,7 +273,7 @@ public class ReportGenerateQuestionService {
238 273
 
239 274
         classQ.setScorerate(stuScoreRate);
240 275
         classQ.setScoreratec(MarkingUtil.sub(MarkingUtil.calculateRate(maxScore, qScore), MarkingUtil.calculateRate(minScore, qScore)));// 得分率差=最高得分率-最低得分率
241
-        classQ.setNd(MarkingUtil.div(stuScoreRate, qScore));// 难度
276
+        classQ.setNd(MarkingUtil.div(avgScore, qScore));// 难度
242 277
         String[] ndStr = questionNdAndQfd(params, 1, classQ.getNd());
243 278
         classQ.setNdms(ndStr[0]);// 难度描述
244 279
         classQ.setNdfw(ndStr[1]);// 难度范围
@@ -248,19 +283,32 @@ public class ReportGenerateQuestionService {
248 283
         classQ.setQfdfw(qfdStr[1]);// 区分度范围
249 284
         classQ.setBzc(MarkingUtil.bzc(stuScores));// 标准差
250 285
         classQ.setCyxs(MarkingUtil.div(classQ.getBzc(), avgScore));// 差异系数
251
-        classQ.setJbzs(MarkingUtil.jbzs(stuScores, stuScoreRate));// 鉴别指数
286
+        classQ.setJbzs(MarkingUtil.jbzs(stuScores, question.getQscore()));// 鉴别指数
287
+        classQ.setZqda(schoolQ.getZqda());
252 288
         // 获取所有满分学生
253 289
         List<MsPaperStudentQuestion> fullStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore().equals(q.getQscore())).collect(Collectors.toList());
254
-        String mfids = fullStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 满分学生id
255
-        classQ.setMfnum(fullStuQuestions.size());
256
-        classQ.setMfrate(MarkingUtil.calculateRate(classQ.getMfnum(), stunum));////正确率、满分人数占比
257
-        classQ.setMfids(mfids);
290
+        if(!fullStuQuestions.isEmpty()){
291
+            String mfids = fullStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 满分学生id
292
+            classQ.setMfnum(fullStuQuestions.size());
293
+            classQ.setMfrate(MarkingUtil.calculateRate(classQ.getMfnum(), stunum));////正确率、满分人数占比
294
+            classQ.setMfids(mfids);
295
+        }else{
296
+            classQ.setMfnum(0);
297
+            classQ.setMfrate(0.0);////正确率、满分人数占比
298
+        }
299
+        classQ.setZqrate(classQ.getMfrate());
300
+
258 301
         // 获取零分学生
259 302
         List<MsPaperStudentQuestion> lfStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore() == 0).collect(Collectors.toList());
260
-        String lfids = lfStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 零分学生id
261
-        classQ.setLfnum(lfStuQuestions.size());
262
-        classQ.setLfrate(MarkingUtil.calculateRate(lfStuQuestions.size(), stunum));////零分人数占比
263
-        classQ.setLfids(lfids);
303
+        if (!lfStuQuestions.isEmpty()) {
304
+            String lfids = lfStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 零分学生id
305
+            classQ.setLfnum(lfStuQuestions.size());
306
+            classQ.setLfrate(MarkingUtil.calculateRate(lfStuQuestions.size(), stunum));////零分人数占比
307
+            classQ.setLfids(lfids);
308
+        } else {
309
+            classQ.setLfnum(0);
310
+            classQ.setLfrate(0.0);////零分人数占比
311
+        }
264 312
         return classQ;
265 313
     }
266 314
 
@@ -397,12 +445,18 @@ public class ReportGenerateQuestionService {
397 445
                     }else{
398 446
                         sectionStuQuestions = groupStuQuestions.stream().filter(q -> q.getStuscore() >= sectionScore.getMinvalue() && q.getStuscore() < sectionScore.getMaxvalue()).collect(Collectors.toList());
399 447
                     }
400
-                    double sectionStuSumScore = sectionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
401
-                    double sectionStuAvgScore = MarkingUtil.div(sectionStuSumScore, sectionStuQuestions.size());
402
-                    sqrg.setStunum(sectionStuQuestions.size());
403
-                    sqrg.setStuids(sectionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
404
-                    sqrg.setScorerate(MarkingUtil.calculateRate(sectionStuSumScore, sectionStuQuestions.size() * fullScore));
405
-                    sqrg.setAvgrate(MarkingUtil.calculateRate(sectionStuAvgScore, fullScore));
448
+                    if(!sectionStuQuestions.isEmpty()){
449
+                        double sectionStuSumScore = sectionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
450
+                        double sectionStuAvgScore = MarkingUtil.div(sectionStuSumScore, sectionStuQuestions.size());
451
+                        sqrg.setStunum(sectionStuQuestions.size());
452
+                        sqrg.setStuids(sectionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
453
+                        sqrg.setScorerate(MarkingUtil.calculateRate(sectionStuSumScore, sectionStuQuestions.size() * fullScore));
454
+                        sqrg.setAvgrate(MarkingUtil.calculateRate(sectionStuAvgScore, fullScore));
455
+                    }else{
456
+                        sqrg.setStunum(0);
457
+                        sqrg.setScorerate(0.0);
458
+                        sqrg.setAvgrate(0.0);
459
+                    }
406 460
                 }else{
407 461
                     sqrg.setStunum(0);
408 462
                     sqrg.setScorerate(0.0);
@@ -419,10 +473,10 @@ public class ReportGenerateQuestionService {
419 473
                 }
420 474
                 List<String> newOptions = options.stream().map(s -> s != null && !s.isEmpty() ? s : "未作答").sorted().collect(Collectors.toList());
421 475
                 for(String optionStr : newOptions){
422
-
423 476
                     MsrSubjectQuestionRankgroup optionObj = new MsrSubjectQuestionRankgroup();
424 477
                     optionObj.setExamid(examid);
425 478
                     optionObj.setSubjectid(subjectid);
479
+                    optionObj.setMptqid(mptqid);
426 480
                     optionObj.setQntype(1);
427 481
                     optionObj.setRgroup(rankGroup.getGroupname());
428 482
                     optionObj.setRgtype(1);
@@ -436,13 +490,20 @@ public class ReportGenerateQuestionService {
436 490
                             optionStuQuestions = groupStuQuestions.stream().filter(q -> optionStr.equals(q.getStuanswer())).collect(Collectors.toList());
437 491
                         }
438 492
 
439
-                        double optionStuSumScore = optionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
440
-                        double optionStuAvgScore = MarkingUtil.div(optionStuSumScore, optionStuQuestions.size());
493
+                        if(!optionStuQuestions.isEmpty()){
494
+                            double optionStuSumScore = optionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
495
+                            double optionStuAvgScore = MarkingUtil.div(optionStuSumScore, optionStuQuestions.size());
496
+
497
+                            optionObj.setStunum(optionStuQuestions.size());
498
+                            optionObj.setStuids(optionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
499
+                            optionObj.setScorerate(MarkingUtil.calculateRate(optionStuSumScore, optionStuQuestions.size() * fullScore));
500
+                            optionObj.setAvgrate(MarkingUtil.calculateRate(optionStuAvgScore, fullScore));
501
+                        }else{
502
+                            optionObj.setStunum(0);
503
+                            optionObj.setScorerate(0.0);
504
+                            optionObj.setAvgrate(0.0);
505
+                        }
441 506
 
442
-                        optionObj.setStunum(optionStuQuestions.size());
443
-                        optionObj.setStuids(optionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
444
-                        optionObj.setScorerate(MarkingUtil.calculateRate(optionStuSumScore, optionStuQuestions.size() * fullScore));
445
-                        optionObj.setAvgrate(MarkingUtil.calculateRate(optionStuAvgScore, fullScore));
446 507
                     }else{
447 508
                         optionObj.setStunum(0);
448 509
                         optionObj.setScorerate(0.0);
@@ -491,22 +552,36 @@ public class ReportGenerateQuestionService {
491 552
             String[] userids = section.getFdids().split(",");
492 553
             List<String> useridList = Arrays.asList(userids);
493 554
             List<MsPaperStudentQuestion> sectionStuQuestions = stuQuestions.stream().filter(q -> useridList.contains(q.getStudentid().toString())).collect(Collectors.toList());
555
+
556
+            MsrSubjectQuestionSection sqs = new MsrSubjectQuestionSection();
557
+            sqs.setExamid(section.getExamid());
558
+            sqs.setSubjectid(section.getSubjectid());
559
+            sqs.setMptqid(mptqid);
560
+            sqs.setFdfw(section.getFdfw());
561
+            sqs.setFdnum(section.getFdnum());
562
+            sqs.setFdids(section.getFdids());
494 563
             // 获取总分
495
-            double sumScore = sectionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
496
-            int stuNum = sectionStuQuestions.size();
497
-            // 获取平均分
498
-            double avgScore = MarkingUtil.div(sumScore, stuNum);
499
-            // 获取平均得分率
500
-            double avgScoreRate = MarkingUtil.calculateRate(avgScore, fullScore);
501
-            section.setAvgscore(avgScore);
502
-            section.setAvgrate(avgScoreRate);
564
+            if(!sectionStuQuestions.isEmpty()){
565
+                int stuNum = sectionStuQuestions.size();
566
+                // 获取总分
567
+                double sumScore = sectionStuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();
568
+                // 获取平均分
569
+                double avgScore = MarkingUtil.div(sumScore, stuNum);
570
+                // 获取平均得分率
571
+                double avgScoreRate = MarkingUtil.calculateRate(avgScore, fullScore);
572
+                sqs.setAvgscore(avgScore);
573
+                sqs.setAvgrate(avgScoreRate);
574
+            }else{
575
+                sqs.setAvgscore(0.0);
576
+                sqs.setAvgrate(0.0);
577
+            }
578
+
503 579
             if(qtype == 1){
504
-                section.setQntype(qtype);//类型1小题2客观题3主观题
580
+                sqs.setQntype(qtype);//类型1小题2客观题3主观题
505 581
             }else{
506
-                section.setQntype(qtype+1);
582
+                sqs.setQntype(qtype+1);
507 583
             }
508
-            section.setMptqid(mptqid);
509
-            rtnList.add(section);
584
+            rtnList.add(sqs);
510 585
         }
511 586
         return rtnList;
512 587
     }
@@ -592,9 +667,9 @@ public class ReportGenerateQuestionService {
592 667
         classQtype.setAvgscore(avgScore);
593 668
         classQtype.setBzc(MarkingUtil.bzc(stuScores));
594 669
         classQtype.setNd(MarkingUtil.div(avgScore, schoolQtype.getFullscore()));
595
-        classQtype.setNdms(questionNdAndQfd(params, 1, schoolQtype.getNd())[0]);
670
+        classQtype.setNdms(questionNdAndQfd(params, 1, classQtype.getNd())[0]);
596 671
         classQtype.setQfd(MarkingUtil.qfd(stuScores));
597
-        classQtype.setQfdms(questionNdAndQfd(params, 2, schoolQtype.getQfd())[0]);
672
+        classQtype.setQfdms(questionNdAndQfd(params, 2, classQtype.getQfd())[0]);
598 673
         classQtype.setMfnum(mfnum);
599 674
         classQtype.setMfrate(MarkingUtil.calculateRate(mfnum, stuNum));
600 675
         if(mfnum > 0){
@@ -644,8 +719,7 @@ public class ReportGenerateQuestionService {
644 719
             List<MsrSubjectQuestionSection> sectionQuestions = subjectSectionQuestion(stuQuestions, subjectSectionQuestions,entry.getKey(), fullScore,null);
645 720
             saveSectionQuestions.addAll(sectionQuestions);
646 721
 
647
-
648
-            Integer qobjsubtype;//为了区分表中存放值
722
+            int qobjsubtype;//为了区分表中存放值
649 723
             if(entry.getKey() == 1){
650 724
                 qobjsubtype = 11;
651 725
             }else{
@@ -700,12 +774,12 @@ public class ReportGenerateQuestionService {
700 774
 
701 775
         Double stuSumScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).sum();// 学生总分
702 776
         Double avgScore = MarkingUtil.div(stuSumScore, stuNum);// 平均分
703
-        Double stuScoreRate = MarkingUtil.div(stuSumScore, schoolObjsub.getFullscore() * stuNum);// 学生得分率
704 777
 
705 778
         MsrClassQobjsub objSub = new MsrClassQobjsub();
706 779
         objSub.setExamid(schoolObjsub.getExamid());
707 780
         objSub.setSubjectid(schoolObjsub.getSubjectid());
708 781
         objSub.setClassid(schoolObjsub.getClassid());
782
+        objSub.setStunum(stuNum);
709 783
         objSub.setQtype(schoolObjsub.getQtype());
710 784
         objSub.setFullscore(schoolObjsub.getFullscore());
711 785
         objSub.setMaxscore(stuScores.stream().max(Double::compareTo).orElse(0.0));
@@ -716,7 +790,7 @@ public class ReportGenerateQuestionService {
716 790
         objSub.setQfd(MarkingUtil.qfd(stuScores));
717 791
         objSub.setBzc(MarkingUtil.bzc(stuScores));
718 792
         objSub.setCyxs(MarkingUtil.div(objSub.getBzc(), avgScore));
719
-        objSub.setJbzs(MarkingUtil.jbzs(stuScores, stuScoreRate));
793
+        objSub.setJbzs(MarkingUtil.jbzs(stuScores, schoolObjsub.getFullscore()));
720 794
         objSub.setMfnum(mfnum);
721 795
         objSub.setMfrate(MarkingUtil.calculateRate(mfnum, stuNum));
722 796
         if(mfnum > 0){

+ 18
- 19
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java View File

@@ -389,8 +389,8 @@ public class MarkingUtil {
389 389
         if (N_Utils.isListEmpty(x)) return 0;
390 390
         int m = x.size();
391 391
         double sum = 0;
392
-        for (int i = 0; i < m; i++) {// 求和
393
-            sum += x.get(i);
392
+        for (Double aDouble : x) {// 求和
393
+            sum += aDouble;
394 394
         }
395 395
         double dAve = sum / m;// 求平均值
396 396
         double dVar = 0;
@@ -430,6 +430,7 @@ public class MarkingUtil {
430 430
         if (N_Utils.isListEmpty(scores)) return 0;
431 431
 
432 432
         int totalCount = scores.size();
433
+        Collections.sort(scores);//对集合排序
433 434
         int highCount = (int) Math.ceil(totalCount * 0.27); // 高分组人数
434 435
         int lowCount = (int) Math.ceil(totalCount * 0.27);  // 低分组人数
435 436
 
@@ -520,20 +521,23 @@ public class MarkingUtil {
520 521
 
521 522
     // 鉴别指数 试题鉴别指数 = 前27%的学生得分率-后27%的学生得分率
522 523
     // 将学生按总分排序(去掉缺考的学生),取前27%、后27%的学生,分别计算在该题上的得分率,两者之差即为鉴别指数
523
-    public static double jbzs(List<Double> list, Double scoreRate) {
524
+    public static double jbzs(List<Double> list, Double qscore) {
524 525
         List<Double> sortList = list.stream().sorted().collect(Collectors.toList());
525 526
         int size = sortList.size();
526
-        int count = (int) (size * 0.27);// 27%学生数量
527
+
528
+        if (qscore == 0) return 0.0;
529
+        int highCount = (int) Math.ceil(size * 0.27); // 高分组人数
530
+        int lowCount = (int) Math.ceil(size * 0.27);  // 低分组人数
527 531
 
528 532
         // 前27%的学生
529
-        List<Double> topGroup = sortList.subList(0, count);
533
+        List<Double> topGroup = new ArrayList<>(sortList.subList(size - highCount, size));
530 534
         double topScore = topGroup.stream().mapToDouble(Double::doubleValue).sum();
531
-        double topRate = div(topScore, mul(scoreRate, count));
535
+        double topRate = div(topScore, mul(qscore, highCount));
532 536
 
533 537
         // 后27%的学生
534
-        List<Double> bottomGroup = sortList.subList(size - count, size);
538
+        List<Double> bottomGroup = new ArrayList<>(sortList.subList(0, lowCount));
535 539
         double bottomScore = bottomGroup.stream().mapToDouble(Double::doubleValue).sum();
536
-        double bottomRate = div(bottomScore, mul(scoreRate, count));
540
+        double bottomRate = div(bottomScore, mul(qscore, lowCount));
537 541
 
538 542
         // 鉴别指数
539 543
         return sub(topRate, bottomRate);
@@ -578,7 +582,7 @@ public class MarkingUtil {
578 582
     //分数排名
579 583
     public static Map<Double,Integer> fspm(List<Double> scores) {
580 584
         //倒序排
581
-        Collections.sort(scores, Collections.reverseOrder());
585
+        scores.sort(Collections.reverseOrder());
582 586
         // 创建一个地图来存储分数和出现次数
583 587
         Map<Double, Integer> scoreCountMap = new HashMap<>();
584 588
 
@@ -595,7 +599,7 @@ public class MarkingUtil {
595 599
     //人数排名
596 600
     public static Map<Integer,Integer> rspm(List<Integer> nums) {
597 601
         //倒序排
598
-        Collections.sort(nums, Collections.reverseOrder());
602
+        nums.sort(Collections.reverseOrder());
599 603
         // 创建一个地图来存储分数和出现次数
600 604
         Map<Integer, Integer> scoreCountMap = new HashMap<>();
601 605
 
@@ -668,15 +672,10 @@ public class MarkingUtil {
668 672
         return "";
669 673
     }
670 674
     public static void main(String[] args) {
671
-        // List<SectionScoreVo> rtnList = fdScoreForOne(0.8);
672
-        // for (SectionScoreVo rg : rtnList) {
673
-        //     System.out.println(rg.getSectionname() + ": " + rg.getMinvalue() + "-" + rg.getMaxvalue());
674
-        // }
675
-
676
-        List<String> list = Arrays.asList("A", "BC", "C", "AB", "","D");
677
-    List<String> rtnList = list.stream().map(s -> s != null &&!s.isEmpty() ? s : "未作答").sorted().collect(Collectors.toList());
678
-        for (String rtn : rtnList) {
679
-            System.out.println(rtn);
675
+        List<String> options = Arrays.asList("A","B","D","F","","C","E");
676
+        List<String> newOptions = options.stream().map(s -> s != null && !s.isEmpty() ? s : "未作答").sorted().collect(Collectors.toList());
677
+        for (String option : newOptions) {
678
+            System.out.println(option);
680 679
         }
681 680
     }
682 681
 }

+ 5
- 4
smarking/src/main/resources/mapper/paper/MsTemplateBlockMapper.xml View File

@@ -15,6 +15,7 @@
15 15
         <result column="mblockid" property="mblockid" />
16 16
         <result column="blockname" property="blockname" />
17 17
         <result column="mttype" property="mttype" />
18
+        <result column="direct" property="direct" />
18 19
         <result column="localcoor" property="localcoor" />
19 20
         <result column="pagenum" property="pagenum" />
20 21
         <result column="extendcoor" property="extendcoor" />
@@ -28,9 +29,9 @@
28 29
             <result column="mtbqorder" property="mtbqorder" />
29 30
         </collection>
30 31
     </resultMap>
31
-    <!--模信息详情-->
32
+    <!--模信息详情-->
32 33
     <select id="listTemplateBlockQuestions" resultMap="templateBlockResultMap">
33
-        select b.mtbid,b.mblockid,b.blockname,b.mttype,b.localcoor,b.pagenum,b.extendcoor,b.scorecoor,
34
+        select b.mtbid,b.mblockid,b.blockname,b.mttype,b.direct,b.localcoor,b.pagenum,b.extendcoor,b.scorecoor,
34 35
         b.mtborder,q.mtbqid,q.qn,q.qlocalcoor,q.mtbqorder
35 36
         from ms_template_block b left join ms_template_block_question q on b.mtbid=q.mtbid
36 37
         where b.mtid=#{mtid}
@@ -40,9 +41,9 @@
40 41
         order by b.mtborder,q.mtbqorder
41 42
     </select>
42 43
 
43
-    <!--获取模主观题题块信息-->
44
+    <!--获取模主观题题块信息-->
44 45
     <select id="listSubjectiveBlockQuestions" resultType="java.util.Map">
45
-        select b.mtbid,b.mblockid,b.blockname,b.mttype,b.localcoor,b.pagenum,b.extendcoor,b.scorecoor,
46
+        select b.mtbid,b.mblockid,b.blockname,b.mttype,b.direct,b.localcoor,b.pagenum,b.extendcoor,b.scorecoor,
46 47
         b.mtborder from ms_template_block b where b.mtid=#{mtid} and b.mttype=2 order by b.mtborder
47 48
     </select>
48 49
 </mapper>

+ 14
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml View File

@@ -1,4 +1,18 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQuestionMapper">
4
+
5
+    <!-- 清除单次考试报告 -->
6
+    <delete id="deleteReportByExamid">
7
+        delete from msr_class_qobjsub where examid = #{examid};
8
+        delete from msr_class_qtype where examid = #{examid};
9
+        delete from msr_class_question where examid = #{examid};
10
+        delete from msr_class_question_obj where examid = #{examid};
11
+        delete from msr_student_point where examid = #{examid};
12
+        delete from msr_subject_point where examid = #{examid};
13
+        delete from msr_subject_point_section where examid = #{examid};
14
+        delete from msr_subject_question_rankgroup where examid = #{examid};
15
+        delete from msr_subject_question_section where examid = #{examid};
16
+    </delete>
17
+
4 18
 </mapper>

+ 25
- 0
smarking/src/main/resources/mapper/report/reportother/MsrExamMapper.xml View File

@@ -1,4 +1,29 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.report.reportother.MsrExamMapper">
4
+
5
+    <!-- 清除单次考试报告 -->
6
+    <delete id="deleteReportByExamid">
7
+        delete from msr_class_goodbad where examid = #{examid};
8
+        delete from msr_class_nearline where examid = #{examid};
9
+        delete from msr_class_qobjsub where examid = #{examid};
10
+        delete from msr_class_qtype where examid = #{examid};
11
+        delete from msr_class_question where examid = #{examid};
12
+        delete from msr_class_question_obj where examid = #{examid};
13
+        delete from msr_class_rankgroup where examid = #{examid};
14
+        delete from msr_class_rankrate where examid = #{examid};
15
+        delete from msr_class_section where examid = #{examid};
16
+        delete from msr_class_subject where examid = #{examid};
17
+        delete from msr_class_subject_grade where examid = #{examid};
18
+        delete from msr_class_top where examid = #{examid};
19
+        delete from msr_exam where examid = #{examid};
20
+        delete from msr_student where examid = #{examid};
21
+        delete from msr_student_point where examid = #{examid};
22
+        delete from msr_subject where examid = #{examid};
23
+        delete from msr_subject_class where examid = #{examid};
24
+        delete from msr_subject_point where examid = #{examid};
25
+        delete from msr_subject_point_section where examid = #{examid};
26
+        delete from msr_subject_question_rankgroup where examid = #{examid};
27
+        delete from msr_subject_question_section where examid = #{examid};
28
+    </delete>
4 29
 </mapper>

+ 7
- 0
smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml View File

@@ -5,4 +5,11 @@
5 5
     <select id="listStuScoreAndRankByExamid" resultType="com.xhkjedu.smarking.model.report.reportstu.MsrStudent">
6 6
         select rsid,examid,subjectid,classid,studentid,stuscore,classrank,schoolrank from msr_student where examid = #{examid}
7 7
     </select>
8
+
9
+    <!--批量修改学生主观题、客观题分值-->
10
+    <update id="updateBatchObjSubScore">
11
+        <foreach collection="list" item="item" separator=";">
12
+            update msr_student set objscore = #{item.objscore},subscore = #{item.subscore} where rsid = #{item.rsid}
13
+        </foreach>
14
+    </update>
8 15
 </mapper>

+ 1
- 1
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml View File

@@ -325,7 +325,7 @@
325 325
 
326 326
     <!--获取考试所有参考学生作答情况-->
327 327
     <select id="listAllStuQuesByExamid" resultType="com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion">
328
-        select sq.mpsqid,sq.studentid,sq.subjectid,sq.mpid,sq.mpsid,sq.mptid,sq.mptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,
328
+        select sq.mpsqid,sq.studentid,sq.subjectid,sq.mpid,sq.mpsid,sq.mptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,
329 329
         sq.qscore,sq.answered,sq.answertype,sq.stuanswer,sq.stuscore,sq.stumerge,sq.hasgood,sq.hasbad
330 330
         from ms_paper_student_question sq
331 331
         left join ms_paper_student ps on sq.mpsid=ps.mpsid

Loading…
Cancel
Save