|
@@ -8,8 +8,7 @@ import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
|
8
|
8
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
|
9
|
9
|
import com.xhkjedu.smarking.mapper.system.UserMapper;
|
10
|
10
|
import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
|
11
|
|
-import com.xhkjedu.smarking.model.papercheck.MsPaperCheck;
|
12
|
|
-import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
|
|
11
|
+import com.xhkjedu.smarking.model.papercheck.*;
|
13
|
12
|
import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
|
14
|
13
|
import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
|
15
|
14
|
import com.xhkjedu.smarking.utils.MarkingUtil;
|
|
@@ -140,10 +139,33 @@ public class MsPaperCheckTeacherTaskService {
|
140
|
139
|
* @Return java.util.List<java.util.Map>
|
141
|
140
|
**/
|
142
|
141
|
public List<Map> listTeacherBlock(MsCheckParam param) {
|
143
|
|
- setParam(param);
|
144
|
142
|
return msPaperCheckTeacherTaskMapper.listTeacherBlock(param);
|
145
|
143
|
}
|
146
|
144
|
|
|
145
|
+ /**
|
|
146
|
+ * @Description 教师阅卷-试题列表
|
|
147
|
+ * @Date 2024/11/13 17:59
|
|
148
|
+ * @Author YWX
|
|
149
|
+ * @Param [param]
|
|
150
|
+ * @Return java.util.List<java.util.Map>
|
|
151
|
+ **/
|
|
152
|
+ public List<Map> listTeacherQuestion(MsCheckParam param) {
|
|
153
|
+ Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
|
|
154
|
+ param.setCorrecttype(correcttype);
|
|
155
|
+ return msPaperCheckTeacherTaskMapper.listTeacherQuestion(param);
|
|
156
|
+ }
|
|
157
|
+
|
|
158
|
+ /**
|
|
159
|
+ * @Description 教师阅卷-班级列表
|
|
160
|
+ * @Date 2024/11/14 9:41
|
|
161
|
+ * @Author YWX
|
|
162
|
+ * @Param [param]
|
|
163
|
+ * @Return java.util.List<java.util.Map>
|
|
164
|
+ **/
|
|
165
|
+ public List<Map> listTeacherClass(MsCheckParam param) {
|
|
166
|
+ return msPaperCheckTeacherTaskMapper.listTeacherClass(param);
|
|
167
|
+ }
|
|
168
|
+
|
147
|
169
|
/**
|
148
|
170
|
* @Description 获取待批题块
|
149
|
171
|
* @Date 2024/10/31 11:01
|
|
@@ -206,10 +228,6 @@ public class MsPaperCheckTeacherTaskService {
|
206
|
228
|
MsPaperCheckTeacher teacher = msPaperCheckTeacherTaskMapper.getCheckNum(paperCheck);
|
207
|
229
|
totalNum = teacher.getTasknum();
|
208
|
230
|
checkedNum = teacher.getCheckednum();
|
209
|
|
- if (!dispenseway.equals(2)) {
|
210
|
|
- //更新教师阅卷任务状态
|
211
|
|
- msPaperCheckTeacherTaskMapper.updateCheckStatus(sq.getMpid(), sq.getMpsbid(), handleid, 2);
|
212
|
|
- }
|
213
|
231
|
Integer checktype = sq.getChecktype();
|
214
|
232
|
Integer firstcid = sq.getFirstcid();
|
215
|
233
|
if (!N_Utils.isTrueInteger(checktype)) {
|
|
@@ -221,6 +239,25 @@ public class MsPaperCheckTeacherTaskService {
|
221
|
239
|
checktype = 1;
|
222
|
240
|
}
|
223
|
241
|
}
|
|
242
|
+ if (!dispenseway.equals(2)) {
|
|
243
|
+ //更新教师阅卷任务状态
|
|
244
|
+ msPaperCheckTeacherTaskMapper.updateCheckStatus(sq.getMpid(), sq.getMpsbid(), handleid, 2);
|
|
245
|
+ } else {
|
|
246
|
+ //序号
|
|
247
|
+ Integer taskorder = checkedNum + 1;
|
|
248
|
+ sq.setTaskorder(taskorder);
|
|
249
|
+ MsPaperCheckTeacherTask task = new MsPaperCheckTeacherTask();
|
|
250
|
+ task.setMpid(sq.getMpid());
|
|
251
|
+ task.setMblockid(sq.getMblockid());
|
|
252
|
+ task.setMptqid(sq.getMptqid());
|
|
253
|
+ task.setTeacherid(handleid);
|
|
254
|
+ task.setTaskorder(taskorder);
|
|
255
|
+ task.setMpsbid(sq.getMpsbid());
|
|
256
|
+ task.setCheckstate(2);
|
|
257
|
+ task.setChecktype(checktype);
|
|
258
|
+ task.setCreatetime(N_Utils.getSecondTimestamp());
|
|
259
|
+ msPaperCheckTeacherTaskMapper.insertSelective(task);
|
|
260
|
+ }
|
224
|
261
|
if (correcttype.equals(3)) {//按题块批阅
|
225
|
262
|
MsPaperStudentBlock block = new MsPaperStudentBlock();
|
226
|
263
|
block.setMpsbid(sq.getMpsbid());
|
|
@@ -313,11 +350,13 @@ public class MsPaperCheckTeacherTaskService {
|
313
|
350
|
List<MsPaperBlockQuestion> questions = param.getQuestions();
|
314
|
351
|
int checked = 1;
|
315
|
352
|
Double firstccore = param.getFirstccore();
|
|
353
|
+ String checkscore;
|
316
|
354
|
if (checktype.equals(1)) {//单评
|
317
|
355
|
if (hasproblem.equals(0)) {
|
318
|
356
|
checked = 2;
|
319
|
357
|
}
|
320
|
358
|
if (correcttype.equals(3)) {//按题块批阅
|
|
359
|
+ checkscore = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
|
321
|
360
|
//题块批阅信息
|
322
|
361
|
MsPaperStudentBlock block = new MsPaperStudentBlock();
|
323
|
362
|
block.setMpsbid(mpsbid);
|
|
@@ -344,12 +383,12 @@ public class MsPaperCheckTeacherTaskService {
|
344
|
383
|
studentQuestions.add(studentQuestion);
|
345
|
384
|
} else {
|
346
|
385
|
String[] mptqids = question.getMergeqid().split(",");
|
347
|
|
- String[] mergescores = question.getMergescore().split(",");
|
348
|
|
- double[] scores = new double[mergescores.length];
|
349
|
|
- int last = mergescores.length - 1;
|
|
386
|
+ String[] mergestuscore = question.getMergestuscore().split(",");
|
|
387
|
+ double[] scores = new double[mergestuscore.length];
|
|
388
|
+ int last = mergestuscore.length - 1;
|
350
|
389
|
double score = 0;
|
351
|
|
- for (int i = 0; i < mergescores.length; i++) {
|
352
|
|
- scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
|
|
390
|
+ for (int i = 0; i < mergestuscore.length; i++) {
|
|
391
|
+ scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
|
353
|
392
|
score = MarkingUtil.add(score, scores[i]);
|
354
|
393
|
if (i == last) {
|
355
|
394
|
scores[i] = MarkingUtil.sub(stuscore, score);
|
|
@@ -366,6 +405,7 @@ public class MsPaperCheckTeacherTaskService {
|
366
|
405
|
}
|
367
|
406
|
msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
|
368
|
407
|
} else {//按试题批阅
|
|
408
|
+ checkscore = firstccore.toString();
|
369
|
409
|
MsPaperStudentQuestion question = new MsPaperStudentQuestion();
|
370
|
410
|
question.setMpsqid(mpsbid);
|
371
|
411
|
question.setChecked(checked);
|
|
@@ -408,6 +448,9 @@ public class MsPaperCheckTeacherTaskService {
|
408
|
448
|
} else if (scoreway.equals(1)) {
|
409
|
449
|
double addScore = MarkingUtil.add(firstccore, secondcscore);
|
410
|
450
|
endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
451
|
+ if (endscore.compareTo(qscore) > 0) {
|
|
452
|
+ endscore = qscore;
|
|
453
|
+ }
|
411
|
454
|
}
|
412
|
455
|
}
|
413
|
456
|
if (correcttype.equals(3)) {//按题块批阅
|
|
@@ -435,6 +478,7 @@ public class MsPaperCheckTeacherTaskService {
|
435
|
478
|
for (int j = 0; j < questions.size(); j++) {
|
436
|
479
|
MsPaperBlockQuestion question = questions.get(j);
|
437
|
480
|
Double stuscore = question.getStuscore();
|
|
481
|
+ Double bqscore = question.getBqscore();
|
438
|
482
|
if (N_Utils.isTrueInteger(question.getMptqid())) {
|
439
|
483
|
MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
440
|
484
|
studentQuestion.setMptqid(question.getMptqid());
|
|
@@ -454,6 +498,9 @@ public class MsPaperCheckTeacherTaskService {
|
454
|
498
|
} else if (scoreway.equals(2)) {
|
455
|
499
|
double addScore = MarkingUtil.add(stuscore, cores[j]);
|
456
|
500
|
endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
501
|
+ if (endscore.compareTo(bqscore) > 0) {
|
|
502
|
+ endscore = bqscore;
|
|
503
|
+ }
|
457
|
504
|
studentQuestion.setStuscore(endscore);
|
458
|
505
|
}
|
459
|
506
|
}
|
|
@@ -461,11 +508,12 @@ public class MsPaperCheckTeacherTaskService {
|
461
|
508
|
} else {
|
462
|
509
|
String[] mptqids = question.getMergeqid().split(",");
|
463
|
510
|
String[] mergescores = question.getMergescore().split(",");
|
464
|
|
- double[] scores = new double[mergescores.length];
|
465
|
|
- int last = mergescores.length - 1;
|
|
511
|
+ String[] mergestuscore = question.getMergestuscore().split(",");
|
|
512
|
+ double[] scores = new double[mergestuscore.length];
|
|
513
|
+ int last = mergestuscore.length - 1;
|
466
|
514
|
double score = 0;
|
467
|
|
- for (int i = 0; i < mergescores.length; i++) {
|
468
|
|
- scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
|
|
515
|
+ for (int i = 0; i < mergestuscore.length; i++) {
|
|
516
|
+ scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
|
469
|
517
|
score = MarkingUtil.add(score, scores[i]);
|
470
|
518
|
if (i == last) {
|
471
|
519
|
scores[i] = MarkingUtil.sub(stuscore, score);
|
|
@@ -491,6 +539,10 @@ public class MsPaperCheckTeacherTaskService {
|
491
|
539
|
} else if (scoreway.equals(2)) {
|
492
|
540
|
double addScore = MarkingUtil.add(scores[i], cores2[i]);
|
493
|
541
|
endscore = getUserScore(finalscore, addScore, roundvalue);
|
|
542
|
+ double mqscore = Double.parseDouble(mergescores[i]);
|
|
543
|
+ if (endscore.compareTo(mqscore) > 0) {
|
|
544
|
+ endscore = mqscore;
|
|
545
|
+ }
|
494
|
546
|
studentQuestion.setStuscore(endscore);
|
495
|
547
|
}
|
496
|
548
|
}
|
|
@@ -510,15 +562,18 @@ public class MsPaperCheckTeacherTaskService {
|
510
|
562
|
msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
|
511
|
563
|
|
512
|
564
|
msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
|
|
565
|
+ checkscore = stuscores;
|
513
|
566
|
} else {//按试题批阅
|
514
|
567
|
MsPaperStudentQuestion question = new MsPaperStudentQuestion();
|
515
|
568
|
question.setChecked(checked);
|
516
|
569
|
if (type.equals(1)) {
|
517
|
570
|
question.setFirstcime(N_Utils.getSecondTimestamp());
|
518
|
571
|
question.setFirstccore(firstccore);
|
|
572
|
+ checkscore = firstccore.toString();
|
519
|
573
|
} else {
|
520
|
574
|
question.setSecondctime(N_Utils.getSecondTimestamp());
|
521
|
575
|
question.setSecondcscore(secondcscore);
|
|
576
|
+ checkscore = secondcscore.toString();
|
522
|
577
|
}
|
523
|
578
|
question.setHasgood(hasgood);
|
524
|
579
|
question.setHasbad(hasbad);
|
|
@@ -529,6 +584,10 @@ public class MsPaperCheckTeacherTaskService {
|
529
|
584
|
question.setMpsqid(mpsbid);
|
530
|
585
|
}
|
531
|
586
|
}
|
|
587
|
+ param.setHasproblem(hasproblem);
|
|
588
|
+ param.setProblemtype(problemtype);
|
|
589
|
+ param.setProblemcomm(problemcomm);
|
|
590
|
+ param.setCheckscore(checkscore);
|
532
|
591
|
msPaperCheckTeacherTaskMapper.correct(param);
|
533
|
592
|
}
|
534
|
593
|
|
|
@@ -544,4 +603,44 @@ public class MsPaperCheckTeacherTaskService {
|
544
|
603
|
}
|
545
|
604
|
return score;
|
546
|
605
|
}
|
|
606
|
+
|
|
607
|
+ /**
|
|
608
|
+ * @Description 教师阅卷-上一份
|
|
609
|
+ * @Date 2024/11/14 10:35
|
|
610
|
+ * @Author YWX
|
|
611
|
+ * @Param [param]
|
|
612
|
+ * @Return java.util.Map
|
|
613
|
+ **/
|
|
614
|
+ public Map getPreCorrect(MsCheckParam param) {
|
|
615
|
+ Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
|
|
616
|
+ if (correcttype.equals(1) && !N_Utils.isTrueInteger(param.getMptqid())) {
|
|
617
|
+ throw new ServiceException("考试试题表id不能为空");
|
|
618
|
+ }
|
|
619
|
+ param.setCorrecttype(correcttype);
|
|
620
|
+ return msPaperCheckTeacherTaskMapper.getPreCorrect(param);
|
|
621
|
+ }
|
|
622
|
+
|
|
623
|
+ /**
|
|
624
|
+ * @Description 教师阅卷-阅卷历史
|
|
625
|
+ * @Date 2024/11/14 14:13
|
|
626
|
+ * @Author YWX
|
|
627
|
+ * @Param [param]
|
|
628
|
+ * @Return java.util.List<java.util.Map>
|
|
629
|
+ **/
|
|
630
|
+ public List<Map> listCorrect(MsCheckParam param) {
|
|
631
|
+ return msPaperCheckTeacherTaskMapper.listCorrect(param);
|
|
632
|
+ }
|
|
633
|
+
|
|
634
|
+ /**
|
|
635
|
+ * @Description 教师阅卷-历史详情
|
|
636
|
+ * @Date 2024/11/14 17:33
|
|
637
|
+ * @Author YWX
|
|
638
|
+ * @Param [param]
|
|
639
|
+ * @Return java.util.Map
|
|
640
|
+ **/
|
|
641
|
+ public Map detailCorrect(MsCheckParam param) {
|
|
642
|
+ Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
|
|
643
|
+ param.setCorrecttype(correcttype);
|
|
644
|
+ return msPaperCheckTeacherTaskMapper.detailCorrect(param);
|
|
645
|
+ }
|
547
|
646
|
}
|