浏览代码

按班级批阅、常用给分设置完善

ywx
雍文秀 1周前
父节点
当前提交
d34e420d80

+ 2
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherScoresetService.java 查看文件

@@ -26,11 +26,11 @@ public class MsPaperCheckTeacherScoresetService {
26 26
      **/
27 27
     public void add(MsPaperCheckTeacherScoreset set) {
28 28
         MsPaperCheckTeacherScoreset scoreset = msPaperCheckTeacherScoresetMapper.findByExamIdAndTeacherId(set.getExamid(), set.getTeacherid());
29
+        set.setCreatetime(N_Utils.getSecondTimestamp());
29 30
         if (scoreset != null) {
30 31
             set.setMpctsid(scoreset.getMpctsid());
31
-            msPaperCheckTeacherScoresetMapper.updateByPrimaryKeySelective(set);
32
+            msPaperCheckTeacherScoresetMapper.updateByPrimaryKey(set);
32 33
         } else {
33
-            set.setCreatetime(N_Utils.getSecondTimestamp());
34 34
             msPaperCheckTeacherScoresetMapper.insert(set);
35 35
         }
36 36
     }

+ 11
- 12
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java 查看文件

@@ -397,6 +397,7 @@ public class MsPaperCheckTeacherTaskService {
397 397
         String checkscore;
398 398
         //仲裁状态0默认1待仲裁2已仲裁
399 399
         Integer arbitratestate = null;
400
+        param.setCorrecttype(correcttype);
400 401
         MsCheckVo result = msPaperCheckTeacherTaskMapper.getCheckResult(param);
401 402
         Integer mpsid = result.getMpsid();
402 403
         String stumerge = param.getStumerge();
@@ -410,7 +411,10 @@ public class MsPaperCheckTeacherTaskService {
410 411
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
411 412
                 block.setMpsbid(mpsbid);
412 413
                 block.setChecked(checked);
414
+                block.setFirstcid(handleid);
413 415
                 block.setFirstcime(N_Utils.getSecondTimestamp());
416
+                String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergestuscore).collect(Collectors.joining(";"));
417
+                block.setFirstccores(stuscores);
414 418
                 block.setFirstccore(arbitratescore);
415 419
                 block.setHasgood(hasgood);
416 420
                 block.setHasbad(hasbad);
@@ -435,21 +439,11 @@ public class MsPaperCheckTeacherTaskService {
435 439
                     } else {
436 440
                         String[] mptqids = question.getMergeqid().split(",");
437 441
                         String[] mergestuscore = question.getMergestuscore().split(",");
438
-                        double[] scores = new double[mergestuscore.length];
439
-                        int last = mergestuscore.length - 1;
440
-                        double score = 0;
441
-                        for (int i = 0; i < mergestuscore.length; i++) {
442
-                            scores[i] = MarkingUtil.mul(MarkingUtil.div(mergestuscore[i], qscore), stuscore);
443
-                            score = MarkingUtil.add(score, scores[i]);
444
-                            if (i == last) {
445
-                                scores[i] = MarkingUtil.sub(stuscore, score);
446
-                            }
447
-                        }
448 442
                         for (int i = 0; i < mptqids.length; i++) {
449 443
                             MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
450 444
                             studentQuestion.setMptqid(N_Utils.obj2Int(mptqids[i]));
451
-                            studentQuestion.setFirstccore(scores[i]);
452
-                            studentQuestion.setStuscore(scores[i]);
445
+                            studentQuestion.setFirstccore(MarkingUtil.objToDouble(mergestuscore[i]));
446
+                            studentQuestion.setStuscore(MarkingUtil.objToDouble(mergestuscore[i]));
453 447
                             studentQuestions.add(studentQuestion);
454 448
                         }
455 449
                     }
@@ -460,6 +454,7 @@ public class MsPaperCheckTeacherTaskService {
460 454
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
461 455
                 question.setMpsqid(mpsbid);
462 456
                 question.setChecked(checked);
457
+                question.setFirstcid(handleid);
463 458
                 question.setFirstcime(N_Utils.getSecondTimestamp());
464 459
                 question.setFirstccore(arbitratescore);
465 460
                 question.setHasgood(hasgood);
@@ -514,11 +509,13 @@ public class MsPaperCheckTeacherTaskService {
514 509
                 String stuscores = questions.stream().map(MsPaperBlockQuestion::getMergescore).collect(Collectors.joining(";"));
515 510
                 String[] cores;
516 511
                 if (type.equals(1)) {
512
+                    block.setFirstcid(handleid);
517 513
                     block.setFirstcime(N_Utils.getSecondTimestamp());
518 514
                     block.setFirstccore(arbitratescore);
519 515
                     block.setFirstccores(stuscores);
520 516
                     cores = param.getSecondcscores().split(";");
521 517
                 } else {
518
+                    block.setSecondcid(handleid);
522 519
                     block.setSecondctime(N_Utils.getSecondTimestamp());
523 520
                     block.setSecondcscore(arbitratescore);
524 521
                     block.setSecondcscores(stuscores);
@@ -617,9 +614,11 @@ public class MsPaperCheckTeacherTaskService {
617 614
                 question.setChecked(checked);
618 615
                 checkscore = arbitratescore.toString();
619 616
                 if (type.equals(1)) {
617
+                    question.setFirstcid(handleid);
620 618
                     question.setFirstcime(N_Utils.getSecondTimestamp());
621 619
                     question.setFirstccore(arbitratescore);
622 620
                 } else {
621
+                    question.setSecondcid(handleid);
623 622
                     question.setSecondctime(N_Utils.getSecondTimestamp());
624 623
                     question.setSecondcscore(arbitratescore);
625 624
                 }

+ 6
- 6
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml 查看文件

@@ -397,7 +397,7 @@
397 397
             from ms_paper_student_block psq inner join ms_paper_check_teacher_task pctt on psq.mpsbid = pctt.mpsbid and psq.mpid=pctt.mpid
398 398
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
399 399
             and pctt.checkstate!=3 and psq.hasproblem=0
400
-            order by field(pctt.checkstate,2,1,3),pctt.taskorder
400
+            order by psq.mpsbid,field(pctt.checkstate,2,1,3),pctt.taskorder
401 401
             limit 1
402 402
         </if>
403 403
         <if test="param.dispenseway!=null and param.dispenseway==2">
@@ -414,7 +414,7 @@
414 414
             </if>
415 415
             )))
416 416
             and psq.hasproblem=0
417
-            order by field(psq.checked,2,1,3)
417
+            order by psq.mpsbid,field(psq.checked,2,1,3)
418 418
             limit 1
419 419
         </if>
420 420
     </select>
@@ -533,7 +533,7 @@
533 533
             from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
534 534
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
535 535
             and pctt.checkstate!=3 and psq.hasproblem=0
536
-            order by field(pctt.checkstate,2,1,3),pctt.taskorder
536
+            order by psq.mptqid,field(pctt.checkstate,2,1,3),pctt.taskorder
537 537
             limit 1
538 538
         </if>
539 539
         <if test="param.dispenseway!=null and param.dispenseway==2">
@@ -550,7 +550,7 @@
550 550
             </if>
551 551
             )))
