|
@@ -10,6 +10,7 @@ import com.xhkjedu.smarking.model.exam.MsClass;
|
10
|
10
|
import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
|
11
|
11
|
import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
|
12
|
12
|
import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
|
|
13
|
+import com.xhkjedu.smarking.utils.MarkingUtil;
|
13
|
14
|
import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
|
14
|
15
|
import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
|
15
|
16
|
import com.xhkjedu.utils.N_Utils;
|
|
@@ -208,10 +209,6 @@ public class MsrClassQuestionService {
|
208
|
209
|
|
209
|
210
|
ndList.add(zsndMap);
|
210
|
211
|
}
|
211
|
|
- //计算各个难度的试题得分率
|
212
|
|
- for(Map<String,Object> nd : ndList) {
|
213
|
|
- List<MsrClassQuestion> ndQuestions = schoolQuestions.stream().filter(m -> m.getNdms().equals(nd.get("ndms"))).collect(Collectors.toList());
|
214
|
|
- }
|
215
|
212
|
|
216
|
213
|
Map<String,Object> rtnMap = new LinkedHashMap<>();
|
217
|
214
|
rtnMap.put("qns",qns);
|
|
@@ -222,7 +219,7 @@ public class MsrClassQuestionService {
|
222
|
219
|
return rtnMap;
|
223
|
220
|
}
|
224
|
221
|
//学科报告-各班学科试题分析-试题难度和区分度
|
225
|
|
- public void listQuestionForXhXhstNdAndQfd(ExamReportParams params){
|
|
222
|
+ public Map<String,Object> listQuestionForXhXhstQfd(ExamReportParams params){
|
226
|
223
|
params.setSelclass(4);
|
227
|
224
|
//获取选定班级的试题分析
|
228
|
225
|
List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
|
|
@@ -239,21 +236,193 @@ public class MsrClassQuestionService {
|
239
|
236
|
// 获取后N个元素
|
240
|
237
|
lastN = goodAndBadQues.stream().skip(goodAndBadQues.size() - n).collect(Collectors.toList());
|
241
|
238
|
|
242
|
|
-
|
|
239
|
+ //统计图按区分度进行排序
|
|
240
|
+ List<MsrClassQuestion> qfdQuestions = questions.stream().sorted(Comparator.comparing(MsrClassQuestion::getQfd).reversed()).collect(Collectors.toList());
|
|
241
|
+ List<Map<String,Object>> qfdList = new ArrayList<>();
|
|
242
|
+ for(MsrClassQuestion qfd : qfdQuestions){
|
|
243
|
+ Map<String,Object> qfdMap = new HashMap<>();
|
|
244
|
+ qfdMap.put("qn",qfd.getQn());
|
|
245
|
+ qfdMap.put("mptqid",qfd.getMptqid()); // 题目ID
|
|
246
|
+ qfdMap.put("qfd",qfd.getQfd());
|
|
247
|
+ qfdMap.put("scorerate",qfd.getScorerate());
|
|
248
|
+ qfdMap.put("scoreratec",qfd.getScoreratec());
|
|
249
|
+ qfdList.add(qfdMap);
|
|
250
|
+ }
|
243
|
251
|
|
244
|
|
- //获取所有题号
|
245
|
|
- List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
|
246
|
|
- //把试题按班级分组
|
247
|
|
- Map<Integer,List<MsrClassQuestion>> classMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
|
248
|
|
- List<Map<String,Object>> classList = new ArrayList<>();//班级试题
|
249
|
|
- for(Map.Entry<Integer,List<MsrClassQuestion>> entry : classMap.entrySet()){
|
250
|
|
- Map<String,Object> clMap = new HashMap<>();
|
251
|
|
- clMap.put("classid",entry.getKey());
|
252
|
|
- clMap.put("classname",entry.getValue().get(0).getClassname());
|
253
|
|
- clMap.put("questions",entry.getValue());
|
254
|
|
- classList.add(clMap);
|
|
252
|
+ Map<String,Object> rtnMap = new HashMap<>();
|
|
253
|
+ rtnMap.put("firstN",firstN);
|
|
254
|
+ rtnMap.put("lastN",lastN);
|
|
255
|
+ rtnMap.put("qfdList",qfdList);
|
|
256
|
+ return rtnMap;
|
|
257
|
+ }
|
|
258
|
+ //学科报告-各班学科试题分析-试题难度分组表现差异
|
|
259
|
+ public Map<String,Object> listQuestionForXhXhstNdGroup(ExamReportParams params){
|
|
260
|
+ //所有所有试题
|
|
261
|
+ List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
|
|
262
|
+
|
|
263
|
+ //获取考试关联班级
|
|
264
|
+ List<MsClass> classList= msClassMapper.listClassByExamidAndSubjectid(params.getExamid(),params.getSubjectid());
|
|
265
|
+
|
|
266
|
+ //获取所有试题难度分组参数
|
|
267
|
+ MsrReportparam ndParam = msrReportparamMapper.getReportparamByRpbelongSubjectType(params.getExamid(),"quesummary","all",params.getSubjectid(),1);
|
|
268
|
+ List<SzJsonVo> jsonList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
|
|
269
|
+ List<Map<String,Object>> ndList = new ArrayList<>();
|
|
270
|
+ List<String> ndfwList = new ArrayList<>();
|
|
271
|
+ for(SzJsonVo szvo : jsonList){
|
|
272
|
+ Map<String,Object> zsndMap = new HashMap<>();
|
|
273
|
+ zsndMap.put("djkey",szvo.getDjkey());
|
|
274
|
+ ndfwList.add(szvo.getDjkey());
|
|
275
|
+ zsndMap.put("classid",0);
|
|
276
|
+ zsndMap.put("classname","全体");
|
|
277
|
+ //获取该难度下所有试题
|
|
278
|
+ List<MsrClassQuestion> ndQues = questions.stream().filter(m -> m.getNdms().equals(szvo.getDjkey())).collect(Collectors.toList());
|
|
279
|
+ //处理全体班级情况
|
|
280
|
+ List<MsrClassQuestion> schoolQues = ndQues.stream().filter(m -> m.getClassid() == 0).collect(Collectors.toList());
|
|
281
|
+ if(schoolQues.isEmpty()){
|
|
282
|
+ //获取
|
|
283
|
+ zsndMap.put("qnstr", "");
|
|
284
|
+ zsndMap.put("scorerate", 0);
|
|
285
|
+ }else{
|
|
286
|
+ //获取
|
|
287
|
+ List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
|
|
288
|
+ double sumScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
|
|
289
|
+ zsndMap.put("qnstr", String.join(",", qnList));
|
|
290
|
+ zsndMap.put("scorerate", MarkingUtil.div(sumScoreRate,qnList.size()));
|
|
291
|
+ }
|
|
292
|
+ ndList.add(zsndMap);
|
|
293
|
+ //处理各班情况
|
|
294
|
+ for(MsClass cl : classList){
|
|
295
|
+ List<MsrClassQuestion> classQues = ndQues.stream().filter(m -> Objects.equals(m.getClassid(), cl.getClassid())).collect(Collectors.toList());
|
|
296
|
+
|
|
297
|
+ Map<String,Object> classNdMap = new HashMap<>();
|
|
298
|
+ classNdMap.put("djkey",szvo.getDjkey());
|
|
299
|
+ classNdMap.put("classid",cl.getClassid());
|
|
300
|
+ classNdMap.put("classname",cl.getClassname());
|
|
301
|
+ if(classQues.isEmpty()){
|
|
302
|
+ classNdMap.put("qnstr", "");
|
|
303
|
+ classNdMap.put("scorerate", 0);
|
|
304
|
+ }else{
|
|
305
|
+ List<String> classqnList = classQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
|
|
306
|
+ double classScoreRate = classQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
|
|
307
|
+ classNdMap.put("qnstr", String.join(",", classqnList));
|
|
308
|
+ classNdMap.put("scorerate",MarkingUtil.div(classScoreRate, classqnList.size()));
|
|
309
|
+ }
|
|
310
|
+ ndList.add(classNdMap);
|
|
311
|
+ }
|
|
312
|
+ }
|
|
313
|
+ Map<String,Object> rtnMap = new HashMap<>();
|
|
314
|
+ rtnMap.put("ndfwList",ndfwList);
|
|
315
|
+ rtnMap.put("ndList",ndList);
|
|
316
|
+ return rtnMap;
|
|
317
|
+ }
|
|
318
|
+
|
|
319
|
+ //班级报告-全部班级-学科试题得分率对比
|
|
320
|
+ public Map<String,Object> listQuestionForBjQuestionScoreRate(ExamReportParams params){
|
|
321
|
+ //获取考试关联班级
|
|
322
|
+ List<MsClass> classList= msClassMapper.listClassByExamidAndSubjectid(params.getExamid(),params.getSubjectid());
|
|
323
|
+ //所有所有试题
|
|
324
|
+ List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
|
|
325
|
+ //返回所有的班级信息
|
|
326
|
+ List<Map<String,Object>> classListMap = new ArrayList<>();
|
|
327
|
+ Map<String,Object> schoolMap = new HashMap<>();
|
|
328
|
+ schoolMap.put("classid",0);
|
|
329
|
+ schoolMap.put("classname","全体");
|
|
330
|
+ classListMap.add(schoolMap);
|
|
331
|
+
|
|
332
|
+ for(MsClass cl : classList) {
|
|
333
|
+ Map<String,Object> classMap = new HashMap<>();
|
|
334
|
+ classMap.put("classid",cl.getClassid());
|
|
335
|
+ classMap.put("classname",cl.getClassname());
|
|
336
|
+ classListMap.add(classMap);
|
|
337
|
+ }
|
|
338
|
+ //把试题按试题id分组
|
|
339
|
+ Map<Integer,List<MsrClassQuestion>> qnMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getMptqid));
|
|
340
|
+ List<Map<String,Object>> quesList = new ArrayList<>();
|
|
341
|
+ for(Map.Entry<Integer,List<MsrClassQuestion>> entry : qnMap.entrySet()) {
|
|
342
|
+ List<MsrClassQuestion> entryList = entry.getValue();
|
|
343
|
+ Map<String,Object> queMap = new HashMap<>();
|
|
344
|
+ queMap.put("qn",entryList.get(0).getQn());
|
|
345
|
+ List<Map<String,Object>> classQueList = new ArrayList<>();
|
|
346
|
+ for(Map<String,Object> cmap : classListMap){
|
|
347
|
+ int classid = (int)cmap.get("classid");
|
|
348
|
+ Map<String,Object> classMap = new HashMap<>();
|
|
349
|
+ classMap.put("classid",classid);
|
|
350
|
+ MsrClassQuestion classQues = entryList.stream().filter(m -> m.getClassid() == classid).findFirst().orElse(null);
|
|
351
|
+ if(classQues!= null){
|
|
352
|
+ classMap.put("scorerate",classQues.getScorerate());
|
|
353
|
+ }else{
|
|
354
|
+ classMap.put("scorerate",0);
|
|
355
|
+ }
|
|
356
|
+ classQueList.add(classMap);
|
|
357
|
+ }
|
|
358
|
+ queMap.put("questions",classQueList);
|
|
359
|
+ quesList.add(queMap);
|
|
360
|
+ }
|
|
361
|
+
|
|
362
|
+ Map<String,Object> rtnMap = new HashMap<>();
|
|
363
|
+ rtnMap.put("questions",quesList);
|
|
364
|
+ rtnMap.put("classList",classListMap);
|
|
365
|
+ return rtnMap;
|
|
366
|
+ }
|
|
367
|
+ //班级报告-单个班级-学科试题考试内在表现
|
|
368
|
+ public Map<String,Object> listQuestionForBjStks(ExamReportParams params){
|
|
369
|
+
|
|
370
|
+ //类似学科报告,获取数据
|
|
371
|
+ Map<String,Object> rtnMap = listQuestionForXhXhstQfd(params);
|
|
372
|
+
|
|
373
|
+ //所有选择的班级和年级的试题情况
|
|
374
|
+ params.setSelclass(3);
|
|
375
|
+ Integer classid = params.getClassid();
|
|
376
|
+ params.setClassids("0," + params.getClassid());
|
|
377
|
+ List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
|
|
378
|
+
|
|
379
|
+ //获取所有试题难度分组参数
|
|
380
|
+ MsrReportparam ndParam = msrReportparamMapper.getReportparamByRpbelongSubjectType(params.getExamid(),"quesummary","all",params.getSubjectid(),1);
|
|
381
|
+ List<SzJsonVo> jsonList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
|
|
382
|
+ List<Map<String,Object>> ndList = new ArrayList<>();
|
|
383
|
+ for(SzJsonVo szvo : jsonList){
|
|
384
|
+ Map<String,Object> zsndMap = new HashMap<>();
|
|
385
|
+ zsndMap.put("djkey",szvo.getDjkey());
|
|
386
|
+ //获取该难度下所有试题
|
|
387
|
+ List<MsrClassQuestion> ndQues = questions.stream().filter(m -> m.getNdms().equals(szvo.getDjkey())).collect(Collectors.toList());
|
|
388
|
+ //处理全体班级情况
|
|
389
|
+ List<MsrClassQuestion> schoolQues = ndQues.stream().filter(m -> m.getClassid() == 0).collect(Collectors.toList());
|
|
390
|
+ if(schoolQues.isEmpty()){
|
|
391
|
+ zsndMap.put("schoolscorerate", 0);
|
|
392
|
+ }else{
|
|
393
|
+ //获取年级的
|
|
394
|
+ List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
|
|
395
|
+ double sumScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
|
|
396
|
+ zsndMap.put("schoolscorerate", MarkingUtil.div(sumScoreRate,qnList.size()));
|
|
397
|
+ }
|
|
398
|
+
|
|
399
|
+ //获取班级的情况
|
|
400
|
+ List<MsrClassQuestion> classQues = ndQues.stream().filter(m -> m.getClassid().equals(classid)).collect(Collectors.toList());
|
|
401
|
+ if(classQues.isEmpty()){
|
|
402
|
+ zsndMap.put("classscorerate", 0);
|
|
403
|
+ }else{
|
|
404
|
+ List<String> qnList = schoolQues.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
|
|
405
|
+ double classScoreRate = schoolQues.stream().mapToDouble(MsrClassQuestion::getScorerate).sum();
|
|
406
|
+ zsndMap.put("classscorerate",MarkingUtil.div(classScoreRate,qnList.size()));
|
|
407
|
+ }
|
|
408
|
+
|
|
409
|
+ ndList.add(zsndMap);
|
255
|
410
|
}
|
|
411
|
+ rtnMap.put("ndList",ndList);
|
|
412
|
+ return rtnMap;
|
|
413
|
+ }
|
|
414
|
+
|
|
415
|
+ //命题质量报告-命题分析-试题分析指标明细表
|
|
416
|
+ public List<Map<String,Object>> listMtzlStfxQuestions(ExamReportParams params){
|
|
417
|
+ return msrClassQuestionMapper.listMtzlMtfxQuestions(params);
|
256
|
418
|
}
|
257
|
419
|
|
|
420
|
+ //命题质量报告-命题分析-试题难度分布结构表
|
|
421
|
+ public void listMtzlStnds(ExamReportParams params){
|
|
422
|
+ //获取本学科整体难度
|
|
423
|
+ params.setSelclass(4);
|
|
424
|
+ params.setClassid(0);
|
|
425
|
+ List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
|
|
426
|
+ }
|
258
|
427
|
|
259
|
428
|
}
|