Browse Source

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

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

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

1036
 
1036
 
1037
             if (ptype == 1) {
1037
             if (ptype == 1) {
1038
                 //处理题型下试题:题库显示题号时为母题的题号即order(qn是英语为顺延题号其他学科为母题号和子题排序拼接)
1038
                 //处理题型下试题:题库显示题号时为母题的题号即order(qn是英语为顺延题号其他学科为母题号和子题排序拼接)
1039
-               /* String qtypejson = panalyze.get("qnumjson").toString();//原试卷题型分析
1039
+                String qtypejson = panalyze.get("qnumjson").toString();//原试卷题型分析
1040
                 List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
1040
                 List<Map> qtypelist = JSON.parseArray(qtypejson, Map.class);
1041
-                setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);*/
1041
+                setPaperQuestionTkQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1042
 
1042
 
1043
                 //处理知识点
1043
                 //处理知识点
1044
                 setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo);
1044
                 setEPaperQuestionPoints(panalyze, paperstulist, rpointlist, stupointlist, examPaperClassVo);
1045
 
1045
 
1046
                 //处理难易度
1046
                 //处理难易度
1047
-               /* String complexityjson = panalyze.get("complexityjson").toString();
1047
+                String complexityjson = panalyze.get("complexityjson").toString();
1048
                 List<Map> complexitylist = JSON.parseArray(complexityjson, Map.class);
1048
                 List<Map> complexitylist = JSON.parseArray(complexityjson, Map.class);
1049
-                setEPaperQuestionComplexitys(complexitylist, paperstulist, complist, stucomplist, examPaperClassVo);*/
1049
+                setEPaperQuestionComplexitys(complexitylist, paperstulist, complist, stucomplist, examPaperClassVo);
1050
 
1050
 
1051
             } else {
1051
             } else {
1052
                 //处理题型及题型下试题:附件显示题号为qn(order)作为排序使用
1052
                 //处理题型及题型下试题:附件显示题号为qn(order)作为排序使用
1055
                 setPaperQuestionFjQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1055
                 setPaperQuestionFjQtypes(qtypelist, paperstulist, rtypelist, rqueslist, stutypelist, examPaperClassVo);
1056
             }
1056
             }
1057
         }
1057
         }
1058
-        /*eRclassQtypeMapper.insertList(rtypelist);
1058
+        eRclassQtypeMapper.insertList(rtypelist);
1059
         eRstudentQtypeMapper.insertList(stutypelist);
1059
         eRstudentQtypeMapper.insertList(stutypelist);
1060
         eRclassQuestionMapper.insertList(rqueslist);
1060
         eRclassQuestionMapper.insertList(rqueslist);
1061
         eRclassComplexityMapper.insertList(complist);
1061
         eRclassComplexityMapper.insertList(complist);
1062
-        erStudentComplexityMapper.insertList(stucomplist);*/
1062
+        erStudentComplexityMapper.insertList(stucomplist);
1063
         eRclassPointMapper.insertList(rpointlist);
1063
         eRclassPointMapper.insertList(rpointlist);
1064
         eRstudentPointMapper.insertList(stupointlist);
1064
         eRstudentPointMapper.insertList(stupointlist);
1065
     }
1065
     }
1368
                     qgstulist = paperstulist.stream().filter(s -> s.getEptqid().equals(eptqid)).collect(Collectors.toList());
1368
                     qgstulist = paperstulist.stream().filter(s -> s.getEptqid().equals(eptqid)).collect(Collectors.toList());
