|
@@ -59,65 +59,72 @@ public class EReportGenerateQuestionService {
|
59
|
59
|
@Resource
|
60
|
60
|
private ERStudentComplexityMapper erStudentComplexityMapper;
|
61
|
61
|
|
62
|
|
- public void setClassQuestion(Integer examid, List<Map> subjects, List<Map> classes, EBase base){
|
63
|
|
- Integer stuzero = base.getStuzero();//0分学生是否参与统计0不统计1统计(默认)
|
64
|
|
- // 考试所有学生提交试卷作答情况 2023-12-27添加0分学生是否参与统计
|
65
|
|
- List<EPaperStudentQuestion> stulist = ePaperStudentQuestionMapper.listExamStudentsAnswer(examid);
|
66
|
|
- if (N_Utils.isListNotEmpty(stulist)) {
|
67
|
|
- List<ERclassQtype> rtypelist = new ArrayList<>();// 班级题型
|
68
|
|
- List<ERStudentQtype> stutypelist = new ArrayList<>();// 学生题型
|
69
|
|
- List<ERclassQuestion> rqueslist = new ArrayList<>();// 班级试题
|
70
|
|
- List<ERclassPoint> rpointlist = new ArrayList<>();// 班级知识点
|
71
|
|
- List<ERstudentPoint> stupointlist = new ArrayList<>();// 学生知识点
|
72
|
|
- List<ERclassComplexity> complist = new ArrayList<>();// 班级难易度
|
73
|
|
- List<ERStudentComplexity> stucomplist = new ArrayList<>();// 学生难易度
|
74
|
|
-
|
75
|
|
- for (Map map : subjects) {
|
76
|
|
- String subjectid = map.get("subjectid").toString();
|
77
|
|
- Integer epid = Integer.parseInt(map.get("epid").toString());// 获取试卷id
|
78
|
|
- Integer ptype = Integer.parseInt(map.get("ptype").toString());// 试卷类型1题库2附件
|
79
|
|
- ExamPaperClassVo examPaperClassVo = new ExamPaperClassVo();
|
80
|
|
- examPaperClassVo.setExamid(examid);
|
81
|
|
- examPaperClassVo.setEpid(epid);
|
82
|
|
- examPaperClassVo.setSubjectid(subjectid);
|
83
|
|
- examPaperClassVo.setClasses(classes);
|
84
|
|
-
|
85
|
|
- // 获取试卷本身的分析
|
86
|
|
- Map panalyze = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
|
87
|
|
- // 获取指定试卷学生作答情况
|
88
|
|
- List<EPaperStudentQuestion> paperstulist = stulist.stream().filter(s -> s.getEpid().equals(epid)).collect(Collectors.toList());
|
89
|
|
- if (N_Utils.isListNotEmpty(paperstulist)) {
|
90
|
|
- if (ptype == 1) {
|
91
|
|
- // 处理题型下试题:题库显示题号时为母题的题号即order(qn是英语为顺延题号其他学科为母题号和子题排序拼接)
|
92
|
|
- String qtypejson = panalyze.get("qnumjson").toString();// 原试卷题型分析
|
93
|
|
- List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
|
94
|
|
- setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo, stuzero);
|
95
|
|
-
|
96
|
|
- // 处理知识点
|
97
|
|
- setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo, stuzero);
|
98
|
|
-
|
99
|
|
- // 处理难易度
|
100
|
|
- String complexityjson = panalyze.get("complexityjson").toString();
|
101
|
|
- List<Map> complexitylist = JSON.parseArray(complexityjson, Map.class);
|
102
|
|
- setEPaperQuestionComplexitys(complexitylist, paperstulist, complist, stucomplist, examPaperClassVo, stuzero);
|
|
62
|
+ public void setClassQuestion(Integer examid, List<Map> subjects, List<Map> classes, EBase base) throws Exception {
|
|
63
|
+
|
|
64
|
+ try {
|
|
65
|
+ Integer stuzero = base.getStuzero();//0分学生是否参与统计0不统计1统计(默认)
|
|
66
|
+ // 考试所有学生提交试卷作答情况 2023-12-27添加0分学生是否参与统计
|
|
67
|
+ List<EPaperStudentQuestion> stulist = ePaperStudentQuestionMapper.listExamStudentsAnswer(examid);
|
|
68
|
+ if (N_Utils.isListNotEmpty(stulist)) {
|
|
69
|
+ List<ERclassQtype> rtypelist = new ArrayList<>();// 班级题型
|
|
70
|
+ List<ERStudentQtype> stutypelist = new ArrayList<>();// 学生题型
|
|
71
|
+ List<ERclassQuestion> rqueslist = new ArrayList<>();// 班级试题
|
|
72
|
+ List<ERclassPoint> rpointlist = new ArrayList<>();// 班级知识点
|
|
73
|
+ List<ERstudentPoint> stupointlist = new ArrayList<>();// 学生知识点
|
|
74
|
+ List<ERclassComplexity> complist = new ArrayList<>();// 班级难易度
|
|
75
|
+ List<ERStudentComplexity> stucomplist = new ArrayList<>();// 学生难易度
|
|
76
|
+
|
|
77
|
+ for (Map map : subjects) {
|
|
78
|
+ String subjectid = map.get("subjectid").toString();
|
|
79
|
+ Integer epid = Integer.parseInt(map.get("epid").toString());// 获取试卷id
|
|
80
|
+ Integer ptype = Integer.parseInt(map.get("ptype").toString());// 试卷类型1题库2附件
|
|
81
|
+ ExamPaperClassVo examPaperClassVo = new ExamPaperClassVo();
|
|
82
|
+ examPaperClassVo.setExamid(examid);
|
|
83
|
+ examPaperClassVo.setEpid(epid);
|
|
84
|
+ examPaperClassVo.setSubjectid(subjectid);
|
|
85
|
+ examPaperClassVo.setClasses(classes);
|
|
86
|
+
|
|
87
|
+ // 获取试卷本身的分析
|
|
88
|
+ Map panalyze = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
|
|
89
|
+ // 获取指定试卷学生作答情况
|
|
90
|
+ List<EPaperStudentQuestion> paperstulist = stulist.stream().filter(s -> s.getEpid().equals(epid)).collect(Collectors.toList());
|
|
91
|
+ if (N_Utils.isListNotEmpty(paperstulist)) {
|
|
92
|
+ if (ptype == 1) {
|
|
93
|
+ // 处理题型下试题:题库显示题号时为母题的题号即order(qn是英语为顺延题号其他学科为母题号和子题排序拼接)
|
|
94
|
+ String qtypejson = panalyze.get("qnumjson").toString();// 原试卷题型分析
|
|
95
|
+ List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
|
|
96
|
+ setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo, stuzero);
|
|
97
|
+
|
|
98
|
+ // 处理知识点
|
|
99
|
+ setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo, stuzero);
|
|
100
|
+
|
|
101
|
+ // 处理难易度
|
|
102
|
+ String complexityjson = panalyze.get("complexityjson").toString();
|
|
103
|
+ List<Map> complexitylist = JSON.parseArray(complexityjson, Map.class);
|
|
104
|
+ setEPaperQuestionComplexitys(complexitylist, paperstulist, complist, stucomplist, examPaperClassVo, stuzero);
|
103
|
105
|
|
104
|
|
- } else {
|
105
|
|
- // 处理题型及题型下试题:附件显示题号为qn(order)作为排序使用
|
106
|
|
- String qtypejson = panalyze.get("qnumjson").toString();// 原试卷题型分析
|
107
|
|
- List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
|
108
|
|
- setPaperQuestionFjQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo,stuzero);
|
|
106
|
+ } else {
|
|
107
|
+ // 处理题型及题型下试题:附件显示题号为qn(order)作为排序使用
|
|
108
|
+ String qtypejson = panalyze.get("qnumjson").toString();// 原试卷题型分析
|
|
109
|
+ List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
|
|
110
|
+ setPaperQuestionFjQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo,stuzero);
|
|
111
|
+ }
|
109
|
112
|
}
|
110
|
113
|
}
|
111
|
|
- }
|
112
|
114
|
|
113
|
|
- eRclassQtypeMapper.insertList(rtypelist);
|
114
|
|
- eRstudentQtypeMapper.insertList(stutypelist);
|
115
|
|
- eRclassQuestionMapper.insertList(rqueslist);
|
116
|
|
- if (N_Utils.isListNotEmpty(complist)) eRclassComplexityMapper.insertList(complist);
|
117
|
|
- if (N_Utils.isListNotEmpty(stucomplist)) erStudentComplexityMapper.insertList(stucomplist);
|
118
|
|
- if (N_Utils.isListNotEmpty(rpointlist)) eRclassPointMapper.insertList(rpointlist);
|
119
|
|
- if (N_Utils.isListNotEmpty(stupointlist)) eRstudentPointMapper.insertList(stupointlist);
|
|
115
|
+ eRclassQtypeMapper.insertList(rtypelist);
|
|
116
|
+ eRstudentQtypeMapper.insertList(stutypelist);
|
|
117
|
+ eRclassQuestionMapper.insertList(rqueslist);
|
|
118
|
+ if (N_Utils.isListNotEmpty(complist)) eRclassComplexityMapper.insertList(complist);
|
|
119
|
+ if (N_Utils.isListNotEmpty(stucomplist)) erStudentComplexityMapper.insertList(stucomplist);
|
|
120
|
+ if (N_Utils.isListNotEmpty(rpointlist)) eRclassPointMapper.insertList(rpointlist);
|
|
121
|
+ if (N_Utils.isListNotEmpty(stupointlist)) eRstudentPointMapper.insertList(stupointlist);
|
|
122
|
+ }
|
|
123
|
+ }catch (Exception e){
|
|
124
|
+ log.error("生成试题相关报告出错:" + e.getMessage());
|
|
125
|
+ throw new Exception("生成试题相关报告失败");
|
120
|
126
|
}
|
|
127
|
+
|
121
|
128
|
}
|
122
|
129
|
|
123
|
130
|
// 题型、试题、知识点、难易度--处理学生选项情况和得分情况
|