|
@@ -406,14 +406,14 @@ public class MsPaperCheckTeacherTaskService {
|
406
|
406
|
checked = 3;
|
407
|
407
|
}
|
408
|
408
|
if (correcttype.equals(3)) {//按题块批阅
|
409
|
|
- checkscore = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
|
|
409
|
+ checkscore = questions.stream().map(q -> q.getStuscore().toString()).collect(Collectors.joining(";"));
|
410
|
410
|
//题块批阅信息
|
411
|
411
|
MsPaperStudentBlock block = new MsPaperStudentBlock();
|
412
|
412
|
block.setMpsbid(mpsbid);
|
413
|
413
|
block.setChecked(checked);
|
414
|
414
|
block.setFirstcid(handleid);
|
415
|
415
|
block.setFirstcime(N_Utils.getSecondTimestamp());
|
416
|
|
- String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergestuscore).collect(Collectors.joining(";"));
|
|
416
|
+ String stuscores = questions.stream().map(q -> q.getStuscore().toString()).collect(Collectors.joining(";"));
|
417
|
417
|
block.setFirstccores(stuscores);
|
418
|
418
|
block.setFirstccore(arbitratescore);
|
419
|
419
|
block.setHasgood(hasgood);
|
|
@@ -438,12 +438,13 @@ public class MsPaperCheckTeacherTaskService {
|
438
|
438
|
studentQuestions.add(studentQuestion);
|
439
|
439
|
} else {
|
440
|
440
|
String[] mptqids = question.getMergeqid().split(",");
|
441
|
|
- String[] mergestuscore = question.getMergestuscore().split(",");
|
|
441
|
+ String[] mergescores = question.getMergescore().split(",");
|
|
442
|
+ double[] scores = setStuScore(mergescores, stuscore);//计算学生小题得分
|
442
|
443
|
for (int i = 0; i < mptqids.length; i++) {
|
443
|
444
|
MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
444
|
445
|
studentQuestion.setMptqid(N_Utils.obj2Int(mptqids[i]));
|
445
|
|
- studentQuestion.setFirstccore(MarkingUtil.objToDouble(mergestuscore[i]));
|
446
|
|
- studentQuestion.setStuscore(MarkingUtil.objToDouble(mergestuscore[i]));
|
|
446
|
+ studentQuestion.setFirstccore(scores[i]);
|
|
447
|
+ studentQuestion.setStuscore(scores[i]);
|
447
|
448
|
studentQuestions.add(studentQuestion);
|
448
|
449
|
}
|
449
|
450
|
}
|
|
@@ -506,7 +507,7 @@ public class MsPaperCheckTeacherTaskService {
|
506
|
507
|
//题块批阅信息
|
507
|
508
|
MsPaperStudentBlock block = new MsPaperStudentBlock();
|
508
|
509
|
block.setMpsbid(mpsbid);
|
509
|
|
- String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergestuscore).collect(Collectors.joining(";"));
|
|
510
|
+ String stuscores = questions.stream().map(q -> q.getStuscore().toString()).collect(Collectors.joining(";"));
|
510
|
511
|
String[] cores = new String[0];
|
511
|
512
|
if (type.equals(1)) {
|
512
|
513
|
block.setFirstcid(handleid);
|
|
@@ -553,11 +554,7 @@ public class MsPaperCheckTeacherTaskService {
|
553
|
554
|
} else {
|
554
|
555
|
String[] mptqids = question.getMergeqid().split(",");
|
555
|
556
|
String[] mergescores = question.getMergescore().split(",");
|
556
|
|
- String[] mergestuscore = question.getMergestuscore().split(",");
|
557
|
|
- double[] scores = new double[mergestuscore.length];
|
558
|
|
- for (int i = 0; i < mergestuscore.length; i++) {
|
559
|
|
- scores[i]=MarkingUtil.objToDouble(mergestuscore[i]);
|
560
|
|
- }
|
|
557
|
+ double[] scores = setStuScore(mergescores, stuscore);//计算学生小题得分
|
561
|
558
|
String[] cores2 = new String[0];
|
562
|
559
|
if (corrected) cores2 = cores[j].split(",");
|
563
|
560
|
for (int i = 0; i < mptqids.length; i++) {
|
|
@@ -639,6 +636,19 @@ public class MsPaperCheckTeacherTaskService {
|
639
|
636
|
if (checked == 3) msPaperStudentMapper.updateStudentPaperScoreByMpsId(mpsid);//更新学生总分
|
640
|
637
|
}
|
641
|
638
|
|
|
639
|
+ //计算学生小题得分
|
|
640
|
+ private double[] setStuScore(String[] mergescores, Double stuscore) {
|
|
641
|
+ double totalScore = 0;
|
|
642
|
+ for (String mergescore : mergescores) {
|
|
643
|
+ totalScore = MarkingUtil.add(mergescore, totalScore);
|
|
644
|
+ }
|
|
645
|
+ double[] scores = new double[mergescores.length];
|
|
646
|
+ for (int i = 0; i < mergescores.length; i++) {
|
|
647
|
+ scores[i] = MarkingUtil.mul(stuscore, MarkingUtil.div(mergescores[i], totalScore));
|
|
648
|
+ }
|
|
649
|
+ return scores;
|
|
650
|
+ }
|
|
651
|
+
|
642
|
652
|
//最终得分计算
|
643
|
653
|
private Double getUserScore(Integer finalscore, double addScore, Double roundvalue) {
|
644
|
654
|
double score;
|