Browse Source

试题设置难度/区分度参数,扫描添加字段处理

ywx
王宁 3 weeks ago
parent
commit
83a9181ddc
19 changed files with 211 additions and 178 deletions
  1. 6
    0
      smarking/pom.xml
  2. 9
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassQuestionMapper.java
  3. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java
  4. 5
    1
      smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchMapper.java
  5. 3
    3
      smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaper.java
  6. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatch.java
  7. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsExamService.java
  8. 17
    15
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java
  9. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperService.java
  10. 24
    143
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGeneratePointService.java
  11. 71
    5
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java
  12. 15
    2
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java
  13. 3
    1
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchService.java
  14. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ReportParams.java
  15. 1
    1
      smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml
  16. 4
    4
      smarking/src/main/resources/mapper/paper/MsPaperMapper.xml
  17. 18
    0
      smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml
  18. 6
    0
      smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml
  19. 15
    1
      smarking/src/main/resources/mapper/scan/MsScanbatchMapper.xml

+ 6
- 0
smarking/pom.xml View File

@@ -32,6 +32,12 @@
32 32
             <version>3.17</version>
33 33
         </dependency>
34 34
 
35
+        <dependency>
36
+            <groupId>commons-beanutils</groupId>
37
+            <artifactId>commons-beanutils</artifactId>
38
+            <version>1.9.4</version>
39
+        </dependency>
40
+
35 41
     </dependencies>
36 42
     <dependencyManagement>
37 43
         <dependencies>

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

