Browse Source

报告生成-题型

tags/正式版本
王宁 2 years ago
parent
commit
df3d99aa72

+ 7
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportstu/ERstudentQtypeMapper.java View File

@@ -0,0 +1,7 @@
1
+package com.xhkjedu.sexam.mapper.reportstu;
2
+
3
+import com.xhkjedu.sexam.base.TkMapper;
4
+import com.xhkjedu.sexam.model.reportstu.ERStudentQtype;
5
+
6
+public interface ERstudentQtypeMapper extends TkMapper<ERStudentQtype> {
7
+}

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/reportstu/ERstudentPoint.java View File

@@ -17,7 +17,7 @@ public class ERstudentPoint extends BaseBean {
17 17
     private Integer examid;
18 18
 
19 19
     //科目id
20
-    private Integer subjectid;
20
+    private String subjectid;
21 21
 
22 22
     //学生id
23 23
     private Integer studentid;

+ 45
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -14,6 +14,8 @@ import com.xhkjedu.sexam.mapper.reportclass.ERclassQtypeMapper;
14 14
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionMapper;
15 15
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionPointMapper;
16 16
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
17
+import com.xhkjedu.sexam.mapper.reportstu.ERstudentPointMapper;
18
+import com.xhkjedu.sexam.mapper.reportstu.ERstudentQtypeMapper;
17 19
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
18 20
 import com.xhkjedu.sexam.model.report.ERbase;
19 21
 import com.xhkjedu.sexam.model.report.ERsubject;
@@ -66,7 +68,6 @@ public class EReportGenerateService {
66 68
     @Resource
67 69
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
68 70
 
69
-
70 71
     @Resource
71 72
     private ERbaseMapper eRbaseMapper;
72 73
     @Resource
@@ -81,6 +82,10 @@ public class EReportGenerateService {
81 82
     private ERclassQuestionMapper eRclassQuestionMapper;
82 83
     @Resource
83 84
     private ERclassQuestionPointMapper eRclassQuestionPointMapper;
85
+    @Resource
86
+    private ERstudentPointMapper eRstudentPointMapper;
87
+    @Resource
88
+    private ERstudentQtypeMapper eRstudentQtypeMapper;
84 89
 
85 90
 
86 91
     //生成考试报告
@@ -368,6 +373,11 @@ public class EReportGenerateService {
368 373
 
369 374
             //获取试卷只是分析
370 375
             Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
376
+            String qtypejson = epa.get("qnumjson").toString();//原试卷题型分析
377
+            List<Map> qtypelist = JSON.parseArray(qtypejson,Map.class);
378
+            for(int k = 0;k<qtypelist.size();k++){
379
+                
380
+            }
371 381
 
372 382
             //遍及试卷处理题型下各班级得分情况
373 383
             for(EPaperQtypeVo t : fjtypelist){
@@ -470,6 +480,7 @@ public class EReportGenerateService {
470 480
                 }
471 481
             }
472 482
 
483
+
473 484
             //仅有题库试卷有知识点
474 485
             if(ptype == 1){
475 486
                 String pointjson = epa.get("pointjson").toString();
@@ -512,12 +523,16 @@ public class EReportGenerateService {
512 523
                         pointvo.setClasssrate(csrate);
513 524
                         rpointlist.add(pointvo);
514 525
                     }
526
+
527
+                    setEPaperQuestionPointsStu(gstus,stupoints,subjectid,pointid,pointname);
515 528
                 }
516 529
             }
517 530
         }
518 531
         eRclassQtypeMapper.insertList(rtypelist);
519 532
         eRclassQuestionMapper.insertList(rqlist);
520 533
         eRclassQuestionPointMapper.insertList(rpointlist);
534
+        eRstudentPointMapper.insertList(stupoints);
535
+        eRstudentQtypeMapper.insertList(stuqtypes);
521 536
     }
522 537
     //处理题库试卷中子母题
523 538
     private void setEPaperQtypeForQues(List<EPaperQtypeVo> fjtypelist){
@@ -660,5 +675,34 @@ public class EReportGenerateService {
660 675
         return rtnmap;
661 676
     }
662 677
 
678
+    //设置学生知识点关联试题得分
679
+    private void setEPaperQuestionPointsStu(List<EPaperStudentQuestion> gstus,List<ERstudentPoint> stupoints,String subjectid,String pointid,String pointname){
680
+        //把试题按学生进行分组然后进行计算
681
+        Map<Integer,List<EPaperStudentQuestion>> stuMap = gstus.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid,Collectors.toList()));
682
+        for(Map.Entry<Integer,List<EPaperStudentQuestion>> entry: stuMap.entrySet()){
683
+            List<EPaperStudentQuestion> stuq = entry.getValue();
684
+            EPaperStudentQuestion sq = stuq.get(0);
685
+            Double qscore = stuq.stream().mapToDouble(o -> o.getQscore()).sum();
686
+            Double stuscore = stuq.stream().mapToDouble(o -> o.getStuscore()).sum();
687
+            Double srate = N_Utils.getDoubleDivideAndMulitiply(stuscore,qscore);
688
+            ERstudentPoint eRstudentPoint = new ERstudentPoint();
689
+            eRstudentPoint.setExamid(sq.getExamid());
690
+            eRstudentPoint.setSubjectid(subjectid);
691
+            eRstudentPoint.setStudentid(entry.getKey());
692
+            eRstudentPoint.setClassid(sq.getClassid());
693
+            eRstudentPoint.setPointid(pointid);
694
+            eRstudentPoint.setPointname(pointname);
695
+            eRstudentPoint.setStuscore(stuscore);
696
+            eRstudentPoint.setStusrate(srate);
697
+
698
+
699
+        }
700
+
701
+
702
+    }
703
+
704
+    //设置学生题型下试题得分
705
+    private void setEPaperQuestionQtypesStu(List<EPaperStudentQuestion> gstus,List<ERstudentPoint> stupoints){
663 706
 
707
+    }
664 708
 }

Loading…
Cancel
Save