Browse Source

完善模板、班级试题学生试题

ywx
王宁 2 weeks ago
parent
commit
7edfb40185
20 changed files with 430 additions and 29 deletions
  1. 53
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/BjReportController.java
  2. 39
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/MtzlReportController.java
  3. 27
    1
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/XkReportController.java
  4. 52
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/XsReportController.java
  5. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassQuestionMapper.java
  6. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java
  7. 8
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentPointMapper.java
  8. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaperQtypeQuestion.java
  9. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportstu/MsrStudentPoint.java
  10. 3
    2
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java
  11. 2
    2
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGeneratePointService.java
  12. 186
    17
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java
  13. 16
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java
  14. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ExamReportParams.java
  15. 3
    2
      smarking/src/main/resources/mapper/paper/MsPaperQtypeMapper.xml
  16. 3
    2
      smarking/src/main/resources/mapper/paper/MsTemplateBlockMapper.xml
  17. 1
    1
      smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml
  18. 9
    1
      smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml
  19. 11
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml
  20. 7
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentPointMapper.xml

+ 53
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/BjReportController.java View File

@@ -0,0 +1,53 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import com.xhkjedu.smarking.service.report.report.MsrClassQuestionService;
4
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5
+import com.xhkjedu.utils.N_Utils;
6
+import com.xhkjedu.vo.ResultVo;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RestController;
11
+
12
+import javax.annotation.Resource;
13
+
14
+/**
15
+ * @Description:班级报告
16
+ * @Author: WN
17
+ * @Date: 2024/12/30 10:33:37
18
+ **/
19
+@RestController
20
+@RequestMapping("/rbj")
21
+public class BjReportController {
22
+    @Resource
23
+    private MsrClassQuestionService msrClassQuestionService;
24
+
25
+
26
+
27
+    /*
28
+     * @Description 全部班级-学科试题得分率对比
29
+     * @Date 2024/12/30 10:35:09
30
+     * @Author WN
31
+     * @Param [params]
32
+     * @Return com.xhkjedu.vo.ResultVo
33
+     **/
34
+    @PostMapping("/qbbj_xkst")
35
+    public ResultVo listQuestionForBjQuestionScoreRate(@RequestBody ExamReportParams params){
36
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
37
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForBjQuestionScoreRate(params));
38
+    }
39
+
40
+
41
+    /*
42
+     * @Description 单个班级-学科试题考试内在表现
43
+     * @Date 2024/12/30 11:22:42
44
+     * @Author WN
45
+     * @Param [params]
46
+     * @Return com.xhkjedu.vo.ResultVo
47
+     **/
48
+    @PostMapping("/dgb_stks")
49
+    public ResultVo listQuestionForBjStks(@RequestBody ExamReportParams params){
50
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getClassid(),"班级id",1});
51
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForBjStks(params));
52
+    }
53
+}

+ 39
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/MtzlReportController.java View File

@@ -0,0 +1,39 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import com.xhkjedu.smarking.service.report.report.MsrClassQuestionService;
4
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5
+import com.xhkjedu.utils.N_Utils;
6
+import com.xhkjedu.vo.ResultVo;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RestController;
11
+
12
+import javax.annotation.Resource;
13
+
14
+/**
15
+ * @Description:命题质量报告
16
+ * @Author: WN
17
+ * @Date: 2024/12/30 17:00:47
18
+ **/
19
+@RestController
20
+@RequestMapping("/rmtzl")
21
+public class MtzlReportController {
22
+    @Resource
23
+    private MsrClassQuestionService msrClassQuestionService;
24
+
25
+
26
+    /*
27
+     * @Description 命题分析-试题分析指标明细表
28
+     * @Date 2024/12/30 17:01:56
29
+     * @Author WN
30
+     * @Param [params]
31
+     * @Return com.xhkjedu.vo.ResultVo
32
+     **/
33
+    @PostMapping("/mtfx_stfx")
34
+    public ResultVo listMtzlMtfxQuestions(@RequestBody ExamReportParams params){
35
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
36
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listMtzlStfxQuestions(params));
37
+    }
38
+
39
+}

+ 27
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/report/XkReportController.java View File

