|
@@ -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
|
}
|