Browse Source

试卷添加答题卡数量

tags/正式版本
王宁 2 years ago
parent
commit
25b337ffa3

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/paper/EPaper.java View File

@@ -49,6 +49,9 @@ public class EPaper extends BaseBean {
49 49
     //答题卡文件
50 50
     private String scantronfile;
51 51
 
52
+    //答题卡张数
53
+    private Integer scantronnum;
54
+
52 55
     private String scantronpdf;//答题卡pdf
53 56
 
54 57
     //答题卡注意事项

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

@@ -117,6 +117,10 @@ public class EBaseService {
117 117
             p.setPscore(0.0);
118 118
             p.setAnswered(0);
119 119
             p.setCorrecttype(0);
120
+            p.setScantronnum(0);
121
+            p.setScantronspace(0);
122
+            p.setScantroncol(0);
123
+            p.setCodenum(0);
120 124
             papers.add(p);
121 125
         }
122 126
         eSubjectMapper.insertList(subjects);//考试科目

+ 5
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

@@ -687,6 +687,11 @@ public class EPaperQtypeService {
687 687
     @Transactional(rollbackFor = Exception.class)
688 688
     public void savePaperScan(EPaper paper){
689 689
         List<EPaperQtypeQuestion> questions = paper.getQuestions();
690
+        if(N_Utils.isNotEmpty(paper.getScantronfile())){
691
+            List<String> scanfiles = JSON.parseArray(paper.getScantronfile(),String.class);
692
+            int pn = scanfiles.size() / 2;//答题卡的张数
693
+            paper.setScantronnum(pn);
694
+        }
690 695
         ePaperMapper.updatePaperScantron(paper);
691 696
         ePaperQtypeMapper.updateBatchQuestionForScan(questions);
692 697
         if(paper.getPstate() == 1){

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperMapper.xml View File

@@ -90,7 +90,7 @@
90 90
 
91 91
     <!--修改设置答题卡-->
92 92
     <update id="updatePaperScantron">
93
-        update e_paper set scantronfile=#{paper.scantronfile},scantronnote=#{paper.scantronnote}
93
+        update e_paper set scantronfile=#{paper.scantronfile},scantronnote=#{paper.scantronnote},scantronnum=#{paper.scantronnum}
94 94
         ,scantronwh=#{paper.scantronwh},scantroncol=#{paper.scantroncol},cantronmiss=#{paper.cantronmiss},
95 95
         cantronbad=#{paper.cantronbad},codetype=#{paper.codetype},codenum=#{paper.codenum},
96 96
         cantroncode=#{paper.cantroncode},cantronpage=#{paper.cantronpage},cantronbarcode=#{paper.cantronbarcode},

Loading…
Cancel
Save