@@ -23,7 +23,7 @@ public class XkReportController {
23 23
     private MsrClassQuestionService msrClassQuestionService;
24 24
 
25 25
     /*
26
-     * @Description 各班学科试题分析-得分率
26
+     * @Description 各班学科试题分析-得分率,得分率差异对比
27 27
      * @Date 2024/12/27 15:42:52
28 28
      * @Author WN
29 29
      * @Param [params]
@@ -34,4 +34,30 @@ public class XkReportController {
34 34
         N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getClassids(),"班级id",2});
35 35
         return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForXhXhstDfl(params));
36 36
     }
37
+
38
+    /*
39
+     * @Description 各班学科试题分析-区分度,得分率差
40
+     * @Date 2024/12/30 10:13:10
41
+     * @Author WN
42
+     * @Param [params]
43
+     * @Return com.xhkjedu.vo.ResultVo
44
+     **/
45
+    @PostMapping("/xkst_qfd")
46
+    public ResultVo listQuestionForXhXhstQfd(@RequestBody ExamReportParams params){
47
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getClassid(),"班级id",1});
48
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForXhXhstQfd(params));
49
+    }
50
+
51
+    /*
52
+     * @Description 各班学科试题分析-难度分组表现差异
53
+     * @Date 2024/12/30 10:24:14
54
+     * @Author WN
55
+     * @Param [params]
56
+     * @Return com.xhkjedu.vo.ResultVo
57
+     **/
58
+    @PostMapping("/xkst_Nd")
59
+    public ResultVo listQuestionForXhXhstNdGroup(@RequestBody ExamReportParams params){
60
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
61
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForXhXhstNdGroup(params));
62
+    }
37 63
 }

+ 52
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/XsReportController.java View File

@@ -0,0 +1,52 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import com.xhkjedu.smarking.service.report.report.MsrStudentService;
4
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5
+import com.xhkjedu.utils.N_Utils;
6
+import com.xhkjedu.vo.ResultVo;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RestController;
11
+
12
+import javax.annotation.Resource;
13
+
14
+/**
15
+ * @Description:学生报告
16
+ * @Author: WN
17
+ * @Date: 2024/12/30 16:10:55
18
+ **/
19
+@RestController
20
+@RequestMapping("/rxs")
21
+public class XsReportController {
22
+    @Resource
23
+    private MsrStudentService msrStudentService;
24
+
25
+
26
+
27
+    /*
28
+     * @Description 学生各学科试题分析
29
+     * @Date 2024/12/30 16:12:23
30
+     * @Author WN
31
+     * @Param [params]
32
+     * @Return com.xhkjedu.vo.ResultVo
33
+     **/
34
+    @PostMapping("/stfx")
35
+    public ResultVo listQuestionForBjQuestionScoreRate(@RequestBody ExamReportParams params){
36
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getStudentid(),"学生id",1});
37
+        return new ResultVo(0,"获取成功",msrStudentService.listStuSubjectQuestions(params));
38
+    }
39
+
40
+    /*
41
+     * @Description 学生各学科知识点分析
42
+     * @Date 2024/12/30 16:25:27
43
+     * @Author WN
44
+     * @Param [params]
45
+     * @Return com.xhkjedu.vo.ResultVo
46
+     **/
47
+    @PostMapping("/zsdfx")
48
+    public ResultVo listStuPoints(@RequestBody ExamReportParams params){
49
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getStudentid(),"学生id",1});
50
+        return new ResultVo(0,"获取成功",msrStudentService.listStuPoints(params));
51
+    }
52
+}

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

@@ -32,4 +32,6 @@ public interface MsrClassQuestionMapper extends TkMapper<MsrClassQuestion> {
32 32
     List<Map<String, Object>> listQuestionSummaryForObjsub(@Param("param") ExamReportParams param);
33 33
     //学科报告-各班学科试题分析
34 34
     List<MsrClassQuestion> listQuestionForXh(@Param("param") ExamReportParams param);
35
+    //命题质量-命题分析-试题分析指标明细表
36
+    List<Map<String,Object>> listMtzlMtfxQuestions(@Param("param") ExamReportParams param);
35 37
 }

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

@@ -2,6 +2,7 @@ package com.xhkjedu.smarking.mapper.report.reportstu;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportstu.MsrStudent;
5
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
@@ -19,4 +20,6 @@ public interface MsrStudentMapper extends TkMapper<MsrStudent> {
19 20
     void updateBatchObjSubScore(@Param("list") List<MsrStudent> list);
20 21
     //综合报告-小分表-学生分数排名
21 22
     List<Map<String, Object>> listStuScoreAndRankByExamidAndSubjectid(@Param("examid") int examid, @Param("subjectid") String subjectid);
23
+    //学生报告-学生学科试题分析
24
+    List<Map<String, Object>> listStuSubjectQuestions(@Param("params") ExamReportParams params);
22 25
 }

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