552 552
             and psq.hasproblem=0
553
-            order by field(psq.checked,2,1,3)
553
+            order by psq.mptqid,field(psq.checked,2,1,3)
554 554
             limit 1
555 555
         </if>
556 556
     </select>
@@ -582,7 +582,7 @@
582 582
             <if test="param.mptqid!=null and param.mptqid!=0">
583 583
                 and psq.mptqid=#{param.mptqid}
584 584
             </if>
585
-            order by field(pctt.checkstate,2,1,3),pctt.taskorder
585
+            order by psq.mptqid,field(pctt.checkstate,2,1,3),pctt.taskorder
586 586
             limit 1
587 587
         </if>
588 588
         <if test="param.dispenseway!=null and param.dispenseway==2">
@@ -603,7 +603,7 @@
603 603
             <if test="param.mptqid!=null and param.mptqid!=0">
604 604
                 and psq.mptqid=#{param.mptqid}
605 605
             </if>
606
-            order by field(psq.checked,2,1,3),psq.mptqid
606
+            order by psq.mptqid,field(psq.checked,2,1,3),psq.mptqid
607 607
             limit 1
608 608
         </if>
609 609
     </select>

+ 3
- 11
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml 查看文件

@@ -139,7 +139,7 @@
139 139
     </update>
140 140
     <!--更新学生单题批阅信息-->
141 141
     <update id="checkByMptqidAndStudentId">
142
-        update ms_paper_student_question set checked=#{block.checked}
142
+        update ms_paper_student_question set
143 143
         <trim prefix="stuscore = case mptqid" suffix="end,">
144 144
             <foreach collection="list" item="q" separator=" ">
145 145
                 when #{q.mptqid} then ifnull(#{q.stuscore},stuscore)
@@ -151,11 +151,7 @@
151 151
                    when #{q.mptqid} then #{q.firstccore}
152 152
                </foreach>
153 153
             </trim>
154
-            <trim prefix="firstcime = case mptqid" suffix="end,">
155
-                <foreach collection="list" item="q" separator=" ">
156
-                    when #{q.mptqid} then #{q.firstcime}
157
-                </foreach>
158
-            </trim>
154
+            firstcid=#{block.firstcid},firstcime=#{block.firstcime}
159 155
         </if>
160 156
         <if test="block.secondctime!=null and block.secondctime!=0">
161 157
             <trim prefix="secondcscore = case mptqid" suffix="end,">
@@ -163,11 +159,7 @@
163 159
                     when #{q.mptqid} then #{q.secondcscore}
164 160
                 </foreach>
165 161
             </trim>
166
-            <trim prefix="secondctime = case mptqid" suffix="end,">
167
-                <foreach collection="list" item="q" separator=" ">
168
-                    when #{q.mptqid} then #{q.secondctime}
169
-                </foreach>
170
-            </trim>
162
+            secondcid=#{block.secondcid},secondctime=#{block.secondctime}
171 163
         </if>
172 164
         <if test="block.arbitrateid!=null and block.arbitrateid!=0">
173 165
             ,arbitrateid=#{block.arbitrateid}

正在加载...
取消
保存