1369
                 } else {
1369
                 } else {
1370
                     qgstulist = new ArrayList<>();
1370
                     qgstulist = new ArrayList<>();
1371
+                    List<EPaperStudentQuestion> stuqlist = paperstulist.stream().filter(s -> eptqids.contains(s.getEptqid())).collect(Collectors.toList());
1371
                     //母子题情况,计算所有子题的和即为母题。把试题按照学生分组,分组为一组的即为
1372
                     //母子题情况,计算所有子题的和即为母题。把试题按照学生分组,分组为一组的即为
1372
-                    Map<Integer, List<EPaperStudentQuestion>> stuQuesMap = paperstulist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
1373
+                    Map<Integer, List<EPaperStudentQuestion>> stuQuesMap = stuqlist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
1373
                     for (Map.Entry<Integer, List<EPaperStudentQuestion>> entry : stuQuesMap.entrySet()) {
1374
                     for (Map.Entry<Integer, List<EPaperStudentQuestion>> entry : stuQuesMap.entrySet()) {
1374
                         List<EPaperStudentQuestion> stuqueslist = entry.getValue();
1375
                         List<EPaperStudentQuestion> stuqueslist = entry.getValue();
1375
                         EPaperStudentQuestion pstq = stuqueslist.get(0);
1376
                         EPaperStudentQuestion pstq = stuqueslist.get(0);
1377
                         Double qscore = stuqueslist.stream().mapToDouble(EPaperStudentQuestion::getQscore).sum();
1378
                         Double qscore = stuqueslist.stream().mapToDouble(EPaperStudentQuestion::getQscore).sum();
1378
                         pstq.setQscore(qscore);
1379
                         pstq.setQscore(qscore);
1379
                         pstq.setStuscore(qstuscore);
1380
                         pstq.setStuscore(qstuscore);
1380
-                        pstq.setCtype(11);//母子题关系的均设置为复合,不再进行选项区分
1381
+                        pstq.setCtype(11);//母子题关系的均设置为复合,不再进行选项区分
1381
                         int bad = 0;
1382
                         int bad = 0;
1382
                         int good = 0;
1383
                         int good = 0;
1383
                         for (EPaperStudentQuestion sq : stuqueslist) {
1384
                         for (EPaperStudentQuestion sq : stuqueslist) {
1453
                 eRclassQtype.setScore(score);
1454
                 eRclassQtype.setScore(score);
1454
                 eRclassQtype.setNum(num);
1455
                 eRclassQtype.setNum(num);
1455
                 eRclassQtype.setSrate(srate);
1456
                 eRclassQtype.setSrate(srate);
1456
-                eRclassQtype.setScore(tgstuscore);
1457
                 eRclassQtype.setGradescore(tgstuscore);
1457
                 eRclassQtype.setGradescore(tgstuscore);
1458
                 eRclassQtype.setGradeavgscore(tgavgscore);
1458
                 eRclassQtype.setGradeavgscore(tgavgscore);
1459
                 eRclassQtype.setGradesrate(tgsrate);
1459
                 eRclassQtype.setGradesrate(tgsrate);

+ 45
- 15
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

8
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
8
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
9
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
9
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
11
+import com.xhkjedu.sexam.model.paper.EPaper;
11
 import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
12
 import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
12
 import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
13
 import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
13
 import com.xhkjedu.utils.N_Utils;
14
 import com.xhkjedu.utils.N_Utils;
210
                 map.put("stuanswertxt", q.get("stuanswertxt").toString());
211
                 map.put("stuanswertxt", q.get("stuanswertxt").toString());
211
                 map.put("answer", q.get("answer").toString());
212
                 map.put("answer", q.get("answer").toString());
212
                 map.put("qstem", q.get("qstem").toString());
213
                 map.put("qstem", q.get("qstem").toString());
213
-                map.put("qoption", q.get("qoption").toString());
214
-                map.put("qanalyze", q.get("qanalyze").toString());
215
-                map.put("hashear", Integer.parseInt(q.get("hashear").toString()));
216
-                map.put("hearfile", q.get("hearfile").toString());
214
+                if(N_Utils.isNotEmpty(q.get("qoption"))){
215
+                    map.put("qoption", q.get("qoption").toString());
216
+                }else{
217
+                    map.put("qoption", "");
218
+                }
219
+                if(N_Utils.isNotEmpty(q.get("qanalyze"))){
220
+                    map.put("qanalyze", q.get("qanalyze").toString());
221
+                }else{
222
+                    map.put("qanalyze", "");
223
+                }
224
+
225
+                Integer hashear = Integer.parseInt(q.get("hashear").toString());
226
+                map.put("hashear", hashear);
227
+                if(hashear == 1){
228
+                    map.put("hearfile", q.get("hearfile").toString());
229
+                }
230
+
217
                 map.put("qlevel", qlevel);
231
                 map.put("qlevel", qlevel);
218
-                map.put("classavgscore", Integer.parseInt(q.get("classavgscore").toString()));
219
-                map.put("gradeavgscore", Integer.parseInt(q.get("gradeavgscore").toString()));
232
+                map.put("classavgscore", Double.parseDouble(q.get("classavgscore").toString()));
233
+                map.put("gradeavgscore", Double.parseDouble(q.get("gradeavgscore").toString()));
220
                 if (q.get("points") != null) {
234
                 if (q.get("points") != null) {
221
                     List<Map> points = (List<Map>) q.get("points");
235
                     List<Map> points = (List<Map>) q.get("points");
222
                     map.put("points", points);
236
                     map.put("points", points);
236
                     mq.put("ctype", Integer.parseInt(q.get("mctype").toString()));
250
                     mq.put("ctype", Integer.parseInt(q.get("mctype").toString()));
237
                     mq.put("qstem", q.get("mqstem").toString());
251
                     mq.put("qstem", q.get("mqstem").toString());
238
                     mq.put("qoption", q.get("mqoption").toString());
252
                     mq.put("qoption", q.get("mqoption").toString());
239
-                    mq.put("qanswer", q.get("mqanswer").toString());
240
-                    mq.put("qanalyze", q.get("mqanalyze").toString());
241
-                    mq.put("hashear", Integer.parseInt(q.get("mhashear").toString()));
242
-                    mq.put("hearfile", q.get("mhearfile").toString());
253
+                    if(N_Utils.isNotEmpty(q.get("mqoption"))){
254
+                        mq.put("qoption", q.get("mqoption").toString());
255
+                    }else{
256
+                        mq.put("qoption", "");
257
+                    }
258
+                    if(N_Utils.isNotEmpty(q.get("mqanalyze"))){
259
+                        mq.put("qanalyze", q.get("mqanalyze").toString());
260
+                    }else{
261
+                        mq.put("qanalyze", "");
262
+                    }
263
+                    if(N_Utils.isNotEmpty(q.get("mqanswer"))){
264
+                        mq.put("qanalyze", q.get("mqanswer").toString());
265
+                    }else{
266
+                        mq.put("qanalyze", "");
267
+                    }
268
+
269
+                    Integer hashear = Integer.parseInt(q.get("mhashear").toString());
270
+                    mq.put("hashear", hashear);
271
+                    if(hashear == 1){
272
+                        mq.put("hearfile", q.get("mhearfile").toString());
273
+                    }
243
                     if (q.get("points") != null) {
274
                     if (q.get("points") != null) {
244
                         List<Map> points = (List<Map>) q.get("points");
275
                         List<Map> points = (List<Map>) q.get("points");
245
                         mq.put("points", points);
276
                         mq.put("points", points);
282
                 map.put("num",queslist.size());
313
                 map.put("num",queslist.size());
283
             }
314
             }
284
             map.remove("questions");
315
             map.remove("questions");
285
-            return list;
286
         }
316
         }
287
         return list;
317
         return list;
288
     }
318
     }
302
         List<Map> pointqueslist = new ArrayList<>();
332
         List<Map> pointqueslist = new ArrayList<>();
303
         for(Map pointmap : pointlist){
333
         for(Map pointmap : pointlist){
304
             //知识点包含的试题
334
             //知识点包含的试题
305
-            List<QuestionOrderVo> ques = (List<QuestionOrderVo>) pointmap.get("ques");
335
+            List<Map> ques = (List<Map>) pointmap.get("ques");
306
             List<Integer> eptqidlist = new ArrayList<>();//知识点关联的所有试题
336
             List<Integer> eptqidlist = new ArrayList<>();//知识点关联的所有试题
307
-            for(QuestionOrderVo qovo : ques){
308
-                Integer[] eptqids = qovo.getEptqids();
309
-                eptqidlist.addAll(Arrays.asList(eptqids));
337
+            for(Map qovo : ques){
338
+                List<Integer> eptqids = (List<Integer>) qovo.get("eptqids");
339
+                eptqidlist.addAll(eptqids);
310
             }
340
             }
311
             //获取知识点下试题
341
             //获取知识点下试题
312
             List<Map> poinques = list.stream().filter(s -> eptqidlist.contains(Integer.parseInt(s.get("eptqid").toString()))).collect(Collectors.toList());
342
             List<Map> poinques = list.stream().filter(s -> eptqidlist.contains(Integer.parseInt(s.get("eptqid").toString()))).collect(Collectors.toList());

+ 5
- 3
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

137
     </select>
137
     </select>
138
     <select id="listQuesPoints" resultType="java.util.Map">
138
     <select id="listQuesPoints" resultType="java.util.Map">
139
         select p.pointid,p.pointname
139
         select p.pointid,p.pointname
140
-        from t_question_point qp left join t_point p on qp.pointid=p.poingid
140
+        from t_question_point qp left join t_point p on qp.pointid=p.pointid
141
         where
141
         where
142
         <if test="qlevel==1">
142
         <if test="qlevel==1">
143
             qp.questionid=#{questionid}
143
             qp.questionid=#{questionid}
161
         <result property="subjectname" column="subjectname" />
161
         <result property="subjectname" column="subjectname" />
162
         <result property="ptype" column="ptype" />
162
         <result property="ptype" column="ptype" />
163
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
163
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
164
+            <result property="epsqid" column="epsqid" />
164
             <result property="eptqid" column="eptqid" />
165
             <result property="eptqid" column="eptqid" />
165
             <result property="questionid" column="questionid" />
166
             <result property="questionid" column="questionid" />
166
             <result property="qlevel" column="qlevel" />
167
             <result property="qlevel" column="qlevel" />
168
         </collection>
169
         </collection>
169
     </resultMap>
170
     </resultMap>
170
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
171
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
171
-        select sq.subjectid,s.subjectname,sq.eptqid,q.questionid,q.qlevel,q.questionpid
172
+        select sq.subjectid,s.subjectname,p.ptype,sq.epsqid,sq.eptqid,q.questionid,q.qlevel,q.questionpid
172
         from e_paper_student_question sq
173
         from e_paper_student_question sq
173
         left join t_question q on q.questionid=sq.questionid
174
         left join t_question q on q.questionid=sq.questionid
174
         left join t_subject s on sq.subjectid=s.subjectid
175
         left join t_subject s on sq.subjectid=s.subjectid
175
         left join t_question mq on q.questionpid=mq.questionid
176
         left join t_question mq on q.questionpid=mq.questionid
176
-        where sq.examid=#{examid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore group by s.subjectid order by s.subjectorder
177
+        left join e_paper p on sq.epid=p.epid
178
+        where sq.examid=#{examid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore group by sq.epsqid order by s.subjectorder
177
     </select>
179
     </select>
178
     <!--学生报告-错题集-学生科目下错题(题库)-->
180
     <!--学生报告-错题集-学生科目下错题(题库)-->
179
     <select id="listStudentErrorQuestionsForTk" resultMap="listStudentQues">
181
     <select id="listStudentErrorQuestionsForTk" resultMap="listStudentQues">

Loading…
Cancel
Save