@@ -2,6 +2,11 @@ package com.xhkjedu.smarking.mapper.report.reportstu;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportstu.MsrStudentPoint;
5
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
5 10
 
6 11
 /**
7 12
  * @Description 阅卷报告-学生各科知识点分析表 Mapper 接口
@@ -9,4 +14,7 @@ import com.xhkjedu.smarking.model.report.reportstu.MsrStudentPoint;
9 14
  * @Date 2024-12-09
10 15
  */
11 16
 public interface MsrStudentPointMapper extends TkMapper<MsrStudentPoint> {
17
+
18
+    //学生报告-学生学科知识点分析
19
+    List<Map<String, Object>> listStuPoints(@Param("params") ExamReportParams params);
12 20
 }

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

@@ -37,6 +37,8 @@ public class MsPaperQtypeQuestion extends BaseBean {
37 37
     private String qtypename;
38 38
     //题号
39 39
     private String qn;
40
+    //题号拼接大题
41
+    private String qnstr;
40 42
     //试题分值
41 43
     private Double qscore;
42 44
     //试题排序

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportstu/MsrStudentPoint.java View File

@@ -40,5 +40,5 @@ public class MsrStudentPoint extends BaseBean {
40 40
     //知识点对应试题题号
41 41
     private String qns;
42 42
     //知识点对应试题ID
43
-    private String mptqid;
43
+    private String mptqids;
44 44
 }

+ 3
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -207,7 +207,7 @@ public class MsPaperQtypeService {
207 207
                 } else {
208 208
                     q.setQtype(2);
209 209
                 }
210
-
210
+                q.setQnstr(qtype.getMptqn() + "." + q.getQn());
211 211
 
212 212
                 qtqs.add(q);
213 213
             }
@@ -1287,6 +1287,7 @@ public class MsPaperQtypeService {
1287 1287
             } else {
1288 1288
                 que.setQtype(2);
1289 1289
             }
1290
+            que.setQnstr(paperQtype.getMptqn() + "." + que.getQn());
1290 1291
             if(que.getScoreset() == null) que.setScoreset(0);
1291 1292
             if(que.getLoseoption() == null) que.setLoseoption(0.0);
1292 1293
         }
@@ -1307,7 +1308,6 @@ public class MsPaperQtypeService {
1307 1308
             // 更改科目状态
1308 1309
             msSubjectMapper.updatePstateByMpid(mpid, 2);
1309 1310
         }
1310
-
1311 1311
         deletePaperOtherInfo(mpid);
1312 1312
 
1313 1313
         return new ResultVo(0, "保存成功", paper.getMpid());
@@ -1368,6 +1368,7 @@ public class MsPaperQtypeService {
1368 1368
             }
1369 1369
             if(que.getScoreset() == null) que.setScoreset(0);
1370 1370
             if(que.getLoseoption() == null) que.setLoseoption(0.0);
1371
+            que.setQnstr(paperQtype.getMptqn() + "." + que.getQn());
1371 1372
         }
1372 1373
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1373 1374
 

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

