|
@@ -398,7 +398,7 @@ public class PaperReportService {
|
398
|
398
|
// 获取原来作业本身试题分析
|
399
|
399
|
TPaperAnalyze paperAnalyze = paperAnalyzeMapper.getAnalyzeByPaperid(paper.getPaperid());
|
400
|
400
|
setPaperQuestionForQues(stuQschoolMap, stuSchoolMap, rclassQuesList, paper);//试题分析
|
401
|
|
- setPaperQuestionPoint(stuQlist, rclassPointList, paperAnalyze);// 知识点分析
|
|
401
|
+ setPaperQuestionPoint(stuQlist,stuList, rclassPointList, paperAnalyze);// 知识点分析
|
402
|
402
|
setPaperQuestionStuForQues(stuQlist, rstuList, paper);// 学生得分
|
403
|
403
|
}
|
404
|
404
|
if (N_Utils.isListNotEmpty(rclassList)) paperRclassMapper.insertList(rclassList);
|
|
@@ -618,7 +618,7 @@ public class PaperReportService {
|
618
|
618
|
}
|
619
|
619
|
}
|
620
|
620
|
|
621
|
|
- // 班级作业试题情况-题库作业试题分析(未提交学生参与计算、未作答班级生产报告)
|
|
621
|
+ // 班级作业试题情况-题库作业试题分析
|
622
|
622
|
private void setPaperQuestionForQues(Map<Integer, List<PaperRStuQuestionVo>> stuQschoolMap, Map<Integer, List<PaperRStuVo>> stuSchoolMap, List<PaperRclassQuestion> rclassQuesList,
|
623
|
623
|
TPaper paper) {
|
624
|
624
|
List<PaperRQuestionVo> quesList = paperStudentQuestionMapper.listAllQuesByPaperid(paper.getPaperid());// 获取试卷中所有试题
|
|
@@ -852,119 +852,132 @@ public class PaperReportService {
|
852
|
852
|
}
|
853
|
853
|
|
854
|
854
|
// 班级作业试题情况-题库作业知识点分析
|
855
|
|
- private void setPaperQuestionPoint(List<PaperRStuQuestionVo> stuQschoolList, List<PaperRclassPoint> rclassPointList, TPaperAnalyze paperAnalyze) {
|
856
|
|
- // 原试卷知识点分析
|
857
|
|
- String pointjson = paperAnalyze.getPointjson();
|
858
|
|
- List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
|
859
|
|
-
|
860
|
|
- // 试题对应知识点关系
|
861
|
|
- String quespointjson = paperAnalyze.getQuespointjson();
|
862
|
|
- List<QuestionPointVo> quepointlist = JSON.parseArray(quespointjson, QuestionPointVo.class);
|
863
|
|
-
|
864
|
|
- List<PaperPointStuScoreVo> gradestulist = new ArrayList<>();// 每个知识点每个学生的得分
|
865
|
|
- for (int i = 0; i < quepointlist.size(); i++) {
|
866
|
|
- QuestionPointVo qpoint = quepointlist.get(i);
|
867
|
|
- List<Map> points = qpoint.getPointids();
|
868
|
|
- if (N_Utils.isListNotEmpty(points)) {
|
869
|
|
- if (qpoint.getQlevel() == 1 || !N_Utils.isEmptyInteger(qpoint.getPtqid())) {
|
870
|
|
- // 说明本题为单题,获取该题下所有学生的得分情况
|
871
|
|
- List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> s.getPtqid().equals(qpoint.getPtqid())).collect(Collectors.toList());
|
872
|
|
- for (PaperRStuQuestionVo sq : stuqueslist) {
|
873
|
|
- setEPaperQuestionPointsForStuQues(gradestulist, sq, points, qpoint.getPtqid().toString());
|
874
|
|
- }
|
875
|
|
- } else {
|
876
|
|
- // 说明该题为复合题,获取所有子题
|
877
|
|
- List<Integer> eptqids = qpoint.getPtqids();
|
878
|
|
- String eptqidsStr = eptqids.stream().map(String::valueOf).collect(Collectors.joining(","));
|
879
|
|
- List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> eptqids.contains(s.getPtqid())).collect(Collectors.toList());
|
880
|
|
- // 根据每个学生分组获取每个学生该题分值:因一份作业可能发给多个班级的同一个学生,所有需要按学校班级分组后再按学生算
|
881
|
|
- Map<Integer,List<PaperRStuQuestionVo>> schoolQueMap = stuqueslist.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getSchoolid));
|
882
|
|
- for(Map.Entry<Integer,List<PaperRStuQuestionVo>> schoolQueEntry : schoolQueMap.entrySet()){
|
883
|
|
- List<PaperRStuQuestionVo> classQueList = schoolQueEntry.getValue();
|
884
|
|
- Map<Integer,List<PaperRStuQuestionVo>> classQueMap = classQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getClassid));
|
885
|
|
- for(Map.Entry<Integer,List<PaperRStuQuestionVo>> sclassQueEntry : classQueMap.entrySet()){
|
886
|
|
- List<PaperRStuQuestionVo> stuQueList = sclassQueEntry.getValue();
|
887
|
|
-
|
888
|
|
- Map<Integer, List<PaperRStuQuestionVo>> stuquesmap = stuQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getStudentid));
|
889
|
|
- for (Map.Entry<Integer, List<PaperRStuQuestionVo>> entry : stuquesmap.entrySet()) {
|
890
|
|
- List<PaperRStuQuestionVo> stuques = entry.getValue();
|
891
|
|
- Double stuscore = stuques.stream().mapToDouble(PaperRStuQuestionVo::getStuscore).sum();
|
892
|
|
- stuscore = N_Utils.formatDouble(stuscore, 1);
|
893
|
|
- PaperRStuQuestionVo sqfirst = stuques.get(0);
|
894
|
|
- PaperRStuQuestionVo sq = new PaperRStuQuestionVo();
|
895
|
|
- sq.setStudentid(entry.getKey());
|
896
|
|
- sq.setClassid(sqfirst.getClassid());
|
897
|
|
- sq.setStuscore(stuscore);
|
898
|
|
- sq.setPaperid(sqfirst.getPaperid());
|
899
|
|
- sq.setSchoolid(sqfirst.getSchoolid());
|
900
|
|
- setEPaperQuestionPointsForStuQues(gradestulist, sq, points, eptqidsStr);
|
|
855
|
+ private void setPaperQuestionPoint(List<PaperRStuQuestionVo> stuQschoolList,List<PaperRStuVo> stuList, List<PaperRclassPoint> rclassPointList, TPaperAnalyze paperAnalyze) {
|
|
856
|
+
|
|
857
|
+ //获取学校提交作业学生数量,无学生提交时不生成试题得分率
|
|
858
|
+ List<PaperRStuVo> commitStuList = stuList.stream().filter(s -> s.getPsstate() > 0).collect(Collectors.toList());
|
|
859
|
+
|
|
860
|
+ if(N_Utils.isListNotEmpty(commitStuList)){
|
|
861
|
+ // 原试卷知识点分析
|
|
862
|
+ String pointjson = paperAnalyze.getPointjson();
|
|
863
|
+ List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
|
|
864
|
+
|
|
865
|
+ // 试题对应知识点关系
|
|
866
|
+ String quespointjson = paperAnalyze.getQuespointjson();
|
|
867
|
+ List<QuestionPointVo> quepointlist = JSON.parseArray(quespointjson, QuestionPointVo.class);
|
|
868
|
+
|
|
869
|
+ List<PaperPointStuScoreVo> gradestulist = new ArrayList<>();// 每个知识点每个学生的得分
|
|
870
|
+ for (int i = 0; i < quepointlist.size(); i++) {
|
|
871
|
+ QuestionPointVo qpoint = quepointlist.get(i);
|
|
872
|
+ List<Map> points = qpoint.getPointids();
|
|
873
|
+ if (N_Utils.isListNotEmpty(points)) {
|
|
874
|
+ if (qpoint.getQlevel() == 1 || !N_Utils.isEmptyInteger(qpoint.getPtqid())) {
|
|
875
|
+ // 说明本题为单题,获取该题下所有学生的得分情况
|
|
876
|
+ List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> s.getPtqid().equals(qpoint.getPtqid())).collect(Collectors.toList());
|
|
877
|
+ for (PaperRStuQuestionVo sq : stuqueslist) {
|
|
878
|
+ setEPaperQuestionPointsForStuQues(gradestulist, sq, points, qpoint.getPtqid().toString());
|
|
879
|
+ }
|
|
880
|
+ } else {
|
|
881
|
+ // 说明该题为复合题,获取所有子题
|
|
882
|
+ List<Integer> eptqids = qpoint.getPtqids();
|
|
883
|
+ String eptqidsStr = eptqids.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
884
|
+ List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> eptqids.contains(s.getPtqid())).collect(Collectors.toList());
|
|
885
|
+ // 根据每个学生分组获取每个学生该题分值:因一份作业可能发给多个班级的同一个学生,所有需要按学校班级分组后再按学生算
|
|
886
|
+ Map<Integer,List<PaperRStuQuestionVo>> schoolQueMap = stuqueslist.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getSchoolid));
|
|
887
|
+ for(Map.Entry<Integer,List<PaperRStuQuestionVo>> schoolQueEntry : schoolQueMap.entrySet()){
|
|
888
|
+ List<PaperRStuQuestionVo> classQueList = schoolQueEntry.getValue();
|
|
889
|
+ Map<Integer,List<PaperRStuQuestionVo>> classQueMap = classQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getClassid));
|
|
890
|
+ for(Map.Entry<Integer,List<PaperRStuQuestionVo>> sclassQueEntry : classQueMap.entrySet()){
|
|
891
|
+ List<PaperRStuQuestionVo> stuQueList = sclassQueEntry.getValue();
|
|
892
|
+
|
|
893
|
+ Map<Integer, List<PaperRStuQuestionVo>> stuquesmap = stuQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getStudentid));
|
|
894
|
+ for (Map.Entry<Integer, List<PaperRStuQuestionVo>> entry : stuquesmap.entrySet()) {
|
|
895
|
+ List<PaperRStuQuestionVo> stuques = entry.getValue();
|
|
896
|
+ Double stuscore = stuques.stream().mapToDouble(PaperRStuQuestionVo::getStuscore).sum();
|
|
897
|
+ stuscore = N_Utils.formatDouble(stuscore, 1);
|
|
898
|
+ PaperRStuQuestionVo sqfirst = stuques.get(0);
|
|
899
|
+ PaperRStuQuestionVo sq = new PaperRStuQuestionVo();
|
|
900
|
+ sq.setStudentid(entry.getKey());
|
|
901
|
+ sq.setClassid(sqfirst.getClassid());
|
|
902
|
+ sq.setStuscore(stuscore);
|
|
903
|
+ sq.setPaperid(sqfirst.getPaperid());
|
|
904
|
+ sq.setSchoolid(sqfirst.getSchoolid());
|
|
905
|
+ setEPaperQuestionPointsForStuQues(gradestulist, sq, points, eptqidsStr);
|
|
906
|
+ }
|
901
|
907
|
}
|
902
|
908
|
}
|
903
|
909
|
}
|
904
|
910
|
}
|
905
|
911
|
}
|
906
|
|
- }
|
907
|
|
-
|
908
|
|
- // 根据试卷知识点分析进行生成班级、学校知识点分析
|
909
|
|
- for (Map map : pointlist) {
|
910
|
|
- String pointid = map.get("pointid").toString();
|
911
|
|
- String pointname = map.get("pointname").toString();
|
912
|
|
- Double pointscore = Double.parseDouble(map.get("score").toString());
|
913
|
|
- // Double pointrate = Double.parseDouble(map.get("srate").toString());
|
914
|
|
- List<Map> qorders = (List<Map>) map.get("ques");
|
915
|
|
- List<Integer> orders = qorders.stream().map(s -> Integer.parseInt(s.get("order").toString())).collect(Collectors.toList());
|
916
|
|
- String orderstr = orders.stream().map(String::valueOf).collect(Collectors.joining(","));//试题
|
917
|
|
- // 单个知识点学生得分情况:一个知识对应一个或多个试题,
|
918
|
|
- List<PaperPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
|
919
|
|
-
|
920
|
|
- List<PaperPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
|
921
|
|
- Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
|
922
|
|
- for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
|
923
|
|
- List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
|
924
|
|
- Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
925
|
|
- stuscore = N_Utils.formatDouble(stuscore, 1);
|
926
|
|
-
|
927
|
|
- PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
|
928
|
|
- PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
|
929
|
|
- sscorevo.setStudentid(sscorevofirst.getStudentid());
|
930
|
|
- sscorevo.setClassid(sscorevofirst.getClassid());
|
931
|
|
- sscorevo.setStuscore(stuscore);
|
932
|
|
- sscorevo.setSchoolid(sscorevofirst.getSchoolid());
|
933
|
|
- pointstuscorelist.add(sscorevo);
|
934
|
|
- }
|
935
|
912
|
|
936
|
|
- Map<Integer, List<PaperPointStuScoreVo>> schoolStuMap = pointstuscorelist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getSchoolid));
|
937
|
|
- for (Map.Entry<Integer, List<PaperPointStuScoreVo>> schoolentry : schoolStuMap.entrySet()) {
|
938
|
|
- List<PaperPointStuScoreVo> schoolStuList = schoolentry.getValue();
|
939
|
|
- double schoolScore = pointscore * schoolStuList.size();
|
940
|
|
- double schoolStuScore = schoolStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
941
|
|
- double schoolScorerate = N_Utils.getDoubleDivideAndMulitiply(schoolStuScore, schoolScore);
|
942
|
|
- double schoolLostrate = N_Utils.getDoubleReduce(100.0, schoolScorerate);
|
943
|
|
-
|
944
|
|
- // 学校下班级内学生试题
|
945
|
|
- Map<Integer, List<PaperPointStuScoreVo>> classStuMap = schoolStuList.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getClassid));
|
946
|
|
- for (Map.Entry<Integer, List<PaperPointStuScoreVo>> classMap : classStuMap.entrySet()) {
|
947
|
|
- List<PaperPointStuScoreVo> classStuList = classMap.getValue();
|
948
|
|
- PaperPointStuScoreVo pstuqVo = classStuList.get(0);
|
949
|
|
- double classScore = pointscore * classStuList.size();
|
950
|
|
- double classStuScore = classStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
951
|
|
- double classScorerate = N_Utils.getDoubleDivideAndMulitiply(classStuScore, classScore);
|
952
|
|
- double classLostrate = N_Utils.getDoubleReduce(100.0, classScorerate);
|
|
913
|
+ //把提交学生进行分组
|
|
914
|
+ Map<Integer,List<PaperRStuVo>> schoolCommitStuList = commitStuList.stream().collect(Collectors.groupingBy(PaperRStuVo :: getSchoolid));
|
|
915
|
+
|
|
916
|
+ // 根据试卷知识点分析进行生成班级、学校知识点分析
|
|
917
|
+ for (Map map : pointlist) {
|
|
918
|
+ String pointid = map.get("pointid").toString();
|
|
919
|
+ String pointname = map.get("pointname").toString();
|
|
920
|
+ Double pointscore = Double.parseDouble(map.get("score").toString());
|
|
921
|
+ // Double pointrate = Double.parseDouble(map.get("srate").toString());
|
|
922
|
+ List<Map> qorders = (List<Map>) map.get("ques");
|
|
923
|
+ List<Integer> orders = qorders.stream().map(s -> Integer.parseInt(s.get("order").toString())).collect(Collectors.toList());
|
|
924
|
+ String orderstr = orders.stream().map(String::valueOf).collect(Collectors.joining(","));//试题
|
|
925
|
+ // 单个知识点学生得分情况:一个知识对应一个或多个试题,
|
|
926
|
+ List<PaperPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
|
|
927
|
+
|
|
928
|
+ List<PaperPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
|
|
929
|
+ Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
|
|
930
|
+ for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
|
|
931
|
+ List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
|
|
932
|
+ Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
|
933
|
+ stuscore = N_Utils.formatDouble(stuscore, 1);
|
|
934
|
+
|
|
935
|
+ PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
|
|
936
|
+ PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
|
|
937
|
+ sscorevo.setStudentid(sscorevofirst.getStudentid());
|
|
938
|
+ sscorevo.setClassid(sscorevofirst.getClassid());
|
|
939
|
+ sscorevo.setStuscore(stuscore);
|
|
940
|
+ sscorevo.setSchoolid(sscorevofirst.getSchoolid());
|
|
941
|
+ pointstuscorelist.add(sscorevo);
|
|
942
|
+ }
|
953
|
943
|
|
954
|
|
- PaperRclassPoint ppoint = new PaperRclassPoint();
|
955
|
|
- ppoint.setPaperid(paperAnalyze.getPaperid());
|
956
|
|
- ppoint.setClassid(pstuqVo.getClassid());
|
957
|
|
- ppoint.setPointid(pointid);
|
958
|
|
- ppoint.setPointname(pointname);
|
959
|
|
- ppoint.setClassscorerate(classScorerate);
|
960
|
|
- ppoint.setClasslostrate(classLostrate);
|
961
|
|
- ppoint.setSchoolscorerate(schoolScorerate);
|
962
|
|
- ppoint.setSchoollostrate(schoolLostrate);
|
963
|
|
- ppoint.setQns(orderstr);
|
964
|
|
- rclassPointList.add(ppoint);
|
|
944
|
+ Map<Integer, List<PaperPointStuScoreVo>> schoolStuMap = pointstuscorelist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getSchoolid));
|
|
945
|
+ for (Map.Entry<Integer, List<PaperPointStuScoreVo>> schoolentry : schoolStuMap.entrySet()) {
|
|
946
|
+ Integer schoolid = schoolentry.getKey();
|
|
947
|
+ //当学校有学生提交作业时进行计算知识点
|
|
948
|
+ if(schoolCommitStuList.containsKey(schoolid)){
|
|
949
|
+ List<PaperPointStuScoreVo> schoolStuList = schoolentry.getValue();
|
|
950
|
+ double schoolScore = pointscore * schoolStuList.size();
|
|
951
|
+ double schoolStuScore = schoolStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
|
952
|
+ double schoolScorerate = N_Utils.getDoubleDivideAndMulitiply(schoolStuScore, schoolScore);
|
|
953
|
+ double schoolLostrate = N_Utils.getDoubleReduce(100.0, schoolScorerate);
|
|
954
|
+
|
|
955
|
+ // 学校下班级内学生试题
|
|
956
|
+ Map<Integer, List<PaperPointStuScoreVo>> classStuMap = schoolStuList.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getClassid));
|
|
957
|
+ for (Map.Entry<Integer, List<PaperPointStuScoreVo>> classMap : classStuMap.entrySet()) {
|
|
958
|
+ List<PaperPointStuScoreVo> classStuList = classMap.getValue();
|
|
959
|
+ PaperPointStuScoreVo pstuqVo = classStuList.get(0);
|
|
960
|
+ double classScore = pointscore * classStuList.size();
|
|
961
|
+ double classStuScore = classStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
|
962
|
+ double classScorerate = N_Utils.getDoubleDivideAndMulitiply(classStuScore, classScore);
|
|
963
|
+ double classLostrate = N_Utils.getDoubleReduce(100.0, classScorerate);
|
|
964
|
+
|
|
965
|
+ PaperRclassPoint ppoint = new PaperRclassPoint();
|
|
966
|
+ ppoint.setPaperid(paperAnalyze.getPaperid());
|
|
967
|
+ ppoint.setClassid(pstuqVo.getClassid());
|
|
968
|
+ ppoint.setPointid(pointid);
|
|
969
|
+ ppoint.setPointname(pointname);
|
|
970
|
+ ppoint.setClassscorerate(classScorerate);
|
|
971
|
+ ppoint.setClasslostrate(classLostrate);
|
|
972
|
+ ppoint.setSchoolscorerate(schoolScorerate);
|
|
973
|
+ ppoint.setSchoollostrate(schoolLostrate);
|
|
974
|
+ ppoint.setQns(orderstr);
|
|
975
|
+ rclassPointList.add(ppoint);
|
|
976
|
+ }
|
|
977
|
+ }
|
965
|
978
|
}
|
966
|
|
- }
|
967
|
979
|
|
|
980
|
+ }
|
968
|
981
|
}
|
969
|
982
|
}
|
970
|
983
|
|