|
@@ -4,8 +4,14 @@ import com.alibaba.fastjson.JSON;
|
4
|
4
|
import com.xhkjedu.smarking.mapper.exam.MsClassStudentMapper;
|
5
|
5
|
import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
|
6
|
6
|
import com.xhkjedu.smarking.mapper.paper.MsPaperQtypeQuestionMapper;
|
|
7
|
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQobjsubMapper;
|
|
8
|
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQtypeMapper;
|
|
9
|
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQuestionMapper;
|
|
10
|
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQuestionObjMapper;
|
7
|
11
|
import com.xhkjedu.smarking.mapper.report.reportother.MsrReportparamMapper;
|
8
|
12
|
import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
|
|
13
|
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectQuestionRankgroupMapper;
|
|
14
|
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectQuestionSectionMapper;
|
9
|
15
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
|
10
|
16
|
import com.xhkjedu.smarking.model.exam.MsClassStudent;
|
11
|
17
|
import com.xhkjedu.smarking.model.paper.MsPaper;
|
|
@@ -49,6 +55,19 @@ public class ReportGenerateQuestionService {
|
49
|
55
|
private MsrReportparamMapper msrReportparamMapper;
|
50
|
56
|
@Resource
|
51
|
57
|
private MsrStudentMapper msrStudentMapper;
|
|
58
|
+ @Resource
|
|
59
|
+ private MsrClassQuestionMapper msrClassQuestionMapper;
|
|
60
|
+ @Resource
|
|
61
|
+ private MsrClassQuestionObjMapper msrClassQuestionObjMapper;
|
|
62
|
+ @Resource
|
|
63
|
+ private MsrClassQobjsubMapper msrClassQobjsubMapper;
|
|
64
|
+ @Resource
|
|
65
|
+ private MsrClassQtypeMapper msrClassQtypeMapper;
|
|
66
|
+ @Resource
|
|
67
|
+ MsrSubjectQuestionRankgroupMapper msrSubjectQuestionRankgroupMapper;
|
|
68
|
+ @Resource
|
|
69
|
+ MsrSubjectQuestionSectionMapper msrSubjectQuestionSectionMapper;
|
|
70
|
+
|
52
|
71
|
|
53
|
72
|
public void generateQuestion(Integer examid, Integer exammode) {
|
54
|
73
|
// 查询所有学生试题
|
|
@@ -78,6 +97,8 @@ public class ReportGenerateQuestionService {
|
78
|
97
|
handleQuestion(subjectStuQuestions, subjectClassStudents, questions, subjectParams, subjectStuPapers, examid, subjectid,subject.getPscore());
|
79
|
98
|
//处理题型
|
80
|
99
|
handleQtype(subjectStuQuestions, subjectClassStudents, questions, subjectParams, examid, subjectid);
|
|
100
|
+ //客观题、主观题
|
|
101
|
+ handleObjSub(subjectStuQuestions, subjectClassStudents, questions, subjectStuPapers, examid, subjectid,subject.getPscore());
|
81
|
102
|
}
|
82
|
103
|
}
|
83
|
104
|
|
|
@@ -88,7 +109,7 @@ public class ReportGenerateQuestionService {
|
88
|
109
|
List<MsrClassQuestion> saveQuestions = new ArrayList<>();// 小题分析
|
89
|
110
|
List<MsrClassQuestionObj> saveQuestionObjs = new ArrayList<>();// 小题-客观题选项分析
|
90
|
111
|
List<MsrSubjectQuestionSection> saveSectionQuestions = new ArrayList<>();// 学科分段之间学生在该题的整体得分率
|
91
|
|
- List<MsrSubjectQuestionRankgroup> saveRankGroupQuestions = new ArrayList<>();
|
|
112
|
+ List<MsrSubjectQuestionRankgroup> saveRankGroupQuestions = new ArrayList<>();//分组分数分布
|
92
|
113
|
|
93
|
114
|
// 获取学生科目得分-科目默认分段学生
|
94
|
115
|
List<MsrSubjectQuestionSection> subjectSectionQuestions = subjectSectionForQuestion(subjectStuPapers, pscore);
|
|
@@ -114,6 +135,8 @@ public class ReportGenerateQuestionService {
|
114
|
135
|
schoolQ.setSchoolminscore(minScore);
|
115
|
136
|
schoolQ.setSchoolavgscore(avgScore);
|
116
|
137
|
schoolQ.setSchoolavgrate(avgScoreRate);
|
|
138
|
+ schoolQ.setMptqid(question.getMptqid());
|
|
139
|
+ schoolQ.setQn(question.getMptqn() + "." + question.getQn());
|
117
|
140
|
// 全校班级试题情况
|
118
|
141
|
MsrClassQuestion schoolQue = questionClass(stuQuestions, question, params, schoolQ);
|
119
|
142
|
saveQuestions.add(schoolQue);
|
|
@@ -130,10 +153,10 @@ public class ReportGenerateQuestionService {
|
130
|
153
|
}
|
131
|
154
|
|
132
|
155
|
// 学科分段之间学生在该题的整体得分率
|
133
|
|
- List<MsrSubjectQuestionSection> sectionQuestions = subjectSectionQuestion(stuQuestions, subjectSectionQuestions, question);
|
|
156
|
+ List<MsrSubjectQuestionSection> sectionQuestions = subjectSectionQuestion(stuQuestions, subjectSectionQuestions, 1,question.getQscore(),question.getMptqid());
|
134
|
157
|
saveSectionQuestions.addAll(sectionQuestions);
|
135
|
158
|
//试题分组分数分布、客观题选项分组
|
136
|
|
- List<MsrSubjectQuestionRankgroup> rankGroupQuestions = questionScoreRankGroup(stuQuestions, subjectStuPapers,examid,subjectid,question);
|
|
159
|
+ List<MsrSubjectQuestionRankgroup> rankGroupQuestions = questionScoreRankGroup(stuQuestions, subjectStuPapers,examid,subjectid,question.getQtype(),question.getQscore(),question.getQtype());
|
137
|
160
|
saveRankGroupQuestions.addAll(rankGroupQuestions);
|
138
|
161
|
|
139
|
162
|
// 班级试题分析
|
|
@@ -157,6 +180,12 @@ public class ReportGenerateQuestionService {
|
157
|
180
|
}
|
158
|
181
|
}
|
159
|
182
|
}
|
|
183
|
+
|
|
184
|
+ if(!saveQuestions.isEmpty()) msrClassQuestionMapper.insertList(saveQuestions);
|
|
185
|
+ if(!saveQuestionObjs.isEmpty()) msrClassQuestionObjMapper.insertList(saveQuestionObjs);
|
|
186
|
+ if(!saveSectionQuestions.isEmpty()) msrSubjectQuestionSectionMapper.insertList(saveSectionQuestions);
|
|
187
|
+ if(!saveRankGroupQuestions.isEmpty()) msrSubjectQuestionRankgroupMapper.insertList(saveRankGroupQuestions);
|
|
188
|
+
|
160
|
189
|
}
|
161
|
190
|
|
162
|
191
|
// 单个试题分析-学校、班级分析
|
|
@@ -221,13 +250,13 @@ public class ReportGenerateQuestionService {
|
221
|
250
|
List<MsPaperStudentQuestion> fullStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore().equals(q.getQscore())).collect(Collectors.toList());
|
222
|
251
|
String mfids = fullStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 满分学生id
|
223
|
252
|
classQ.setMfnum(fullStuQuestions.size());
|
224
|
|
- classQ.setMfrate(MarkingUtil.div(classQ.getMfnum(), stunum));////正确率、满分人数占比
|
|
253
|
+ classQ.setMfrate(MarkingUtil.calculateRate(classQ.getMfnum(), stunum));////正确率、满分人数占比
|
225
|
254
|
classQ.setMfids(mfids);
|
226
|
255
|
// 获取零分学生
|
227
|
256
|
List<MsPaperStudentQuestion> lfStuQuestions = stuQuestions.stream().filter(q -> q.getStuscore() == 0).collect(Collectors.toList());
|
228
|
257
|
String lfids = lfStuQuestions.stream().map(p -> p.getStudentid().toString()).collect(Collectors.joining(","));// 零分学生id
|
229
|
258
|
classQ.setLfnum(lfStuQuestions.size());
|
230
|
|
- classQ.setLfrate(MarkingUtil.div(lfStuQuestions.size(), stunum));////零分人数占比
|
|
259
|
+ classQ.setLfrate(MarkingUtil.calculateRate(lfStuQuestions.size(), stunum));////零分人数占比
|
231
|
260
|
classQ.setLfids(lfids);
|
232
|
261
|
return classQ;
|
233
|
262
|
}
|
|
@@ -287,17 +316,17 @@ public class ReportGenerateQuestionService {
|
287
|
316
|
return qobjList;
|
288
|
317
|
}
|
289
|
318
|
// 单个试题分析-小题分组分布、客观题选项分组分布
|
290
|
|
- private List<MsrSubjectQuestionRankgroup> questionScoreRankGroup(List<MsPaperStudentQuestion> stuQuestions,List<MsrStudent> stuPapers,Integer examid,String subjectid,MsPaperQtypeQuestion question){
|
|
319
|
+ private List<MsrSubjectQuestionRankgroup> questionScoreRankGroup(List<MsPaperStudentQuestion> stuQuestions,List<MsrStudent> stuPapers,Integer examid,String subjectid,Integer qtype,Double fullScore,Integer mptqid){
|
291
|
320
|
//获取学生排名最大名次的树
|
292
|
321
|
Integer totalRank = stuPapers.stream().mapToInt(MsrStudent::getSchoolrank).max().orElse(0);
|
293
|
322
|
//获取排名分组,默认分为7组
|
294
|
323
|
List<RankGroupVo> rankGroups = MarkingUtil.rankGroup(totalRank,7);
|
295
|
324
|
//获取试题分段,1分1段
|
296
|
|
- List<SectionScoreVo> sectionScores = MarkingUtil.fdScoreForOne(question.getQscore());
|
|
325
|
+ List<SectionScoreVo> sectionScores = MarkingUtil.fdScoreForOne(fullScore);
|
297
|
326
|
|
298
|
327
|
//获取所有客观题选项内容
|
299
|
328
|
List<String> options = new ArrayList<>();
|
300
|
|
- if(question.getQtype() == 1){
|
|
329
|
+ if(qtype == 1){
|
301
|
330
|
options = stuQuestions.stream().map(MsPaperStudentQuestion::getStuanswer).distinct().collect(Collectors.toList());
|
302
|
331
|
}
|
303
|
332
|
|
|
@@ -308,10 +337,24 @@ public class ReportGenerateQuestionService {
|
308
|
337
|
MsrSubjectQuestionRankgroup sqr = new MsrSubjectQuestionRankgroup();
|
309
|
338
|
sqr.setExamid(examid);
|
310
|
339
|
sqr.setSubjectid(subjectid);
|
311
|
|
- sqr.setQntype(1);
|
312
|
|
- sqr.setMptqid(question.getMptqid());
|
|
340
|
+ if(qtype == 1){
|
|
341
|
+ sqr.setQntype(1);//类型1小题2客观题3主观题
|
|
342
|
+ sqr.setRgtype(1);//类型1客观题选项 2客/主分值
|
|
343
|
+ }else{
|
|
344
|
+ //类型1小题2客观题3主观题
|
|
345
|
+ if(qtype == 2){
|
|
346
|
+ sqr.setQntype(1);
|
|
347
|
+ }else if(qtype == 11){
|
|
348
|
+ sqr.setQntype(2);
|
|
349
|
+ }else{
|
|
350
|
+ sqr.setQntype(3);
|
|
351
|
+ }
|
|
352
|
+
|
|
353
|
+ sqr.setRgtype(2);//类型1客观题选项 2客/主分值
|
|
354
|
+ }
|
|
355
|
+ sqr.setMptqid(mptqid);
|
313
|
356
|
sqr.setRgroup(rankGroup.getGroupname());
|
314
|
|
- sqr.setRgtype(2);
|
|
357
|
+
|
315
|
358
|
List<Integer> groupStuids;
|
316
|
359
|
List<MsPaperStudentQuestion> groupStuQuestions = null;
|
317
|
360
|
if(!groupStus.isEmpty()){
|
|
@@ -322,8 +365,8 @@ public class ReportGenerateQuestionService {
|
322
|
365
|
double avgScore = MarkingUtil.div(sumScore, groupStuQuestions.size());
|
323
|
366
|
sqr.setStunum(groupStuQuestions.size());
|
324
|
367
|
sqr.setStuids(groupStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
|
325
|
|
- sqr.setScorerate(MarkingUtil.calculateRate(sumScore, groupStuQuestions.size() * question.getQscore()));
|
326
|
|
- sqr.setAvgrate(MarkingUtil.calculateRate(avgScore, question.getQscore()));
|
|
368
|
+ sqr.setScorerate(MarkingUtil.calculateRate(sumScore, groupStuQuestions.size() * fullScore));
|
|
369
|
+ sqr.setAvgrate(MarkingUtil.calculateRate(avgScore, fullScore));
|
327
|
370
|
} else {
|
328
|
371
|
groupStuids = null;
|
329
|
372
|
sqr.setStunum(0);
|
|
@@ -337,7 +380,7 @@ public class ReportGenerateQuestionService {
|
337
|
380
|
sqrg.setExamid(examid);
|
338
|
381
|
sqrg.setSubjectid(subjectid);
|
339
|
382
|
sqrg.setQntype(1);
|
340
|
|
- sqrg.setMptqid(question.getMptqid());
|
|
383
|
+ sqrg.setMptqid(mptqid);
|
341
|
384
|
sqrg.setRgroup(rankGroup.getGroupname());
|
342
|
385
|
sqrg.setRgtype(2);
|
343
|
386
|
sqrg.setRgvalue(sectionScore.getSectionname());
|
|
@@ -345,7 +388,7 @@ public class ReportGenerateQuestionService {
|
345
|
388
|
if(groupStuids != null && !groupStuids.isEmpty()){
|
346
|
389
|
//名次分组下有学生,进行学生分数段计算
|
347
|
390
|
List<MsPaperStudentQuestion> sectionStuQuestions;
|
348
|
|
- if(sectionScore.getMinvalue() == question.getQscore()){
|
|
391
|
+ if(sectionScore.getMinvalue() == fullScore){
|
349
|
392
|
//最小值为满分时分段形式为[qscore,qscore)
|
350
|
393
|
sectionStuQuestions = groupStuQuestions.stream().filter(q -> q.getStuscore() >= sectionScore.getMinvalue()).collect(Collectors.toList());
|
351
|
394
|
}else{
|
|
@@ -355,8 +398,8 @@ public class ReportGenerateQuestionService {
|
355
|
398
|
double sectionStuAvgScore = MarkingUtil.div(sectionStuSumScore, sectionStuQuestions.size());
|
356
|
399
|
sqrg.setStunum(sectionStuQuestions.size());
|
357
|
400
|
sqrg.setStuids(sectionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
|
358
|
|
- sqrg.setScorerate(MarkingUtil.calculateRate(sectionStuSumScore, sectionStuQuestions.size() * question.getQscore()));
|
359
|
|
- sqrg.setAvgrate(MarkingUtil.calculateRate(sectionStuAvgScore, question.getQscore()));
|
|
401
|
+ sqrg.setScorerate(MarkingUtil.calculateRate(sectionStuSumScore, sectionStuQuestions.size() * fullScore));
|
|
402
|
+ sqrg.setAvgrate(MarkingUtil.calculateRate(sectionStuAvgScore, fullScore));
|
360
|
403
|
}else{
|
361
|
404
|
sqrg.setStunum(0);
|
362
|
405
|
sqrg.setScorerate(0.0);
|
|
@@ -366,7 +409,7 @@ public class ReportGenerateQuestionService {
|
366
|
409
|
}
|
367
|
410
|
|
368
|
411
|
//客观题选项
|
369
|
|
- if(question.getQtype() == 1){
|
|
412
|
+ if(qtype == 1){
|
370
|
413
|
if(options.isEmpty()){
|
371
|
414
|
options = new ArrayList<>();
|
372
|
415
|
options.add("");
|
|
@@ -395,8 +438,8 @@ public class ReportGenerateQuestionService {
|
395
|
438
|
|
396
|
439
|
optionObj.setStunum(optionStuQuestions.size());
|
397
|
440
|
optionObj.setStuids(optionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
|
398
|
|
- optionObj.setScorerate(MarkingUtil.calculateRate(optionStuSumScore, optionStuQuestions.size() * question.getQscore()));
|
399
|
|
- optionObj.setAvgrate(MarkingUtil.calculateRate(optionStuAvgScore, question.getQscore()));
|
|
441
|
+ optionObj.setScorerate(MarkingUtil.calculateRate(optionStuSumScore, optionStuQuestions.size() * fullScore));
|
|
442
|
+ optionObj.setAvgrate(MarkingUtil.calculateRate(optionStuAvgScore, fullScore));
|
400
|
443
|
}else{
|
401
|
444
|
optionObj.setStunum(0);
|
402
|
445
|
optionObj.setScorerate(0.0);
|
|
@@ -439,7 +482,7 @@ public class ReportGenerateQuestionService {
|
439
|
482
|
|
440
|
483
|
// 单个试题分析-科目分段区间得分率
|
441
|
484
|
private List<MsrSubjectQuestionSection> subjectSectionQuestion(List<MsPaperStudentQuestion> stuQuestions, List<MsrSubjectQuestionSection> sections,
|
442
|
|
- MsPaperQtypeQuestion question) {
|
|
485
|
+ Integer qtype,Double fullScore,Integer mptqid) {
|
443
|
486
|
List<MsrSubjectQuestionSection> rtnList = new ArrayList<>();
|
444
|
487
|
for (MsrSubjectQuestionSection section : sections) {
|
445
|
488
|
String[] userids = section.getFdids().split(",");
|
|
@@ -451,11 +494,15 @@ public class ReportGenerateQuestionService {
|
451
|
494
|
// 获取平均分
|
452
|
495
|
double avgScore = MarkingUtil.div(sumScore, stuNum);
|
453
|
496
|
// 获取平均得分率
|
454
|
|
- double avgScoreRate = MarkingUtil.calculateRate(avgScore, question.getQscore());
|
|
497
|
+ double avgScoreRate = MarkingUtil.calculateRate(avgScore, fullScore);
|
455
|
498
|
section.setAvgscore(avgScore);
|
456
|
499
|
section.setAvgrate(avgScoreRate);
|
457
|
|
- section.setQntype(1);
|
458
|
|
- section.setMptqid(question.getMptqid());
|
|
500
|
+ if(qtype == 1){
|
|
501
|
+ section.setQntype(qtype);//类型1小题2客观题3主观题
|
|
502
|
+ }else{
|
|
503
|
+ section.setQntype(qtype+1);
|
|
504
|
+ }
|
|
505
|
+ section.setMptqid(mptqid);
|
459
|
506
|
rtnList.add(section);
|
460
|
507
|
}
|
461
|
508
|
return rtnList;
|
|
@@ -463,7 +510,7 @@ public class ReportGenerateQuestionService {
|
463
|
510
|
|
464
|
511
|
// 题型分析
|
465
|
512
|
private void handleQtype(List<MsPaperStudentQuestion> subjectStuQuestions,List<MsClassStudent> subjectClassStudents, List<MsPaperQtypeQuestion> questions,
|
466
|
|
- List<MsrReportparam> params,Integer examid, String subjectid) {
|
|
513
|
+ List<MsrReportparam> params,Integer examid, String subjectid) {
|
467
|
514
|
List<MsrClassQtype> saveQtypes = new ArrayList<>();//班级题型分析
|
468
|
515
|
// 处理大题
|
469
|
516
|
Map<Integer, List<MsPaperQtypeQuestion>> qtypeMap = questions.stream().collect(Collectors.groupingBy(MsPaperQtypeQuestion::getMptid));
|
|
@@ -503,6 +550,7 @@ public class ReportGenerateQuestionService {
|
503
|
550
|
saveQtypes.add(qtypeClass);
|
504
|
551
|
}
|
505
|
552
|
}
|
|
553
|
+ if(!saveQtypes.isEmpty()) msrClassQtypeMapper.insertList(saveQtypes);
|
506
|
554
|
}
|
507
|
555
|
// 题型分析-学校、班级分析
|
508
|
556
|
private MsrClassQtype qtypeClass(List<MsPaperStudentQuestion> stuQuestions, List<MsrReportparam> params,MsrClassQtype schoolQtype){
|
|
@@ -545,13 +593,13 @@ public class ReportGenerateQuestionService {
|
545
|
593
|
classQtype.setQfd(MarkingUtil.qfd(stuScores));
|
546
|
594
|
classQtype.setQfdms(questionNdAndQfd(params, 2, schoolQtype.getQfd())[0]);
|
547
|
595
|
classQtype.setMfnum(mfnum);
|
548
|
|
- classQtype.setMfrate(MarkingUtil.div(mfnum, stuNum));
|
|
596
|
+ classQtype.setMfrate(MarkingUtil.calculateRate(mfnum, stuNum));
|
549
|
597
|
if(mfnum > 0){
|
550
|
598
|
schoolQtype.setMfids(mfids.substring(0,mfids.length()-1));
|
551
|
599
|
}
|
552
|
600
|
classQtype.setMfids(mfids.toString());
|
553
|
601
|
classQtype.setLfnum(lfnum);
|
554
|
|
- classQtype.setLfrate(MarkingUtil.div(lfnum, stuNum));
|
|
602
|
+ classQtype.setLfrate(MarkingUtil.calculateRate(lfnum, stuNum));
|
555
|
603
|
if(lfnum > 0){
|
556
|
604
|
classQtype.setMfids(lfids.substring(0,lfids.length()-1));
|
557
|
605
|
}
|
|
@@ -561,9 +609,14 @@ public class ReportGenerateQuestionService {
|
561
|
609
|
|
562
|
610
|
//客观题/主观题分析
|
563
|
611
|
private void handleObjSub(List<MsPaperStudentQuestion> subjectStuQuestions,List<MsClassStudent> subjectClassStudents, List<MsPaperQtypeQuestion> questions,
|
564
|
|
- List<MsrReportparam> params,Integer examid, String subjectid){
|
|
612
|
+ List<MsrStudent> subjectStuPapers,Integer examid, String subjectid,Double pscore){
|
565
|
613
|
|
566
|
614
|
List<MsrClassQobjsub> saveObjSubs = new ArrayList<>();//客观题/主观题分析
|
|
615
|
+ List<MsrSubjectQuestionSection> saveSectionQuestions = new ArrayList<>();// 学科分段之间学生在该题的整体得分率
|
|
616
|
+ List<MsrSubjectQuestionRankgroup> saveRankGroupQuestions = new ArrayList<>();//分组分数分布
|
|
617
|
+
|
|
618
|
+ // 获取学生科目得分-科目默认分段学生
|
|
619
|
+ List<MsrSubjectQuestionSection> subjectSectionQuestions = subjectSectionForQuestion(subjectStuPapers, pscore);
|
567
|
620
|
|
568
|
621
|
//根据试题类型分组
|
569
|
622
|
Map<Integer,List<MsPaperQtypeQuestion>> objSubMap = questions.stream().collect(Collectors.groupingBy(MsPaperQtypeQuestion::getQtype));
|
|
@@ -584,6 +637,21 @@ public class ReportGenerateQuestionService {
|
584
|
637
|
MsrClassQobjsub objSubSchool = qobjsubClass(stuQuestions, schoolObjSub);
|
585
|
638
|
saveObjSubs.add(objSubSchool);
|
586
|
639
|
|
|
640
|
+ // 学科分段之间学生在该题的整体得分率,qntype=1小题2客观题3主观题
|
|
641
|
+ List<MsrSubjectQuestionSection> sectionQuestions = subjectSectionQuestion(stuQuestions, subjectSectionQuestions,entry.getKey(), fullScore,null);
|
|
642
|
+ saveSectionQuestions.addAll(sectionQuestions);
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+ Integer qobjsubtype;//为了区分表中存放值
|
|
646
|
+ if(entry.getKey() == 1){
|
|
647
|
+ qobjsubtype = 11;
|
|
648
|
+ }else{
|
|
649
|
+ qobjsubtype = 12;
|
|
650
|
+ }
|
|
651
|
+ //试题分组分数分布、客观题选项分组、客观题主观题分组分数分布
|
|
652
|
+ List<MsrSubjectQuestionRankgroup> rankGroupQuestions = questionScoreRankGroup(stuQuestions, subjectStuPapers,examid,subjectid, qobjsubtype, fullScore,null);
|
|
653
|
+ saveRankGroupQuestions.addAll(rankGroupQuestions);
|
|
654
|
+
|
587
|
655
|
List<Integer> classIds = subjectClassStudents.stream().map(MsClassStudent::getClassid).distinct().collect(Collectors.toList());
|
588
|
656
|
for (Integer classid : classIds) {
|
589
|
657
|
schoolObjSub.setClassid(classid);
|
|
@@ -597,6 +665,10 @@ public class ReportGenerateQuestionService {
|
597
|
665
|
saveObjSubs.add(objSubClass);
|
598
|
666
|
}
|
599
|
667
|
}
|
|
668
|
+
|
|
669
|
+ if(!saveObjSubs.isEmpty()) msrClassQobjsubMapper.insertList(saveObjSubs);
|
|
670
|
+ if(!saveSectionQuestions.isEmpty()) msrSubjectQuestionSectionMapper.insertList(saveSectionQuestions);
|
|
671
|
+ if(!saveRankGroupQuestions.isEmpty()) msrSubjectQuestionRankgroupMapper.insertList(saveRankGroupQuestions);
|
600
|
672
|
}
|
601
|
673
|
//客观题/主观题分析--学校、班级分析
|
602
|
674
|
private MsrClassQobjsub qobjsubClass(List<MsPaperStudentQuestion> stuQuestions, MsrClassQobjsub schoolObjsub){
|
|
@@ -643,12 +715,12 @@ public class ReportGenerateQuestionService {
|
643
|
715
|
objSub.setCyxs(MarkingUtil.div(objSub.getBzc(), avgScore));
|
644
|
716
|
objSub.setJbzs(MarkingUtil.jbzs(stuScores, stuScoreRate));
|
645
|
717
|
objSub.setMfnum(mfnum);
|
646
|
|
- objSub.setMfrate(MarkingUtil.div(mfnum, stuNum));
|
|
718
|
+ objSub.setMfrate(MarkingUtil.calculateRate(mfnum, stuNum));
|
647
|
719
|
if(mfnum > 0){
|
648
|
720
|
objSub.setMfids(mfids.substring(0,mfids.length()-1));
|
649
|
721
|
}
|
650
|
722
|
objSub.setLfnum(lfnum);
|
651
|
|
- objSub.setLfrate(MarkingUtil.div(lfnum, stuNum));
|
|
723
|
+ objSub.setLfrate(MarkingUtil.calculateRate(lfnum, stuNum));
|
652
|
724
|
if(lfnum > 0){
|
653
|
725
|
objSub.setLfids(lfids.substring(0,lfids.length()-1));
|
654
|
726
|
}
|