@@ -444,7 +444,7 @@ public class ReportGeneratePointService {
444 444
     //层级知识点分析--顶层和上层知识点是知识点本身
445 445
     private void pointTopAndUpForSelf(PointLevelVo firstPoint,Integer pointlevel,Map<String, List<MsrSubjectPoint>> subjectPointMap,
446 446
             Map<String, List<MsrSubjectPointSection>> pointSectionMap,Map<String, List<MsrSubjectPointRankgroup>> pointRankgroupMap,
447
-            List<MsrSubjectPoint> saveSubjectPoints,List<MsrSubjectPointSection> savePointSections, List<MsrSubjectPointRankgroup> savePointRankgroups) throws Exception {
447
+            List<MsrSubjectPoint> saveSubjectPoints,List<MsrSubjectPointSection> savePointSections, List<MsrSubjectPointRankgroup> savePointRankgroups) {
448 448
 
449 449
         //知识点分析
450 450
         List<MsrSubjectPoint> subpoints = subjectPointMap.get(firstPoint.getPointid());
@@ -585,7 +585,7 @@ public class ReportGeneratePointService {
585 585
                 stuPoint.setSchoolavg(schoolAvgScore);
586 586
                 stuPoint.setSchoolrate(schoolScoreRate);
587 587
                 stuPoint.setQns(qnStr.toString());
588
-                stuPoint.setMptqid(mptqidStr);
588
+                stuPoint.setMptqids(mptqidStr);
589 589
                 saveStuPoints.add(stuPoint);
590 590
             }
591 591
         }

+ 186
- 17
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java View File

@@ -10,6 +10,7 @@ import com.xhkjedu.smarking.model.exam.MsClass;
10 10
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
11 11
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
12 12
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
13
+import com.xhkjedu.smarking.utils.MarkingUtil;
13 14
 import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
14 15
 import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
15 16
 import com.xhkjedu.utils.N_Utils;
@@ -208,10 +209,6 @@ public class MsrClassQuestionService {
208 209
 
209 210
             ndList.add(zsndMap);
210 211
         }
211
-        //计算各个难度的试题得分率
212
-        for(Map<String,Object> nd : ndList) {
213
-            List<MsrClassQuestion> ndQuestions = schoolQuestions.stream().filter(m -> m.getNdms().equals(nd.get("ndms"))).collect(Collectors.toList());
214
-        }
215 212
 
216 213
         Map<String,Object> rtnMap = new LinkedHashMap<>();
217 214
         rtnMap.put("qns",qns);
@@ -222,7 +219,7 @@ public class MsrClassQuestionService {
222 219
         return rtnMap;
223 220
     }
224 221
     //学科报告-各班学科试题分析-试题难度和区分度
225
-    public void listQuestionForXhXhstNdAndQfd(ExamReportParams params){
222
+    public Map<String,Object> listQuestionForXhXhstQfd(ExamReportParams params){
226 223
         params.setSelclass(4);
227 224
         //获取选定班级的试题分析
228 225
         List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
@@ -239,21 +236,193 @@ public class MsrClassQuestionService {
239 236
         // 获取后N个元素
240 237
         lastN = goodAndBadQues.stream().skip(goodAndBadQues.size() - n).collect(Collectors.toList());
241 238
 
242
-        
239
+        //统计图按区分度进行排序
240
+        List<MsrClassQuestion> qfdQuestions = questions.stream().sorted(Comparator.comparing(MsrClassQuestion::getQfd).reversed()).collect(Collectors.toList());
241
+        List<Map<String,Object>> qfdList = new ArrayList<>();
242
+        for(MsrClassQuestion qfd : qfdQuestions){
243
+            Map<String,Object> qfdMap = new HashMap<>();
244
+            qfdMap.put("qn",qfd.getQn());
245
+            qfdMap.put("mptqid",qfd.getMptqid());    // 题目ID
246
+            qfdMap.put("qfd",qfd.getQfd());
247
+            qfdMap.put("scorerate",qfd.getScorerate());
248
+            qfdMap.put("scoreratec",qfd.getScoreratec());
249
+            qfdList.add(qfdMap);
250
+        }
243 251
 
244
-        //获取所有题号
245
-        List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
246
-        //把试题按班级分组
247
-        Map<Integer,List<MsrClassQuestion>> classMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
248
-        List<Map<String,Object>> classList = new ArrayList<>();//班级试题
249
-        for(Map.Entry<Integer,List<MsrClassQuestion>> entry : classMap.entrySet()){
250
-            Map<String,Object> clMap = new HashMap<>();
251
-            clMap.put("classid",entry.getKey());
252
-            clMap.put("classname",entry.getValue().get(0).getClassname());
253
-            clMap.put("questions",entry.getValue());
254
-            classList.add(clMap);
252
+        Map<String,Object> rtnMap = new HashMap<>();
253
+        rtnMap.put("firstN",firstN);
254
+        rtnMap.put("lastN",lastN);
255
+        rtnMap.put("qfdList",qfdList);
256
+        return rtnMap;
257
+    }
258
+    //学科报告-各班学科试题分析-试题难度分组表现差异
259
+    public Map<String,Object> listQuestionForXhXhstNdGroup(ExamReportParams params){
260
+        //所有所有试题
261
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
262
+
263
+        //获取考试关联班级
264
+        List<MsClass> classList= msClassMapper.listClassByExamidAndSubjectid(params.getExamid(),params.getSubjectid());
265
+
266
+        //获取所有试题难度分组参数
267
+        MsrReportparam ndParam = msrReportparamMapper.getReportparamByRpbelongSubjectType(params.getExamid(),"quesummary","all",params.getSubjectid(),1);
268
+        List<SzJsonVo> jsonList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
269
+        List<Map<String,Object>> ndList = new ArrayList<>();
270
+        List<String> ndfwList = new ArrayList<>();
271
+        for(SzJsonVo szvo : jsonList){
272
+            Map<String,Object> zsndMap = new HashMap<>();
273
+            zsndMap.put("djkey",szvo.getDjkey());
274
+            ndfwList.add(szvo.getDjkey());
275
+            zsndMap.put("classid",0);
276
+            zsndMap.put("classname","全体");
277
+            //获取该难度下所有试题
278
+            List<MsrClassQuestion> ndQues = questions.stream().filter(m -> m.getNdms().equals(szvo.getDjkey())).collect(Collectors.toList());
279
+            //处理全体班级情况
280
+            List<MsrClassQuestion> schoolQues = ndQues.stream().filter(m -> m.getClassid() == 0).collect(Collectors.toList());
281
+            if(schoolQues.isEmpty()){
282
+                //获取
283
+                zsndMap.put("qnstr", "");
284
+                zsndMap.put("scorerate", 0);
285
+            }else{
286
+                //获取
287
+                List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
288
+                double sumScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
289
+                zsndMap.put("qnstr", String.join(",", qnList));
290
+                zsndMap.put("scorerate", MarkingUtil.div(sumScoreRate,qnList.size()));
291
+            }
292
+            ndList.add(zsndMap);
293
+            //处理各班情况
294
+            for(MsClass cl : classList){
295
+                List<MsrClassQuestion> classQues = ndQues.stream().filter(m -> Objects.equals(m.getClassid(), cl.getClassid())).collect(Collectors.toList());
296
+
297
+                Map<String,Object> classNdMap = new HashMap<>();
298
+                classNdMap.put("djkey",szvo.getDjkey());
299
+                classNdMap.put("classid",cl.getClassid());
300
+                classNdMap.put("classname",cl.getClassname());
301
+                if(classQues.isEmpty()){
302
+                    classNdMap.put("qnstr", "");
303
+                    classNdMap.put("scorerate", 0);
304
+                }else{
305
+                    List<String> classqnList = classQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
306
+                    double classScoreRate = classQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
307
+                    classNdMap.put("qnstr", String.join(",", classqnList));
308
+                    classNdMap.put("scorerate",MarkingUtil.div(classScoreRate, classqnList.size()));
309
+                }
310
+                ndList.add(classNdMap);
311
+            }
312
+        }
313
+        Map<String,Object> rtnMap = new HashMap<>();
314
+        rtnMap.put("ndfwList",ndfwList);
315
+        rtnMap.put("ndList",ndList);
316
+        return rtnMap;
317
+    }
318
+
319
+    //班级报告-全部班级-学科试题得分率对比
320
+    public Map<String,Object> listQuestionForBjQuestionScoreRate(ExamReportParams params){
321
+        //获取考试关联班级
322
+        List<MsClass> classList= msClassMapper.listClassByExamidAndSubjectid(params.getExamid(),params.getSubjectid());
323
+        //所有所有试题
324
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
325
+        //返回所有的班级信息
326
+        List<Map<String,Object>> classListMap = new ArrayList<>();
327
+        Map<String,Object> schoolMap = new HashMap<>();
328
+        schoolMap.put("classid",0);
329
+        schoolMap.put("classname","全体");
330
+        classListMap.add(schoolMap);
331
+
332
+        for(MsClass cl : classList) {
333
+            Map<String,Object> classMap = new HashMap<>();
334
+            classMap.put("classid",cl.getClassid());
335
+            classMap.put("classname",cl.getClassname());
336
+            classListMap.add(classMap);
337
+        }
338
+        //把试题按试题id分组
339
+        Map<Integer,List<MsrClassQuestion>> qnMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getMptqid));
340
+        List<Map<String,Object>> quesList = new ArrayList<>();
341
+        for(Map.Entry<Integer,List<MsrClassQuestion>> entry : qnMap.entrySet()) {
342
+            List<MsrClassQuestion> entryList = entry.getValue();
343
+            Map<String,Object> queMap = new HashMap<>();
344
+            queMap.put("qn",entryList.get(0).getQn());
345
+            List<Map<String,Object>> classQueList = new ArrayList<>();
346
+            for(Map<String,Object> cmap : classListMap){
347
+                int classid = (int)cmap.get("classid");
348
+                Map<String,Object> classMap = new HashMap<>();
349
+                classMap.put("classid",classid);
350
+                MsrClassQuestion classQues = entryList.stream().filter(m -> m.getClassid() == classid).findFirst().orElse(null);
351
+                if(classQues!= null){
352
+                    classMap.put("scorerate",classQues.getScorerate());
353
+                }else{
354
+                    classMap.put("scorerate",0);
355
+                }
356
+                classQueList.add(classMap);
357
+            }
358
+            queMap.put("questions",classQueList);
359
+            quesList.add(queMap);
360
+        }
361
+
362
+        Map<String,Object> rtnMap = new HashMap<>();
363
+        rtnMap.put("questions",quesList);
364
+        rtnMap.put("classList",classListMap);
365
+        return rtnMap;
366
+    }
367
+    //班级报告-单个班级-学科试题考试内在表现
368
+    public Map<String,Object> listQuestionForBjStks(ExamReportParams params){
369
+
370
+        //类似学科报告,获取数据
371
+        Map<String,Object> rtnMap = listQuestionForXhXhstQfd(params);
372
+
373
+        //所有选择的班级和年级的试题情况
374
+        params.setSelclass(3);
375
+        Integer classid = params.getClassid();
376
+        params.setClassids("0," + params.getClassid());
377
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
378
+
379
+        //获取所有试题难度分组参数
380
+        MsrReportparam ndParam = msrReportparamMapper.getReportparamByRpbelongSubjectType(params.getExamid(),"quesummary","all",params.getSubjectid(),1);
381
+        List<SzJsonVo> jsonList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
382
+        List<Map<String,Object>> ndList = new ArrayList<>();
383
+        for(SzJsonVo szvo : jsonList){
384
+            Map<String,Object> zsndMap = new HashMap<>();
385
+            zsndMap.put("djkey",szvo.getDjkey());
386
+            //获取该难度下所有试题
387
+            List<MsrClassQuestion> ndQues = questions.stream().filter(m -> m.getNdms().equals(szvo.getDjkey())).collect(Collectors.toList());
388
+            //处理全体班级情况
389
+            List<MsrClassQuestion> schoolQues = ndQues.stream().filter(m -> m.getClassid() == 0).collect(Collectors.toList());
390
+            if(schoolQues.isEmpty()){
391
+                zsndMap.put("schoolscorerate", 0);
392
+            }else{
393
+                //获取年级的
394
+                List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
395
+                double sumScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
396
+                zsndMap.put("schoolscorerate", MarkingUtil.div(sumScoreRate,qnList.size()));
397
+            }
398
+
399
+            //获取班级的情况
400
+            List<MsrClassQuestion> classQues = ndQues.stream().filter(m -> m.getClassid().equals(classid)).collect(Collectors.toList());
401
+            if(classQues.isEmpty()){
402
+                zsndMap.put("classscorerate", 0);
403
+            }else{
404
+                List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
405
+                double classScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
406
+                zsndMap.put("classscorerate",MarkingUtil.div(classScoreRate,qnList.size()));
407
+            }
408
+
409
+            ndList.add(zsndMap);
255 410
         }
411
+        rtnMap.put("ndList",ndList);
412
+        return rtnMap;
413
+    }
414
+
415
+    //命题质量报告-命题分析-试题分析指标明细表
416
+    public List<Map<String,Object>> listMtzlStfxQuestions(ExamReportParams params){
417
+        return  msrClassQuestionMapper.listMtzlMtfxQuestions(params);
256 418
     }
257 419
 
420
+    //命题质量报告-命题分析-试题难度分布结构表
421
+    public void listMtzlStnds(ExamReportParams params){
422
+        //获取本学科整体难度
423
+        params.setSelclass(4);
424
+        params.setClassid(0);
425
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
426
+    }
258 427
 
259 428
 }

+ 16
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java View File

@@ -1,6 +1,8 @@
1 1
 package com.xhkjedu.smarking.service.report.report;
2 2
 
3 3
 import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentPointMapper;
5
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
4 6
 import org.springframework.stereotype.Service;
5 7
 
6 8
 import javax.annotation.Resource;
@@ -16,9 +18,23 @@ import java.util.Map;
16 18
 public class MsrStudentService {
17 19
     @Resource
18 20
     private MsrStudentMapper msrStudentMapper;
21
+    @Resource
22
+    private MsrStudentPointMapper msrStudentPointMapper;
19 23
 
20 24
     //综合报告-小分表-列表
21 25
     public List<Map<String,Object>> listStuScoreAndRank(Integer examid, String subjectid){
22 26
         return msrStudentMapper.listStuScoreAndRankByExamidAndSubjectid(examid,subjectid);
23 27
     }
28
+
29
+    //学生报告-学生各学科试题分析
30
+    public List<Map<String,Object>> listStuSubjectQuestions(ExamReportParams params){
31
+        return msrStudentMapper.listStuSubjectQuestions(params);
32
+    }
33
+
34
+    //学生报告-学生各学科知识点分析
35
+    public List<Map<String,Object>> listStuPoints(ExamReportParams params){
36
+        return msrStudentPointMapper.listStuPoints(params);
37
+    }
38
+
39
+
24 40
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ExamReportParams.java View File

@@ -19,4 +19,6 @@ public class ExamReportParams {
19 19
     private Integer classid;//班级ID
20 20
 
21 21
     private String classids;//多个班级id
22
+
23
+    private Integer studentid;//学生ID
22 24
 }

+ 3
- 2
smarking/src/main/resources/mapper/paper/MsPaperQtypeMapper.xml View File

@@ -143,6 +143,7 @@
143 143
             <result column="qorder" property="qorder" />
144 144
             <result column="ctype" property="ctype" />
145 145
             <result column="qn" property="qn" />
146
+            <result column="qnstr" property="qnstr" />
146 147
             <result column="qanswer" property="qanswer" />
147 148
             <result column="optionnum" property="optionnum" />
148 149
             <result column="loseoption" property="loseoption" />
@@ -152,7 +153,7 @@
152 153
     </resultMap>
153 154
     <select id="listSubjectiveQuestionsFj" resultMap="subjectiveQuestions">
154 155
         select t.mptid,t.mptqn,t.mptname,t.mptnum,t.mptorder,t.mptscore,
155
-        q.mptqid,q.qtypeid,q.qtypename,q.ctype,q.qscore,q.qn,q.qorder,q.qanswer,q.optionnum,q.loseoption,q.scoreset
156
+        q.mptqid,q.qtypeid,q.qtypename,q.ctype,q.qscore,q.qn,q.qnstr,q.qorder,q.qanswer,q.optionnum,q.loseoption,q.scoreset
156 157
         from ms_paper_qtype_question q left join ms_paper_qtype t on t.mptid=q.mptid
157 158
         where t.mpid=#{mpid}
158 159
         <if test="qtype!=null and qtype!=0"> and q.qtype=#{qtype}</if>
@@ -161,7 +162,7 @@
161 162
 
162 163
     <select id="listSubjectiveQuestionsTk" resultMap="subjectiveQuestions">
163 164
         select t.mptid,t.mptqn,t.mptname,t.mptnum,t.mptorder,t.mptscore,q.mptqid,
164
-        q.ctype,q.qscore,q.qn,q.qorder,q.qanswer,q.optionnum,q.loseoption,q.scoreset,q2.sorder
165
+        q.ctype,q.qscore,q.qn,qnstr,q.qorder,q.qanswer,q.optionnum,q.loseoption,q.scoreset,q2.sorder
165 166
         from ms_paper_qtype_question q left join ms_paper_qtype t on t.mptid=q.mptid
166 167
         left join t_question q2 on q.questionid=q2.questionid
167 168
         where t.mpid=#{mpid}

+ 3
- 2
smarking/src/main/resources/mapper/paper/MsTemplateBlockMapper.xml View File

@@ -66,8 +66,9 @@
66 66
     <select id="listBlockTemplates" resultMap="blockTemplate">
67 67
         select DISTINCT b.mblockid,b.blockname,b.blockorder,b.bqnum,b.bqscore,
68 68
                         tb.localcoor,tb.pagenum,tb.extendcoor,tb.scorecoor,bq.mbqid,bq.bqn
69
-        from ms_paper_block b inner join ms_template_block tb on b.mblockid=tb.mblockid
69
+        from ms_paper_block b left join ms_template_block tb on b.mblockid=tb.mblockid
70
+        left join ms_template t on b.mpid=t.mpid
70 71
         left join ms_paper_block_question bq on b.mblockid=bq.mblockid
71
-        where b.mpid=#{mpid} and tb.mtid=#{mtid} and b.blocktype=2 order by b.blockorder,bq.bqorder
72
+        where b.mpid=#{mpid} and b.blocktype=2 and t.mtid=#{mtid} order by b.blockorder,bq.bqorder
72 73
     </select>
73 74
 </mapper>

+ 1
- 1
smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml View File

@@ -4,7 +4,7 @@
4 4
 
5 5
     <!--根据msid查询试卷模板列表-->
6 6
     <select id="listTemplatesByMpid" resultType="java.util.Map">
7
-        select t.mtid,t.mpid,t.currstep,t.tstate,t.createtime from ms_template t
7
+        select t.mtid,t.mpid,t.currstep,t.tstate,t.createtime,t.tfront,t.tback from ms_template t
8 8
         left join ms_paper p on t.mpid=p.mpid
9 9
         where p.mpid=#{mpid} order by t.createtime desc
10 10
     </select>

+ 9
- 1
smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml View File

@@ -93,7 +93,7 @@
93 93
     <!--学科报告-各班学科试题分析-->
94 94
     <select id="listQuestionForXh" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion">
95 95
         select q.mptqid,q.classid,q.qn,q.qtype,
96
-        q.classavgrate,q.schoolavgrate,q.scorerate,q.scoreratec,q.nd,q.ndms,q.qfd,q.qfdms,c.classname
96
+        q.classavgrate,q.schoolavgrate,q.scorerate,q.scoreratec,q.nd,q.ndms,q.ndfw,q.qfd,q.qfdms,c.classname
97 97
         from msr_class_question q left join ms_class c on q.examid=c.examid
98 98
         and q.subjectid=c.subjectid and q.classid=c.classid
99 99
         where q.examid=#{param.examid} and q.subjectid=#{param.subjectid}
@@ -105,5 +105,13 @@
105 105
         order by q.mptqid
106 106
     </select>
107 107
 
108
+    <!--命题质量-命题分析-试题分析指标明细表-->
109
+    <select id="listMtzlMtfxQuestions" resultType="java.util.Map">
110
+        select cq.cqid,cq.mptqid,cq.qn,cq.qorder,cq.qtype,cq.fullscore,cq.stunum,cq.schoolmaxscore,
111
+        cq.schoolminscore,cq.schoolavgscore,cq.nd,cq.bzc,cq.cyxs,cq.qfd,cq.jbzs,cq.lfnum,
112
+        cq.lfrate,cq.mfnum,cq.mfrate from msr_class_question cq where cq.examid=#{param.examid}
113
+        and cq.subjectid=#{param.subjectid} and cq.classid=0 order by cqid
114
+    </select>
115
+
108 116
 
109 117
 </mapper>

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

@@ -53,4 +53,15 @@
53 53
         where s.examid=#{examid} and s.subjectid=#{subjectid}
54 54
         order by s.schoolrank,s.rsid,qt.mptorder,q.qorder
55 55
     </select>
56
+
57
+    <!--学生报告-学生学科试题分析-->
58
+    <select id="listStuSubjectQuestions" resultType="java.util.Map">
59
+        select distinct q.mpsqid,q.mptqid,q.qn,q.qscore,q.stuscore,q.ctype,q.stuanswer,
60
+        cq.schoolavgscore,cq.scorerate
61
+        from ms_paper_student_question q
62
+        left join msr_class_question cq on q.examid=cq.examid and q.subjectid=cq.subjectid
63
+            and q.mptqid=cq.mptqid and cq.classid=0
64
+        where q.examid=#{params.examid} and q.subjectid=#{params.subjectid} and q.studentid=#{params.studentid}
65
+        order by q.mptqid
66
+    </select>
56 67
 </mapper>

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

@@ -1,4 +1,11 @@
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.reportstu.MsrStudentPointMapper">
4
+
5
+    <!--学生报告-学生学科知识点分析-->
6
+    <select id="listStuPoints" resultType="java.util.Map">
7
+        select pointid,pointname,fullscore,stuscore,sturate,schoolavg,schoolrate,qns,mptqids
8
+        from msr_student_point where examid=#{params.examid} and subjectid=#{params.subjectid} and studentid=#{params.studentid} order by spid
9
+    </select>
10
+
4 11
 </mapper>

Loading…
Cancel
Save