@@ -4,6 +4,8 @@ import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
+import java.util.List;
8
+
7 9
 /**
8 10
  * @Description 阅卷报告-班级试题小题分析表 Mapper 接口
9 11
  * @Author auto
@@ -12,4 +14,11 @@ import org.apache.ibatis.annotations.Param;
12 14
 public interface MsrClassQuestionMapper extends TkMapper<MsrClassQuestion> {
13 15
 
14 16
     void deleteReportByExamid(@Param("examid") Integer examid);
17
+
18
+    //获取考试难度和区别度数据
19
+    List<MsrClassQuestion> listQuestionClassForNdByExamid(@Param("examid") Integer examid);
20
+    //修改难度
21
+    void updateBatchNdById(@Param("list") List<MsrClassQuestion> list);
22
+    //修改区分度
23
+    void updateBatchQfdById(@Param("list") List<MsrClassQuestion> list);
15 24
 }

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

@@ -18,4 +18,7 @@ public interface MsrReportparamMapper extends TkMapper<MsrReportparam> {
18 18
 
19 19
     //批量删除
20 20
     int deleteBatchReportparam(@Param("list") List<Integer> list);
21
+
22
+    //删除考试对应类型参数
23
+    int deleteByExamidAndRpbelong(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("rptype") Integer rptype);
21 24
 }

+ 5
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchMapper.java View File

@@ -39,9 +39,13 @@ public interface MsScanbatchMapper extends TkMapper<MsScanbatch> {
39 39
 
40 40
     //修改扫描数量
41 41
     int updateScannum(@Param("batchid")Integer batchid);
42
-
42
+    int updateScannumAndErrornum(@Param("batchid")Integer batchid);
43 43
     //修改识别数量
44 44
     int updateIdentifynum(@Param("batchid")Integer batchid);
45
+    //修改缺考数量
46
+    int updateQknum(@Param("batchid")Integer batchid);
47
+    //修改违规数量
48
+    int updateWgnum(@Param("batchid")Integer batchid);
45 49
 
46 50
     //根据试卷ID获取考试状态和ID
47 51
     MsExam getExamStateAndId(@Param("mpid")Integer mpid);

+ 3
- 3
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaper.java View File

@@ -37,14 +37,14 @@ public class MsPaper extends BaseBean {
37 37
     private Integer answered;
38 38
     //批阅设置:1按班设置2按题设置3按题块设置
39 39
     private Integer correcttype;
40
-    //是否有附件0没有1有附件
40
+    //是否有听力文件0没有1有
41 41
     private Integer hasfile;
42 42
     //听力允许播放次数0不限制
43 43
     private Integer hearnum;
44 44
     //听力题文件地址(附件试卷)
45 45
     private String hearfile;
46
-    //原卷切割状态0未切割1已切割
47
-    private Integer cutstate;
46
+    //原卷状态0未上传1已上传2已切割
47
+    private Integer yjstate;
48 48
     //创建人ID
49 49
     private Integer createid;
50 50
     //创建时间

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatch.java View File

@@ -30,6 +30,12 @@ public class MsScanbatch extends BaseBean {
30 30
     private Integer uploadnum;
31 31
     //识别数量
32 32
     private Integer identifynum;
33
+    //扫描出错数量
34
+    private Integer errornum;
35
+    //缺考数量
36
+    private Integer qknum;
37
+    //违规数量
38
+    private Integer wgnum;
33 39
     //创建人ID
34 40
     private Integer createid;
35 41
     //创建时间

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsExamService.java View File

@@ -107,7 +107,7 @@ public class MsExamService {
107 107
             p.setHasfile(0);
108 108
             p.setHearnum(0);
109 109
             p.setCorrecttype(0);
110
-            p.setCutstate(0);
110
+            p.setYjstate(0);
111 111
             papers.add(p);
112 112
         }
113 113
         msSubjectMapper.insertList(subjects);//考试科目

+ 17
- 15
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -107,7 +107,7 @@ public class MsPaperQtypeService {
107 107
             savePaperAnalyzeForQuestion(paper);
108 108
         } else {
109 109
             List<MsPaperFile> pfiles = paper.getPfiles();// 附件
110
-            if (paper.getHasfile() == 1) {
110
+            if (paper.getYjstate() == 1) {
111 111
                 setPaperFiles(paper, pfiles, imgs);
112 112
                 msPaperFileMapper.insertList(pfiles);
113 113
             }
@@ -144,12 +144,12 @@ public class MsPaperQtypeService {
144 144
             // 获取附件为1题干的数量
145 145
             List<MsPaperFile> pfiles = paper.getPfiles().stream().filter(p -> p.getFiletype() == 1).collect(Collectors.toList());
146 146
             if (N_Utils.isListNotEmpty(pfiles)) {
147
-                paper.setHasfile(1);
147
+                paper.setYjstate(1);
148 148
             } else {
149
-                paper.setHasfile(0);
149
+                paper.setYjstate(0);
150 150
             }
151 151
         } else {
152
-            paper.setHasfile(0);
152
+            paper.setYjstate(0);
153 153
         }
154 154
         double pscore = qtypelist.stream().mapToDouble(MsPaperQtype::getMptscore).sum();
155 155
         int pnum = qtypelist.stream().mapToInt(MsPaperQtype::getMptnum).sum();
@@ -163,6 +163,10 @@ public class MsPaperQtypeService {
163 163
             paper.setAnswered(0);
164 164
         }
165 165
 
166
+        if(N_Utils.isNotEmpty(paper.getHearfile())){
167
+            paper.setHasfile(1);//说明有听力文件
168
+        }
169
+
166 170
         if (paper.getHearnum() == null) {
167 171
             paper.setHearnum(0);
168 172
         }
@@ -667,17 +671,15 @@ public class MsPaperQtypeService {
667 671
 
668 672
     // 设置附件
669 673
     private void setPaperFiles(MsPaper paper, List<MsPaperFile> pfiles, List<String> imgs) {
670
-        if (paper.getHasfile() == 1) {
671
-            int order = 1;
672
-            for (MsPaperFile pf : pfiles) {
673
-                pf.setCreateid(paper.getCreateid());
674
-                pf.setCreatetime(paper.getHandletime());
675
-                pf.setMpid(paper.getMpid());
676
-                pf.setFileorder(order++);
677
-
678
-                if (isImgFormatForsourcepath(pf.getSourcepath()) && !imgs.contains(pf.getSourcepath()) && pf.getFiletype() == 1) {
679
-                    imgs.add(pf.getSourcepath());
680
-                }
674
+        int order = 1;
675
+        for (MsPaperFile pf : pfiles) {
676
+            pf.setCreateid(paper.getCreateid());
677
+            pf.setCreatetime(paper.getHandletime());
678
+            pf.setMpid(paper.getMpid());
679
+            pf.setFileorder(order++);
680
+
681
+            if (isImgFormatForsourcepath(pf.getSourcepath()) && !imgs.contains(pf.getSourcepath()) && pf.getFiletype() == 1) {
682
+                imgs.add(pf.getSourcepath());
681 683
             }
682 684
         }
683 685
     }

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperService.java View File

@@ -154,7 +154,7 @@ public class MsPaperService {
154 154
                 pf.setFilepath(paperFileVo.getImgs().get(i));
155 155
             }
156 156
         }
157
-        paper.setHasfile(1);
157
+        paper.setYjstate(1);
158 158
         msPaperMapper.updateByPrimaryKeySelective(paper);
159 159
         msPaperFileMapper.insertList(pfiles);
160 160
     }

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

@@ -24,6 +24,7 @@ import com.xhkjedu.smarking.vo.report.reportsubject.PointLevelVo;
24 24
 import com.xhkjedu.smarking.vo.report.reportsubject.PointParams;
25 25
 import com.xhkjedu.smarking.vo.report.reportsubject.PointVo;
26 26
 import com.xhkjedu.utils.N_Utils;
27
+import org.apache.commons.beanutils.BeanUtils;
27 28
 import org.springframework.stereotype.Service;
28 29
 
29 30
 import javax.annotation.Resource;
@@ -51,7 +52,7 @@ public class ReportGeneratePointService {
51 52
 
52 53
     //知识点分析,题库知识点按母题分析
53 54
     public void generatePoint(List<MsPaperStudentQuestion> stuSubjectQuestions, List<MsPaperQtypeQuestion> qtypeQuestions,List<MsClassStudent> classStus,
54
-                            List<MsrStudent> sturanks, Integer examid, String subjectid, Integer mpid, Double pscore) {
55
+                            List<MsrStudent> sturanks, Integer examid, String subjectid, Integer mpid, Double pscore) throws Exception {
55 56
         //获取试卷分析
56 57
         MsPaperAnalyze paperAnalyze = msPaperAnalyzeMapper.getObjByMpId(mpid);
57 58
         if(paperAnalyze == null || N_Utils.isEmpty(paperAnalyze.getPointjson())) return;
@@ -444,33 +445,42 @@ public class ReportGeneratePointService {
444 445
     //层级知识点分析--顶层和上层知识点是知识点本身
445 446
     private void pointTopAndUpForSelf(PointLevelVo firstPoint,Integer pointlevel,Map<String, List<MsrSubjectPoint>> subjectPointMap,
446 447
             Map<String, List<MsrSubjectPointSection>> pointSectionMap,Map<String, List<MsrSubjectPointRankgroup>> pointRankgroupMap,
447
-            List<MsrSubjectPoint> saveSubjectPoints,List<MsrSubjectPointSection> savePointSections, List<MsrSubjectPointRankgroup> savePointRankgroups){
448
+            List<MsrSubjectPoint> saveSubjectPoints,List<MsrSubjectPointSection> savePointSections, List<MsrSubjectPointRankgroup> savePointRankgroups) throws Exception {
448 449
 
449 450
         //知识点分析
450 451
         List<MsrSubjectPoint> subpoints = subjectPointMap.get(firstPoint.getPointid());
451 452
         for(MsrSubjectPoint subpoint : subpoints){
452
-            subpoint.setPointid(firstPoint.getTopPointid());
453
-            subpoint.setPointname(firstPoint.getPointname());
454
-            subpoint.setPointlevel(pointlevel);
455
-            saveSubjectPoints.add(subpoint);
453
+
454
+            MsrSubjectPoint subpointvo = new MsrSubjectPoint();
455
+            BeanUtils.copyProperties(subpointvo, subpoint);
456
+            subpointvo.setPointid(firstPoint.getTopPointid());
457
+            subpointvo.setPointname(firstPoint.getPointname());
458
+            subpointvo.setPointlevel(pointlevel);
459
+            subpointvo.setFullscore(subpoint.getFullscore());
460
+
461
+            saveSubjectPoints.add(subpointvo);
456 462
         }
457 463
 
458 464
         //分数分段
459 465
         List<MsrSubjectPointSection> sepoints = pointSectionMap.get(firstPoint.getPointid());
460 466
         for(MsrSubjectPointSection sepoint : sepoints) {
461
-            sepoint.setPointid(firstPoint.getTopPointid());
462
-            sepoint.setPointname(firstPoint.getPointname());
463
-            sepoint.setPointlevel(pointlevel);
464
-            savePointSections.add(sepoint);
467
+            MsrSubjectPointSection sepointvo = new MsrSubjectPointSection();
468
+            BeanUtils.copyProperties(sepointvo, sepoint);
469
+            sepointvo.setPointid(firstPoint.getTopPointid());
470
+            sepointvo.setPointname(firstPoint.getPointname());
471
+            sepointvo.setPointlevel(pointlevel);
472
+            savePointSections.add(sepointvo);
465 473
         }
466 474
 
467 475
         //分组分析
468 476
         List<MsrSubjectPointRankgroup> rgpoints = pointRankgroupMap.get(firstPoint.getPointid());
469 477
         for(MsrSubjectPointRankgroup rgpoint : rgpoints) {
470
-            rgpoint.setPointid(firstPoint.getTopPointid());
471
-            rgpoint.setPointname(firstPoint.getPointname());
472
-            rgpoint.setPointlevel(pointlevel);
473
-            savePointRankgroups.add(rgpoint);
478
+            MsrSubjectPointRankgroup rgpointvo = new MsrSubjectPointRankgroup();
479
+            BeanUtils.copyProperties(rgpointvo, rgpoint);
480
+            rgpointvo.setPointid(firstPoint.getTopPointid());
481
+            rgpointvo.setPointname(firstPoint.getPointname());
482
+            rgpointvo.setPointlevel(pointlevel);
483
+            savePointRankgroups.add(rgpointvo);
474 484
         }
475 485
     }
476 486
     //层级知识点分析--顶层和上层知识点下多知识点分析
@@ -580,134 +590,5 @@ public class ReportGeneratePointService {
580 590
                 saveStuPoints.add(stuPoint);
581 591
             }
582 592
         }
583
-
584
-    }
585
-    //处理顶级、上级知识点---已不用
586
-    private void handlePointLevel(Map<String,List<PointLevelVo>> pointMap,List<PointQuestionVo> pointques,List<PointStudentVo> schoolStuPoints,Integer pointlevel,List<MsrSubjectPointSection> pointSections,
587
-                                    List<MsPaperQtypeQuestion> qtypeQuestions,List<MsClassStudent> classStus,Integer examid,String subjectid,List<MsrStudent> sturanks,
588
-                                    List<MsrSubjectPoint> saveSubjectPoints,List<MsrSubjectPointSection> savePointSections,List<MsrSubjectPointRankgroup> savePointRankgroups){
589
-
590
-        //科目班级知识点情况
591
-        Map<String, List<MsrSubjectPoint>> subjectPointMap = saveSubjectPoints.stream().filter(p -> p.getPointlevel()==3).collect(Collectors.groupingBy(MsrSubjectPoint::getPointid));
592
-        //知识点学科总分区间
593
-        Map<String, List<MsrSubjectPointSection>> pointSectionMap = savePointSections.stream().filter(p -> p.getPointlevel()==3).collect(Collectors.groupingBy(MsrSubjectPointSection::getPointid));
594
-        //知识点分组
595
-        Map<String, List<MsrSubjectPointRankgroup>> pointRankgroupMap = savePointRankgroups.stream().filter(p -> p.getPointlevel()==3).collect(Collectors.groupingBy(MsrSubjectPointRankgroup::getPointid));
596
-
597
-        //处理上层知识点
598
-        for(Map.Entry<String,List<PointLevelVo>> entry : pointMap.entrySet()){
599
-            List<PointLevelVo> pointLevels = entry.getValue();
600
-            PointLevelVo firstPoint = pointLevels.get(0);
601
-            if(pointLevels.size() ==1){
602
-                //说明知识的上层知识点是知识点本身或者仅有一个知识点,则上层知识点分析和他本身的分析一致
603
-                //科目知识点
604
-                List<MsrSubjectPoint> subpoints = subjectPointMap.get(firstPoint.getPointid());
605
-                for(MsrSubjectPoint subpoint : subpoints){
606
-                    subpoint.setPointid(firstPoint.getTopPointid());
607
-                    subpoint.setPointname(firstPoint.getPointname());
608
-                    subpoint.setPointlevel(pointlevel);
609
-                    saveSubjectPoints.add(subpoint);
610
-                }
611
-
612
-                //分数分段
613
-                List<MsrSubjectPointSection> sepoints = pointSectionMap.get(firstPoint.getPointid());
614
-                for(MsrSubjectPointSection sepoint : sepoints) {
615
-                    sepoint.setPointid(firstPoint.getTopPointid());
616
-                    sepoint.setPointname(firstPoint.getPointname());
617
-                    sepoint.setPointlevel(pointlevel);
618
-                    savePointSections.add(sepoint);
619
-                }
620
-
621
-                //分组分析
622
-                List<MsrSubjectPointRankgroup> rgpoints = pointRankgroupMap.get(firstPoint.getPointid());
623
-                for(MsrSubjectPointRankgroup rgpoint : rgpoints) {
624
-                    rgpoint.setPointid(firstPoint.getTopPointid());
625
-                    rgpoint.setPointname(firstPoint.getPointname());
626
-                    rgpoint.setPointlevel(pointlevel);
627
-                    savePointRankgroups.add(rgpoint);
628
-                }
629
-            }else{
630
-                //上层知识点所包含的知识点id集合
631
-                List<String> pointids = pointLevels.stream().map(PointLevelVo::getPointid).collect(Collectors.toList());
632
-                //知识点下试题,以及学生得分
633
-                List<PointQuestionVo> levelPointQues = pointques.stream().filter(q -> pointids.contains(q.getPointid())).collect(Collectors.toList());
634
-                List<PointStudentVo> levelStuPoints = schoolStuPoints.stream().filter(q -> pointids.contains(q.getPointid())).collect(Collectors.toList());
635
-                List<QuestionPointVo> ques = new ArrayList<>();//知识点下所有试题
636
-                for(PointQuestionVo point : levelPointQues) {
637
-                    ques.addAll(point.getQues());
638
-                }
639
-
640
-                List<Integer> mptqids = ques.stream().map(QuestionPointVo::getMptqid).distinct().collect(Collectors.toList());
641
-                //获取试题对应的qn
642
-                List<MsPaperQtypeQuestion> qtypeQues =  qtypeQuestions.stream().filter(q -> mptqids.contains(q.getMptqid())).collect(Collectors.toList());
643
-                String qnStr = qtypeQues.stream().map(q -> q.getMptqn()  + "." + q.getQn()).collect(Collectors.joining(","));
644
-                String mptqidStr = mptqids.stream().map(Object::toString).collect(Collectors.joining(","));
645
-                double pointscore = levelPointQues.stream().mapToDouble(PointQuestionVo::getScore).sum();
646
-                pointscore = N_Utils.formatDouble(pointscore, 1);
647
-                //知识点多个试题,处理成单个学生试题总分值
648
-                List<PointStudentVo> pointStuScores = new ArrayList<>();//处理成学生知识点形式,后续计算使用
649
-                Map<Integer, List<PointStudentVo>> pointStuMap = levelStuPoints.stream().collect(Collectors.groupingBy(PointStudentVo::getStudentid));
650
-                for (Map.Entry<Integer, List<PointStudentVo>> psentry : pointStuMap.entrySet()){
651
-                    List<PointStudentVo> pstuScores = psentry.getValue();
652
-                    double stuScore = pstuScores.stream().mapToDouble(PointStudentVo::getStuscore).sum();
653
-                    stuScore = N_Utils.formatDouble(stuScore, 1);
654
-                    PointStudentVo pstuvo = new PointStudentVo();
655
-                    pstuvo.setStudentid(psentry.getKey());
656
-                    pstuvo.setPointid(entry.getKey());
657
-                    pstuvo.setStuscore(stuScore);
658
-                    pstuvo.setScore(pointscore);
659
-                    pointStuScores.add(pstuvo);
660
-                }
661
-
662
-                MsrSubjectPoint subjectPoint = new MsrSubjectPoint();
663
-                subjectPoint.setExamid(examid);
664
-                subjectPoint.setSubjectid(subjectid);
665
-                subjectPoint.setPointid(firstPoint.getTopPointid());
666
-                subjectPoint.setClassid(0);
667
-                subjectPoint.setPointname(firstPoint.getTopPointid());
668
-                subjectPoint.setFullscore(pointscore);
669
-                subjectPoint.setPointlevel(pointlevel);
670
-                subjectPoint.setMptqids(mptqidStr);
671
-                subjectPoint.setQns(qnStr);
672
-
673
-                //校知识点分析
674
-                MsrSubjectPoint schoolPoint = pointLevelClass(pointStuScores, subjectPoint);
675
-                saveSubjectPoints.add(schoolPoint);
676
-
677
-                //班级知识点分析
678
-                List<Integer> classIds = classStus.stream().map(MsClassStudent::getClassid).distinct().collect(Collectors.toList());
679
-                List<MsrSubjectPoint> classPoints = new ArrayList<>();
680
-                for (Integer classid : classIds) {
681
-                    // 获取班级下学生id
682
-                    List<Integer> classStuIds = classStus.stream().filter(c -> c.getClassid().equals(classid)).map(MsClassStudent::getStudentid).collect(Collectors.toList());
683
-                    // 获取班级下学生试题
684
-                    List<PointStudentVo> classStuPoints = pointStuScores.stream().filter(q -> classStuIds.contains(q.getStudentid())).collect(Collectors.toList());
685
-                    subjectPoint.setClassid(classid);
686
-                    MsrSubjectPoint classPoint = pointLevelClass(classStuPoints, subjectPoint);
687
-                    classPoints.add(classPoint);
688
-                }
689
-
690
-                // 班级知识点保存后,要对平均分排序
691
-                List<Double> avgScores = classPoints.stream().map(MsrSubjectPoint::getAvgscore).collect(Collectors.toList());
692
-                Map<Double,Integer> avgScoreRankMap = MarkingUtil.fspm(avgScores);
693
-                for(MsrSubjectPoint sp : classPoints){
694
-                    sp.setAvgrank(avgScoreRankMap.get(sp.getAvgscore()));
695
-                }
696
-                saveSubjectPoints.addAll(classPoints);
697
-
698
-                PointQuestionVo pqvo = new PointQuestionVo();
699
-                pqvo.setPointid(firstPoint.getTopPointid());
700
-                pqvo.setPointname(firstPoint.getPointname());
701
-                pqvo.setScore(pointscore);
702
-
703
-                //知识点结构与总分的相关性(三级知识点)
704
-                // List<MsrSubjectPointSection> pointSecs = pointSection(pointStuScores, pointSections, PointParams);
705
-                // savePointSections.addAll(pointSecs);
706
-
707
-                //知识点考生分组分析
708
-                List<MsrSubjectPointRankgroup> pointRankg = pointRankGroup(pointStuScores,sturanks, pqvo, examid, subjectid, pointlevel);
709
-                savePointRankgroups.addAll(pointRankg);
710
-            }
711
-        }
712 593
     }
713 594
 }

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

@@ -27,6 +27,7 @@ import com.xhkjedu.smarking.model.report.reportsubject.MsrSubjectQuestionSection
27 27
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
28 28
 import com.xhkjedu.smarking.utils.MarkingUtil;
29 29
 import com.xhkjedu.smarking.vo.report.reportother.RankGroupVo;
30
+import com.xhkjedu.smarking.vo.report.reportother.ReportParams;
30 31
 import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
31 32
 import com.xhkjedu.smarking.vo.report.reportsubject.SectionScoreVo;
32 33
 import com.xhkjedu.utils.N_Utils;
@@ -72,7 +73,7 @@ public class ReportGenerateQuestionService {
72 73
     private ReportGeneratePointService reportGeneratePointService;
73 74
 
74 75
     @Transactional(rollbackFor = Exception.class)
75
-    public void generateQuestion(Integer examid, Integer exammode) {
76
+    public void generateQuestion(Integer examid, Integer exammode) throws Exception {
76 77
         // 查询所有学生试题
77 78
         List<MsPaperStudentQuestion> stuQuestions = msPaperStudentQuestionMapper.listAllStuQuesByExamid(examid);
78 79
         List<MsClassStudent> classStudents = msClassStudentMapper.listStudentByExamId(examid);
@@ -107,7 +108,7 @@ public class ReportGenerateQuestionService {
107 108
             //客观题、主观题
108 109
             handleObjSub(subjectStuQuestions, subjectClassStudents, questions, subjectStuPapers, examid, subjectid,subject.getPscore());
109 110
             //知识点相关分析
110
-            reportGeneratePointService.generatePoint(subjectStuQuestions,questions,classStudents,subjectStuPapers,examid,subjectid,subject.getMpid(),subject.getPscore());
111
+            reportGeneratePointService.generatePoint(subjectStuQuestions,questions,subjectClassStudents,subjectStuPapers,examid,subjectid,subject.getMpid(),subject.getPscore());
111 112
         }
112 113
     }
113 114
 
@@ -316,10 +317,19 @@ public class ReportGenerateQuestionService {
316 317
     private String[] questionNdAndQfd(List<MsrReportparam> params, Integer rptype, Double nd) {
317 318
         // 获取难度或者区分度
318 319
         MsrReportparam ndParam = params.stream().filter(p -> p.getRptype().equals(rptype)).findFirst().orElse(null);// 难度
320
+        if (ndParam != null) {
321
+            return questionNdAndQfdComm(ndParam.getSzjson(),nd);
322
+        }
323
+        return new String[]{null, null};
324
+    }
325
+    // 单个试题分析-试题难度、区分度判断值-通用
326
+    private String[] questionNdAndQfdComm(String szjson,Double nd){
327
+        List<SzJsonVo> szList = JSON.parseArray(szjson, SzJsonVo.class);
319 328
         String ndms = "";
320 329
         String ndfw = "";
321
-        if (ndParam != null) {
322
-            List<SzJsonVo> szList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
330
+        if(szList.isEmpty()){
331
+            return new String[]{null, null};
332
+        }else{
323 333
             for (SzJsonVo sz : szList) {
324 334
                 if (nd == 1 && sz.getMaxvalue() == 1) {
325 335
                     ndms = sz.getDjkey();
@@ -335,8 +345,8 @@ public class ReportGenerateQuestionService {
335 345
                     break;
336 346
                 }
337 347
             }
348
+            return new String[]{ndms, ndfw};
338 349
         }
339
-        return new String[]{ndms, ndfw};
340 350
     }
341 351
 
342 352
     // 单个试题分析-客观题选项情况
@@ -804,4 +814,60 @@ public class ReportGenerateQuestionService {
804 814
 
805 815
         return objSub;
806 816
     }
817
+
818
+    //设置难度/区分度描述
819
+    @Transactional(rollbackFor = Exception.class)
820
+    public void saveNdAndQfd(ReportParams reportParams){
821
+        List<MsrReportparam> params = reportParams.getParams();
822
+        if(params == null || params.isEmpty()){
823
+            return;
824
+        }
825
+
826
+        int rptype = reportParams.getRptype();//1难度 2区别度
827
+        //删除已存在试题汇总参数
828
+        msrReportparamMapper.deleteByExamidAndRpbelong(reportParams.getExamid(), reportParams.getRpbelong(),rptype);
829
+        //保存试题汇总参数
830
+        List<MsrReportparam> saveParams = new ArrayList<>();
831
+
832
+        //获取考试分析试题难易度数据
833
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionClassForNdByExamid(reportParams.getExamid());
834
+        List<MsrClassQuestion> saveQuestions = new ArrayList<>();
835
+
836
+        Integer timestamp = N_Utils.getSecondTimestamp();
837
+        for(MsrReportparam param : params){
838
+            String subjectid = param.getSubjectid();
839
+            MsrReportparam rp = new MsrReportparam();
840
+            rp.setExamid(reportParams.getExamid());
841
+            rp.setSubjectid(subjectid);
842
+            rp.setRpbelong(reportParams.getRpbelong());
843
+            rp.setRptype(rptype);
844
+            rp.setHandleid(param.getHandleid());
845
+            rp.setHandletime(timestamp);
846
+            rp.setSzjson(param.getSzjson());
847
+            saveParams.add(rp);
848
+
849
+            List<MsrClassQuestion> subQuestions = questions.stream().filter(q -> q.getSubjectid().equals(subjectid)).collect(Collectors.toList());
850
+            for(MsrClassQuestion question : subQuestions){
851
+                MsrClassQuestion saveQue = new MsrClassQuestion();
852
+                saveQue.setCqid(question.getCqid());
853
+                String[] ndvalues = questionNdAndQfdComm(param.getSzjson(),question.getNd());
854
+                if(rptype == 1){
855
+                    saveQue.setNdms(ndvalues[0]);
856
+                    saveQue.setNdfw(ndvalues[1]);
857
+                }else{
858
+                    saveQue.setQfdms(ndvalues[0]);
859
+                    saveQue.setQfdfw(ndvalues[1]);
860
+                }
861
+                saveQuestions.add(saveQue);
862
+            }
863
+        }
864
+
865
+        //保存参数
866
+        msrReportparamMapper.insertList(saveParams);
867
+        if(rptype == 1){
868
+            msrClassQuestionMapper.updateBatchNdById(saveQuestions);
869
+        }else {
870
+            msrClassQuestionMapper.updateBatchQfdById(saveQuestions);
871
+        }
872
+    }
807 873
 }

+ 15
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

@@ -107,8 +107,13 @@ public class MsScanbatchPaperService {
107 107
             throw new Exception("考试已统分,禁止扫描");
108 108
         }
109 109
 
110
-        //保存一次,扫描次数加1
111
-        msScanbatchMapper.updateScannum(msScanbatchPaper.getBatchid());
110
+        //更改扫描出错次数
111
+        if(msScanbatchPaper.getHaserror() == 1){
112
+            msScanbatchMapper.updateScannumAndErrornum(msScanbatchPaper.getBatchid());
113
+        }else{
114
+            //保存一次,扫描次数加1
115
+            msScanbatchMapper.updateScannum(msScanbatchPaper.getBatchid());
116
+        }
112 117
 
113 118
         Integer timestamp = N_Utils.getSecondTimestamp();
114 119
         msScanbatchPaper.setCreatetime(timestamp);
@@ -188,6 +193,7 @@ public class MsScanbatchPaperService {
188 193
         }
189 194
 
190 195
         msScanbatchPaperMapper.insertUseGeneratedKeys(msScanbatchPaper);
196
+
191 197
         Integer mspid = msScanbatchPaper.getId();
192 198
         msScanbatchPaper.setMspid(mspid);
193 199
 
@@ -358,6 +364,13 @@ public class MsScanbatchPaperService {
358 364
         msPaperStudentQuestionMapper.updateBatchStuAnswerForScan(saveQuesList);
359 365
         msPaperStudentMapper.updateByPrimaryKeySelective(msPaperStudent);
360 366
 
367
+        if(msScanbatchPaper.getMissexam() == 1){
368
+            msScanbatchMapper.updateQknum(msScanbatchPaper.getBatchid());//更改缺考数量
369
+        }
370
+        if(msScanbatchPaper.getViolated() == 1){
371
+            msScanbatchMapper.updateWgnum(msScanbatchPaper.getBatchid());//更改违规数量
372
+        }
373
+
361 374
         rtnanswernum = saveQuesList.size();
362 375
 
363 376
         return rtnanswernum;

+ 3
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchService.java View File

@@ -43,7 +43,6 @@ public class MsScanbatchService {
43 43
             return new ResultVo(1,"考试已统分,禁止扫描");
44 44
         }
45 45
 
46
-
47 46
         String batchname = msScanbatch.getDevice() + "-" + msScanbatch.getMpid() + "-";
48 47
         Integer batchnum = msScanbatchMapper.getBatchNumByBatchname(batchname);
49 48
         if(!N_Utils.isTrueInteger(batchnum)){
@@ -59,6 +58,9 @@ public class MsScanbatchService {
59 58
         msScanbatch.setScannum(0);
60 59
         msScanbatch.setUploadnum(0);
61 60
         msScanbatch.setIdentifynum(0);
61
+        msScanbatch.setQknum(0);
62
+        msScanbatch.setErrornum(0);
63
+        msScanbatch.setWgnum(0);
62 64
         msScanbatchMapper.insertUseGeneratedKeys(msScanbatch);
63 65
 
64 66
         Map<String,Object> map = new HashMap<>();

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

@@ -22,6 +22,9 @@ public class ReportParams {
22 22
     // rankrate名次和比例分析  gradescore分档分数线 nearline临界生群体分析 subjectshow学科考试表现 keystu重点学生信息
23 23
     private String rpbelong;
24 24
 
25
+    //类型
26
+    private Integer rptype;
27
+
25 28
     //操作人ID
26 29
     private Integer handleid;
27 30
 

+ 1
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -13,7 +13,7 @@
13 13
     <select id="examOverview" resultType="java.util.Map">
14 14
         select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.msstate,s.pstate,s.ptstate,
15 15
         s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.answered,p.ptype,p.cutstate,s.teacherid,
16
-        u.username as teachername,p.mpid,p.hasfile,e.exammode,e.examstate,e.hashb,e.gradeid,s.leaderid,u2.username as leadername
16
+        u.username as teachername,p.mpid,p.yjstate,p.cutstate,e.exammode,e.examstate,e.hashb,e.gradeid,s.leaderid,u2.username as leadername
17 17
         ,if(ps.batchid is not null,ps.mpsid,null) scannum,count(ps.mpsid) stunum
18 18
         from ms_subject s left join t_user u on s.teacherid=u.userid
19 19
         left join t_user u2 on s.leaderid=u2.userid

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

@@ -4,7 +4,7 @@
4 4
 
5 5
     <!--设置试卷中试题数量-->
6 6
     <update id="updatePaperInfo">
7
-        update ms_paper set ptype=#{paper.ptype},pnum=#{paper.pnum},pscore=#{paper.pscore},
7
+        update ms_paper set ptype=#{paper.ptype},pnum=#{paper.pnum},pscore=#{paper.pscore},yjstate=#{paper.yjstate},
8 8
         hearfile=#{paper.hearfile},hearnum=#{paper.hearnum},hasfile=#{paper.hasfile},handleid=#{paper.handleid},
9 9
         handletime=#{paper.handletime} where mpid=#{paper.mpid}
10 10
     </update>
@@ -17,8 +17,8 @@
17 17
     <!--获取试卷详细信息-->
18 18
     <select id="getPaperInfoByMsid" resultType="java.util.Map">
19 19
         select s.examid,s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,
20
-        e.gradeid,e.examtype,e.examname,e.exammode,e.examstate,
21
-        p.mpid,p.ptype,p.pnum,p.pscore,u.username as teachername,u.username as handlename
20
+        e.gradeid,e.examtype,e.examname,e.exammode,e.examstate,p.mpid,p.ptype,p.pnum,
21
+        p.pscore,p.hasfile,p.hearnum,p.hearfile,p.yjstate,u.username as teachername,u.username as handlename
22 22
         from ms_subject s left join ms_paper p on s.msid=p.msid
23 23
         left join ms_exam e on s.examid=e.examid
24 24
         left join t_user u on s.teacherid=u.userid
@@ -83,7 +83,7 @@
83 83
     </select>
84 84
     <!--根据考试id和科目id获取试卷信息-->
85 85
     <select id="getPaperByExamIdAndSubjectId" resultType="com.xhkjedu.smarking.model.paper.MsPaper">
86
-        select mpid, examid, msid, subjectid, ptype, pnum, pscore, answered, hasfile, hearnum, hearfile
86
+        select mpid, examid, msid, subjectid, ptype, pnum, pscore, answered, hasfile, hearnum, hearfile,yjstate
87 87
         from ms_paper where examid=#{examid} and subjectid=#{subjectid}
88 88
     </select>
89 89
 

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

@@ -15,4 +15,22 @@
15 15
         delete from msr_subject_question_section where examid = #{examid};
16 16
     </delete>
17 17
 
18
+    <!--获取考试难度和区别度数据-->
19
+    <select id="listQuestionClassForNdByExamid" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion">
20
+        select cqid,examid,subjectid,nd,ndms,ndfw,qfd,qfdms,qfdfw from msr_class_question where examid = #{examid}
21
+    </select>
22
+    <!--修改难度-->
23
+    <update id="updateBatchNdById">
24
+        <foreach collection="list" item="item" separator=";">
25
+            update msr_class_question set ndms = #{item.ndms},ndfw = #{item.ndfw} where cqid = #{item.cqid}
26
+        </foreach>
27
+    </update>
28
+
29
+    <!--修改区分度-->
30
+    <update id="updateBatchQfdById">
31
+        <foreach collection="list" item="item" separator=";">
32
+            update msr_class_question set qfdms = #{item.ndms},qfdfw = #{item.ndfw} where cqid = #{item.cqid}
33
+        </foreach>
34
+    </update>
35
+
18 36
 </mapper>

+ 6
- 0
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml View File

@@ -19,4 +19,10 @@
19 19
         delete from msp_reportparam where rpid in
20 20
         <foreach collection="list" item="rpid" open="(" separator="," close=")">#{rpid}</foreach>
21 21
     </delete>
22
+
23
+    <!--删除考试对应类型参数-->
24
+    <delete id="deleteByExamidAndRpbelong">
25
+        delete from msp_reportparam where examid = #{examid} and rpbelong = #{rpbelong}
26
+        <if test="rptype!= null and rptype!= 0">and rptype = #{rptype}</if>
27
+    </delete>
22 28
 </mapper>

+ 15
- 1
smarking/src/main/resources/mapper/scan/MsScanbatchMapper.xml View File

@@ -84,9 +84,23 @@
84 84
     <update id="updateScannum">
85 85
         update ms_scanbatch set scannum=scannum+1 where batchid=#{batchid}
86 86
     </update>
87
+    <!--修改扫描数量和出错数量-->
88
+    <update id="updateScannumAndErrornum">
89
+        update ms_scanbatch set scannum=scannum+1,
90
+        errornum=(select count(*) from ms_scanbatch_paper where batchid=#{batchid} and haserror=1
91
+        where batchid=#{batchid}
92
+    </update>
87 93
     <!--修改识别数量-->
88 94
     <update id="updateIdentifynum">
89
-        update ms_scanbatch_paper set identified=(select count(*) from ms_scanbatch_paper where batchid=#{batchid} and identified=1) where batchid=#{batchid} and mspid=#{mspid}
95
+        update ms_scanbatch set identified=(select count(*) from ms_scanbatch_paper where batchid=#{batchid} and identified=1) where batchid=#{batchid}
96
+    </update>
97
+    <!--修改缺考数量-->
98
+    <update id="updateQknum">
99
+        update ms_scanbatch_paper set errornum=(select count(*) from ms_scanbatch_paper where batchid=#{batchid} and haserror=1) where batchid=#{batchid}
100
+    </update>
101
+    <!--修改违规数量-->
102
+    <update id="updateWgnum">
103
+        update ms_scanbatch_paper set errornum=(select count(*) from ms_scanbatch_paper where batchid=#{batchid} and haserror=1) where batchid=#{batchid}
90 104
     </update>
91 105
 
92 106
     <!--根据试卷ID获取考试状态和ID-->

Loading…
Cancel
Save