Browse Source

报告生成-题型

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

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

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
     private Integer examid;
17
     private Integer examid;
18
 
18
 
19
     //科目id
19
     //科目id
20
-    private Integer subjectid;
20
+    private String subjectid;
21
 
21
 
22
     //学生id
22
     //学生id
23
     private Integer studentid;
23
     private Integer studentid;

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

14
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionMapper;
14
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionMapper;
15
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionPointMapper;
15
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionPointMapper;
16
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
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
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
19
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
18
 import com.xhkjedu.sexam.model.report.ERbase;
20
 import com.xhkjedu.sexam.model.report.ERbase;
19
 import com.xhkjedu.sexam.model.report.ERsubject;
21
 import com.xhkjedu.sexam.model.report.ERsubject;
66
     @Resource
68
     @Resource
67
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
69
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
68
 
70
 
69
-
70
     @Resource
71
     @Resource
71
     private ERbaseMapper eRbaseMapper;
72
     private ERbaseMapper eRbaseMapper;
72
     @Resource
73
     @Resource
81
     private ERclassQuestionMapper eRclassQuestionMapper;
82
     private ERclassQuestionMapper eRclassQuestionMapper;
82
     @Resource
83
     @Resource
83
     private ERclassQuestionPointMapper eRclassQuestionPointMapper;
84
     private ERclassQuestionPointMapper eRclassQuestionPointMapper;
85
+    @Resource
86
+    private ERstudentPointMapper eRstudentPointMapper;
87
+    @Resource
88
+    private ERstudentQtypeMapper eRstudentQtypeMapper;
84
 
89
 
85
 
90
 
86
     //生成考试报告
91
     //生成考试报告
368
 
373
 
369
             //获取试卷只是分析
374
             //获取试卷只是分析
370
             Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
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
             for(EPaperQtypeVo t : fjtypelist){
383
             for(EPaperQtypeVo t : fjtypelist){
470
                 }
480
                 }
471
             }
481
             }
472
 
482
 
483
+
473
             //仅有题库试卷有知识点
484
             //仅有题库试卷有知识点
474
             if(ptype == 1){
485
             if(ptype == 1){
475
                 String pointjson = epa.get("pointjson").toString();
486
                 String pointjson = epa.get("pointjson").toString();
512
                         pointvo.setClasssrate(csrate);
523
                         pointvo.setClasssrate(csrate);
513
                         rpointlist.add(pointvo);
524
                         rpointlist.add(pointvo);
514
                     }
525
                     }
526
+
527
+                    setEPaperQuestionPointsStu(gstus,stupoints,subjectid,pointid,pointname);
515
                 }
528
                 }
516
             }
529
             }
517
         }
530
         }
518
         eRclassQtypeMapper.insertList(rtypelist);
531
         eRclassQtypeMapper.insertList(rtypelist);
519
         eRclassQuestionMapper.insertList(rqlist);
532
         eRclassQuestionMapper.insertList(rqlist);
520
         eRclassQuestionPointMapper.insertList(rpointlist);
533
         eRclassQuestionPointMapper.insertList(rpointlist);
534
+        eRstudentPointMapper.insertList(stupoints);
535
+        eRstudentQtypeMapper.insertList(stuqtypes);
521
     }
536
     }
522
     //处理题库试卷中子母题
537
     //处理题库试卷中子母题
523
     private void setEPaperQtypeForQues(List<EPaperQtypeVo> fjtypelist){
538
     private void setEPaperQtypeForQues(List<EPaperQtypeVo> fjtypelist){
660
         return rtnmap;
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