Browse Source

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 years ago
parent
commit
802fa2203c

+ 19
- 15
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -1040,12 +1040,12 @@ public class EReportGenerateService {
1040 1040
 
1041 1041
             if (ptype == 1) {
1042 1042
                 //处理题型下试题:题库显示题号时为母题的题号即order(qn是英语为顺延题号其他学科为母题号和子题排序拼接)
1043
-                String qtypejson = panalyze.get("qnumjson").toString();//原试卷题型分析
1044
-                List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
1045
-                setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1043
+//                String qtypejson = panalyze.get("qnumjson").toString();//原试卷题型分析
1044
+//                List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
1045
+//                setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1046 1046
 
1047 1047
                 //处理知识点
1048
-                setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo);
1048
+//                setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo);
1049 1049
 
1050 1050
                 //处理难易度
1051 1051
                 String complexityjson = panalyze.get("complexityjson").toString();
@@ -1059,13 +1059,13 @@ public class EReportGenerateService {
1059 1059
                 setPaperQuestionFjQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1060 1060
             }
1061 1061
         }
1062
-        eRclassQtypeMapper.insertList(rtypelist);
1063
-        eRstudentQtypeMapper.insertList(stutypelist);
1064
-        eRclassQuestionMapper.insertList(rqueslist);
1062
+//        eRclassQtypeMapper.insertList(rtypelist);
1063
+//        eRstudentQtypeMapper.insertList(stutypelist);
1064
+//        eRclassQuestionMapper.insertList(rqueslist);
1065 1065
         eRclassComplexityMapper.insertList(complist);
1066 1066
         erStudentComplexityMapper.insertList(stucomplist);
1067
-        eRclassPointMapper.insertList(rpointlist);
1068
-        eRstudentPointMapper.insertList(stupointlist);
1067
+//        eRclassPointMapper.insertList(rpointlist);
1068
+//        eRstudentPointMapper.insertList(stupointlist);
1069 1069
     }
1070 1070
 
1071 1071
     //题型、试题、知识点、难易度--处理学生选项情况和得分情况
@@ -1499,14 +1499,15 @@ public class EReportGenerateService {
1499 1499
             List<Map> points = qpoint.getPointids();
1500 1500
             if(N_Utils.isListNotEmpty(points)){
1501 1501
                 if(qpoint.getQlevel()==1 || !N_Utils.isEmptyInteger(qpoint.getEptqid())){
1502
-                    //说明本题为单题,获取题下所有学生的得分情况
1502
+                    //说明本题为单题,获取题下所有学生的得分情况
1503 1503
                     List<EPaperStudentQuestion> stuqueslist = paperstulist.stream().filter(s -> s.getEptqid().equals(qpoint.getEptqid())).collect(Collectors.toList());
1504 1504
                     for(EPaperStudentQuestion sq : stuqueslist){
1505
-                        setEPaperQuestionPointsForStuQues(gradestulist,sq,points);
1505
+                        setEPaperQuestionPointsForStuQues(gradestulist,sq,points,qpoint.getEptqid().toString());
1506 1506
                     }
1507 1507
                 }else{
1508
-                    //说明改题为复合体,获取所有子题
1508
+                    //说明该题为复合题,获取所有子题
1509 1509
                     List<Integer> eptqids = qpoint.getEptqids();
1510
+                    String eptqidsStr = eptqids.stream().map(String::valueOf).collect(Collectors.joining(","));
1510 1511
                     List<EPaperStudentQuestion> stuqueslist = paperstulist.stream().filter(s ->eptqids.contains(s.getEptqid())).collect(Collectors.toList());
1511 1512
                     //根据每个学生分组获取每个学生该题分值
1512 1513
                     Map<Integer,List<EPaperStudentQuestion>> stuquesmap = stuqueslist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
@@ -1515,7 +1516,7 @@ public class EReportGenerateService {
1515 1516
                         Double stuscore = stuques.stream().mapToDouble(EPaperStudentQuestion::getStuscore).sum();
1516 1517
                         EPaperStudentQuestion sq = stuques.get(0);
1517 1518
                         sq.setStuscore(stuscore);
1518
-                        setEPaperQuestionPointsForStuQues(gradestulist,sq,points);
1519
+                        setEPaperQuestionPointsForStuQues(gradestulist,sq,points,eptqidsStr);
1519 1520
                     }
1520 1521
                 }
1521 1522
             }
@@ -1596,7 +1597,7 @@ public class EReportGenerateService {
1596 1597
 
1597 1598
     }
1598 1599
     //题型、试题、知识点、难易度--知识点:设置每个学生每个试题知识点得分
1599
-    private void setEPaperQuestionPointsForStuQues(List<ERPointStuScoreVo> gradestulist,EPaperStudentQuestion sq,List<Map> points){
1600
+    private void setEPaperQuestionPointsForStuQues(List<ERPointStuScoreVo> gradestulist,EPaperStudentQuestion sq,List<Map> points,String eptqids){
1600 1601
         if(points.size() == 1){
1601 1602
             Map pointmap = points.get(0);
1602 1603
             //说明该试题仅有一个知识点得分直接为改知识点分值
@@ -1606,6 +1607,7 @@ public class EReportGenerateService {
1606 1607
             pscvo.setStuscore(sq.getStuscore());
1607 1608
             String pointid = pointmap.get("pointid").toString();
1608 1609
             pscvo.setPointid(pointid);
1610
+            pscvo.setEptqids(eptqids);
1609 1611
             gradestulist.add(pscvo);
1610 1612
         }else{
1611 1613
             //计算每个知识点所占分值(平均分配)
@@ -1617,6 +1619,7 @@ public class EReportGenerateService {
1617 1619
                 pscvo.setStudentid(sq.getStudentid());
1618 1620
                 String pointid = pointmap.get("pointid").toString();
1619 1621
                 pscvo.setPointid(pointid);
1622
+                pscvo.setEptqids(eptqids);
1620 1623
                 if(avgps.length == 2 && (j+1) == points.size()){
1621 1624
                     pscvo.setStuscore(avgps[1]);
1622 1625
                 }else{
@@ -1658,8 +1661,9 @@ public class EReportGenerateService {
1658 1661
                 } else {
1659 1662
                     //该题未复合型试题
1660 1663
                     qgstulist = new ArrayList<>();
1664
+                    List<EPaperStudentQuestion> stuquelist = paperstulist.stream().filter(s -> eptqids.contains(s.getEptqid())).collect(Collectors.toList());
1661 1665
                     //母子题情况,计算所有子题的和即为母题。把试题按照学生分组,分组为一组的即为
1662
-                    Map<Integer, List<EPaperStudentQuestion>> stuQuesMap = paperstulist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
1666
+                    Map<Integer, List<EPaperStudentQuestion>> stuQuesMap = stuquelist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
1663 1667
                     for (Map.Entry<Integer, List<EPaperStudentQuestion>> entry : stuQuesMap.entrySet()) {
1664 1668
                         List<EPaperStudentQuestion> stuqueslist = entry.getValue();
1665 1669
                         EPaperStudentQuestion pstq = stuqueslist.get(0);

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/report/ERPointStuScoreVo.java View File

@@ -19,4 +19,6 @@ public class ERPointStuScoreVo {
19 19
     private Double score;//试题分值
20 20
 
21 21
     private Double stuscore;//学生得分
22
+
23
+    private String eptqids;//试题id
22 24
 }

Loading…
Cancel
Save