|
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
22
|
22
|
|
23
|
23
|
import javax.annotation.Resource;
|
24
|
24
|
import java.util.*;
|
|
25
|
+import java.util.stream.Collectors;
|
25
|
26
|
|
26
|
27
|
/**
|
27
|
28
|
* @Description 阅卷批阅教师任务表 服务实现类
|
|
@@ -311,11 +312,11 @@ public class MsPaperCheckTeacherTaskService {
|
311
|
312
|
Double qscore = param.getQscore();
|
312
|
313
|
List<MsPaperBlockQuestion> questions = param.getQuestions();
|
313
|
314
|
int checked = 1;
|
|
315
|
+ Double firstccore = param.getFirstccore();
|
314
|
316
|
if (checktype.equals(1)) {//单评
|
315
|
317
|
if (hasproblem.equals(0)) {
|
316
|
318
|
checked = 2;
|
317
|
319
|
}
|
318
|
|
- Double firstccore = param.getFirstccore();
|
319
|
320
|
if (correcttype.equals(3)) {//按题块批阅
|
320
|
321
|
//题块批阅信息
|
321
|
322
|
MsPaperStudentBlock block = new MsPaperStudentBlock();
|
|
@@ -375,9 +376,172 @@ public class MsPaperCheckTeacherTaskService {
|
375
|
376
|
question.setHasproblem(hasproblem);
|
376
|
377
|
question.setProblemtype(problemtype);
|
377
|
378
|
question.setProblemcomm(problemcomm);
|
|
379
|
+ question.setStuscore(firstccore);
|
378
|
380
|
msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
|
379
|
381
|
}
|
|
382
|
+ } else {//双评
|
|
383
|
+ Integer handleid = param.getHandleid();
|
|
384
|
+ Integer firstcid = param.getFirstcid();
|
|
385
|
+ Integer secondcid = param.getSecondcid();
|
|
386
|
+ Integer firstcime = param.getFirstcime();
|
|
387
|
+ Integer secondcime = param.getSecondctime();
|
|
388
|
+ Double secondcscore = param.getSecondcscore();
|
|
389
|
+ Integer type = param.getChecktype();//批阅情况1一评2二评
|
|
390
|
+ boolean corrected = false;
|
|
391
|
+ if ((handleid.equals(firstcid) && N_Utils.isTrueInteger(secondcime))
|
|
392
|
+ || (handleid.equals(secondcid) && N_Utils.isTrueInteger(firstcime))) {
|
|
393
|
+ checked = 2;
|
|
394
|
+ corrected = true;
|
|
395
|
+ }
|
|
396
|
+ Double diffscore = check.getDiffscore();//仲裁分差
|
|
397
|
+ Integer scoreway = check.getScoreway();//分差计算方式1题块总分值2任一给分点
|
|
398
|
+ Integer finalscore = check.getFinalscore();//最终得分取值1不取整(保留2位小数) 2取整-向上取值 3取整-向下取值
|
|
399
|
+ Double roundvalue = check.getRoundvalue();//取整取值间隔
|
|
400
|
+ Double endscore = null;
|
|
401
|
+ if (checked == 2) {//分差计算方式为题块总分值
|
|
402
|
+ double scoreDiff = MarkingUtil.scoreDiff(firstccore, secondcscore);
|
|
403
|
+ if (scoreway.equals(1) && diffscore.compareTo(scoreDiff) < 0) {//分差大于仲裁分差
|
|
404
|
+ hasproblem = 1;
|
|
405
|
+ problemtype = 5;
|
|
406
|
+ problemcomm = "题块总分值大于仲裁分差";
|
|
407
|
+ checked = 1;
|
|
408
|
+ } else if (scoreway.equals(1)) {
|
|
409
|
+ double addScore = MarkingUtil.add(firstccore, secondcscore);
|
|
410
|
+ endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
411
|
+ }
|
|
412
|
+ }
|
|
413
|
+ if (correcttype.equals(3)) {//按题块批阅
|
|
414
|
+ //题块批阅信息
|
|
415
|
+ MsPaperStudentBlock block = new MsPaperStudentBlock();
|
|
416
|
+ block.setMpsbid(mpsbid);
|
|
417
|
+ String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
|
|
418
|
+ if (type.equals(1)) {
|
|
419
|
+ block.setFirstcime(N_Utils.getSecondTimestamp());
|
|
420
|
+ block.setFirstccore(firstccore);
|
|
421
|
+ block.setFirstccores(stuscores);
|
|
422
|
+ } else {
|
|
423
|
+ block.setSecondctime(N_Utils.getSecondTimestamp());
|
|
424
|
+ block.setSecondcscore(secondcscore);
|
|
425
|
+ block.setSecondcscores(stuscores);
|
|
426
|
+ }
|
|
427
|
+
|
|
428
|
+ String[] cores;
|
|
429
|
+ if (type.equals(1)) {
|
|
430
|
+ cores = param.getSecondcscores().split(";");
|
|
431
|
+ } else {
|
|
432
|
+ cores = param.getFirstccores().split(";");
|
|
433
|
+ }
|
|
434
|
+ List<MsPaperStudentQuestion> studentQuestions = new ArrayList<>();
|
|
435
|
+ for (int j = 0; j < questions.size(); j++) {
|
|
436
|
+ MsPaperBlockQuestion question = questions.get(j);
|
|
437
|
+ Double stuscore = question.getStuscore();
|
|
438
|
+ if (N_Utils.isTrueInteger(question.getMptqid())) {
|
|
439
|
+ MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
|
440
|
+ studentQuestion.setMptqid(question.getMptqid());
|
|
441
|
+ if (type.equals(1)) {
|
|
442
|
+ studentQuestion.setFirstccore(stuscore);
|
|
443
|
+ } else {
|
|
444
|
+ studentQuestion.setSecondcscore(stuscore);
|
|
445
|
+ }
|
|
446
|
+ if (corrected && hasproblem.equals(0)) {
|
|
447
|
+ double scoreDiff = MarkingUtil.scoreDiff(stuscore, cores[j]);
|
|
448
|
+ if (scoreway.equals(2) && diffscore.compareTo(scoreDiff) < 0) {//分差大于仲裁分差
|
|
449
|
+ hasproblem = 1;
|
|
450
|
+ problemtype = 5;
|
|
451
|
+ problemcomm = "任一给分点大于仲裁分差";
|
|
452
|
+ checked = 1;
|
|
453
|
+ corrected = false;
|
|
454
|
+ } else if (scoreway.equals(2)) {
|
|
455
|
+ double addScore = MarkingUtil.add(stuscore, cores[j]);
|
|
456
|
+ endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
457
|
+ studentQuestion.setStuscore(endscore);
|
|
458
|
+ }
|
|
459
|
+ }
|
|
460
|
+ studentQuestions.add(studentQuestion);
|
|
461
|
+ } else {
|
|
462
|
+ String[] mptqids = question.getMergeqid().split(",");
|
|
463
|
+ String[] mergescores = question.getMergescore().split(",");
|
|
464
|
+ double[] scores = new double[mergescores.length];
|
|
465
|
+ int last = mergescores.length - 1;
|
|
466
|
+ double score = 0;
|
|
467
|
+ for (int i = 0; i < mergescores.length; i++) {
|
|
468
|
+ scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
|
|
469
|
+ score = MarkingUtil.add(score, scores[i]);
|
|
470
|
+ if (i == last) {
|
|
471
|
+ scores[i] = MarkingUtil.sub(stuscore, score);
|
|
472
|
+ }
|
|
473
|
+ }
|
|
474
|
+ String[] cores2 = cores[j].split(",");
|
|
475
|
+ for (int i = 0; i < mptqids.length; i++) {
|
|
476
|
+ MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
|
477
|
+ studentQuestion.setMptqid(N_Utils.obj2Int(mptqids[i]));
|
|
478
|
+ if (type.equals(1)) {
|
|
479
|
+ studentQuestion.setFirstccore(scores[i]);
|
|
480
|
+ } else {
|
|
481
|
+ studentQuestion.setSecondcscore(scores[i]);
|
|
482
|
+ }
|
|
483
|
+ if (corrected && hasproblem.equals(0)) {
|
|
484
|
+ double scoreDiff = MarkingUtil.scoreDiff(scores[i], cores2[i]);
|
|
485
|
+ if (scoreway.equals(2) && diffscore.compareTo(scoreDiff) < 0) {//分差大于仲裁分差
|
|
486
|
+ hasproblem = 1;
|
|
487
|
+ problemtype = 5;
|
|
488
|
+ problemcomm = "任一给分点大于仲裁分差";
|
|
489
|
+ checked = 1;
|
|
490
|
+ corrected = false;
|
|
491
|
+ } else if (scoreway.equals(2)) {
|
|
492
|
+ double addScore = MarkingUtil.add(scores[i], cores2[i]);
|
|
493
|
+ endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
494
|
+ studentQuestion.setStuscore(endscore);
|
|
495
|
+ }
|
|
496
|
+ }
|
|
497
|
+ studentQuestions.add(studentQuestion);
|
|
498
|
+ }
|
|
499
|
+ }
|
|
500
|
+ }
|
|
501
|
+
|
|
502
|
+ block.setChecked(checked);
|
|
503
|
+ block.setHasgood(hasgood);
|
|
504
|
+ block.setHasbad(hasbad);
|
|
505
|
+ block.setHasproblem(hasproblem);
|
|
506
|
+ block.setProblemtype(problemtype);
|
|
507
|
+ block.setProblemcomm(problemcomm);
|
|
508
|
+ block.setStudentid(param.getStudentid());
|
|
509
|
+ block.setMblockid(param.getMblockid());
|
|
510
|
+ msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
|
|
511
|
+
|
|
512
|
+ msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
|
|
513
|
+ } else {//按试题批阅
|
|
514
|
+ MsPaperStudentQuestion question = new MsPaperStudentQuestion();
|
|
515
|
+ question.setChecked(checked);
|
|
516
|
+ if (type.equals(1)) {
|
|
517
|
+ question.setFirstcime(N_Utils.getSecondTimestamp());
|
|
518
|
+ question.setFirstccore(firstccore);
|
|
519
|
+ } else {
|
|
520
|
+ question.setSecondctime(N_Utils.getSecondTimestamp());
|
|
521
|
+ question.setSecondcscore(secondcscore);
|
|
522
|
+ }
|
|
523
|
+ question.setHasgood(hasgood);
|
|
524
|
+ question.setHasbad(hasbad);
|
|
525
|
+ question.setHasproblem(hasproblem);
|
|
526
|
+ question.setProblemtype(problemtype);
|
|
527
|
+ question.setProblemcomm(problemcomm);
|
|
528
|
+ question.setStuscore(endscore);
|
|
529
|
+ question.setMpsqid(mpsbid);
|
|
530
|
+ }
|
380
|
531
|
}
|
381
|
532
|
msPaperCheckTeacherTaskMapper.correct(param);
|
382
|
533
|
}
|
|
534
|
+
|
|
535
|
+ //最终得分计算
|
|
536
|
+ private Double getUserScore(Integer finalscore, double addScore, Double roundvalue) {
|
|
537
|
+ double score;
|
|
538
|
+ if (finalscore.equals(1)) {
|
|
539
|
+ score = MarkingUtil.div(addScore, 2);
|
|
540
|
+ } else if (finalscore.equals(2)) {
|
|
541
|
+ score = MarkingUtil.roundUp(addScore, roundvalue);
|
|
542
|
+ } else {
|
|
543
|
+ score = MarkingUtil.roundDown(addScore, roundvalue);
|
|
544
|
+ }
|
|
545
|
+ return score;
|
|
546
|
+ }
|
383
|
547
|
}
|