|
@@ -9,6 +9,7 @@ import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
|
9
|
9
|
import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectClassMapper;
|
10
|
10
|
import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectMapper;
|
11
|
11
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentMapper;
|
|
12
|
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
|
12
|
13
|
import com.xhkjedu.smarking.model.exam.*;
|
13
|
14
|
import com.xhkjedu.smarking.model.paper.MsPaper;
|
14
|
15
|
import com.xhkjedu.smarking.model.report.reportclass.*;
|
|
@@ -18,6 +19,8 @@ import com.xhkjedu.smarking.model.report.reportstu.MsrStudent;
|
18
|
19
|
import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
|
19
|
20
|
import com.xhkjedu.smarking.model.report.reportsubject.MsrSubjectClass;
|
20
|
21
|
import com.xhkjedu.smarking.utils.MarkingUtil;
|
|
22
|
+import com.xhkjedu.smarking.vo.paper.SQScoreVo;
|
|
23
|
+import com.xhkjedu.smarking.vo.paper.SQuestionVo;
|
21
|
24
|
import com.xhkjedu.smarking.vo.report.reportclass.ClassTopVo;
|
22
|
25
|
import com.xhkjedu.smarking.vo.report.reportclass.RankRateGroupVo;
|
23
|
26
|
import com.xhkjedu.smarking.vo.report.reportother.*;
|
|
@@ -49,6 +52,8 @@ public class MsrExamService {
|
49
|
52
|
@Resource
|
50
|
53
|
private MsPaperStudentMapper paperStudentMapper;
|
51
|
54
|
@Resource
|
|
55
|
+ private MsPaperStudentQuestionMapper paperStudentQuestionMapper;
|
|
56
|
+ @Resource
|
52
|
57
|
private MsrSubjectMapper msrSubjectMapper;
|
53
|
58
|
@Resource
|
54
|
59
|
private MsrStudentMapper msrStudentMapper;
|
|
@@ -101,7 +106,7 @@ public class MsrExamService {
|
101
|
106
|
Integer classnum = N_Utils.obj2Int(classes.stream().map(MsClass::getClassid).distinct().count());
|
102
|
107
|
|
103
|
108
|
//科目分析
|
104
|
|
- Map<String, MsrSubject> subjectMap = saveSubject(examid, paperStudents, subjects);
|
|
109
|
+ Map<String, MsrSubject> subjectMap = saveSubject(examid, paperStudents, subjects, mpids);
|
105
|
110
|
|
106
|
111
|
//学生成绩分析
|
107
|
112
|
List<MsrStudent> msrStudents = saveStudent(examid, subjects, paperStudents, students, subjectMap);
|
|
@@ -265,7 +270,7 @@ public class MsrExamService {
|
265
|
270
|
|
266
|
271
|
//保存科目分析
|
267
|
272
|
public Map<String, MsrSubject> saveSubject(Integer examid, List<MsrStudent> paperStudents
|
268
|
|
- , List<MsPaper> subjects) {
|
|
273
|
+ , List<MsPaper> subjects, List<Integer> mpids) {
|
269
|
274
|
double fullscore = subjects.stream().mapToDouble(MsPaper::getPscore).sum();
|
270
|
275
|
String subjectid;
|
271
|
276
|
//科目分析
|
|
@@ -293,6 +298,20 @@ public class MsrExamService {
|
293
|
298
|
student.setSstate(sstate);
|
294
|
299
|
studentList.add(student);
|
295
|
300
|
}
|
|
301
|
+ List<SQScoreVo> questionScores = paperStudentQuestionMapper.listByMpIds(mpids);//获取参与统计科目单题得分情况
|
|
302
|
+ List<Double> zfmtfc = new ArrayList<>();
|
|
303
|
+ Map<String, List<Double>> dkMtfc = new HashMap<>();
|
|
304
|
+ for (SQScoreVo s : questionScores) {
|
|
305
|
+ List<Double> mtfc = new ArrayList<>();
|
|
306
|
+ List<SQuestionVo> questions = s.getQuestions();
|
|
307
|
+ for (SQuestionVo question : questions) {
|
|
308
|
+ double fc = MarkingUtil.fc(question.getStuscores());
|
|
309
|
+ zfmtfc.add(fc);
|
|
310
|
+ mtfc.add(fc);
|
|
311
|
+ }
|
|
312
|
+ dkMtfc.put(s.getSubjectid(), mtfc);
|
|
313
|
+ }
|
|
314
|
+ msrSubject.setMtfc(zfmtfc);
|
296
|
315
|
setSubject(msrSubject, studentList);
|
297
|
316
|
msrSubjects.add(msrSubject);
|
298
|
317
|
subjectMap.put(subjectid, msrSubject);
|
|
@@ -308,6 +327,7 @@ public class MsrExamService {
|
308
|
327
|
msrSubject.setSubjectname(subject.getSubjectname());
|
309
|
328
|
msrSubject.setFullscore(subject.getPscore());
|
310
|
329
|
studentList = subjectCollect.get(subjectid);
|
|
330
|
+ msrSubject.setMtfc(dkMtfc.get(subjectid));
|
311
|
331
|
setSubject(msrSubject, studentList);
|
312
|
332
|
msrSubjects.add(msrSubject);
|
313
|
333
|
subjectMap.put(subjectid, msrSubject);
|
|
@@ -317,6 +337,14 @@ public class MsrExamService {
|
317
|
337
|
for (MsrSubject subject : msrSubjects) {
|
318
|
338
|
subject.setAvgrank(fspm.get(subject.getAvgscore()));
|
319
|
339
|
subject.setAvgrankrate(MarkingUtil.div(subject.getAvgrank(), subject.getTotalnum()));
|
|
340
|
+ String subjectid1 = subject.getSubjectid();
|
|
341
|
+ int pnum;//试卷中的题目总数
|
|
342
|
+ if ("zf".equals(subjectid1)) {
|
|
343
|
+ pnum = subjects.stream().mapToInt(MsPaper::getPnum).sum();
|
|
344
|
+ } else {
|
|
345
|
+ pnum = subjects.stream().filter(s -> s.getSubjectid().equals(subjectid1)).findFirst().get().getPnum();
|
|
346
|
+ }
|
|
347
|
+ subject.setAxdxs(MarkingUtil.axdxs(pnum, subject.getMtfc(), subject.getZffc()));
|
320
|
348
|
}
|
321
|
349
|
msrSubjectMapper.insertList(msrSubjects);
|
322
|
350
|
return subjectMap;
|
|
@@ -1382,6 +1410,7 @@ public class MsrExamService {
|
1382
|
1410
|
List<Double> scores = studentList.stream().map(MsrStudent::getStuscore).sorted().collect(Collectors.toList());
|
1383
|
1411
|
double bzc = MarkingUtil.bzc(scores);
|
1384
|
1412
|
msrSubject.setBzc(bzc);
|
|
1413
|
+ msrSubject.setZffc(MarkingUtil.fc(scores));
|
1385
|
1414
|
msrSubject.setCyxs(N_Utils.getDoubleDivideAndMulitiply(bzc, avgscore));
|
1386
|
1415
|
msrSubject.setNd(MarkingUtil.div(avgscore, fullscore));
|
1387
|
1416
|
msrSubject.setQfd(MarkingUtil.qfd(scores));
|