Browse Source

线下试卷完善

ywx
王宁 1 month ago
parent
commit
a8402c994d

+ 14
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

1239
             } else {
1239
             } else {
1240
                 que.setQtype(2);
1240
                 que.setQtype(2);
1241
             }
1241
             }
1242
+            if(que.getScoreset() == null) que.setScoreset(0);
1243
+            if(que.getLoseoption() == null) que.setLoseoption(0.0);
1242
         }
1244
         }
1243
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1245
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1244
 
1246
 
1303
         // 保存题型
1305
         // 保存题型
1304
         msPaperQtypeMapper.updateByPrimaryKeySelective(paperQtype);
1306
         msPaperQtypeMapper.updateByPrimaryKeySelective(paperQtype);
1305
         // 删除题型下原有试题
1307
         // 删除题型下原有试题
1306
-        msPaperQtypeQuestionMapper.deleteByMptid(paperQtype.getId());
1308
+        msPaperQtypeQuestionMapper.deleteByMptid(paperQtype.getMptid());
1307
 
1309
 
1308
-        Integer mptid = paperQtype.getId();
1310
+        Integer mptid = paperQtype.getMptid();
1309
         List<MsPaperQtypeQuestion> qtypeQuestions = paperQtype.getQuestions();
1311
         List<MsPaperQtypeQuestion> qtypeQuestions = paperQtype.getQuestions();
1310
         for (MsPaperQtypeQuestion que : qtypeQuestions) {
1312
         for (MsPaperQtypeQuestion que : qtypeQuestions) {
1311
             que.setMptid(mptid);
1313
             que.setMptid(mptid);
1316
             } else {
1318
             } else {
1317
                 que.setQtype(2);
1319
                 que.setQtype(2);
1318
             }
1320
             }
1321
+            if(que.getScoreset() == null) que.setScoreset(0);
1322
+            if(que.getLoseoption() == null) que.setLoseoption(0.0);
1319
         }
1323
         }
1320
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1324
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1321
 
1325
 
1445
             movevalue = 1;// 在原来基础上加一
1449
             movevalue = 1;// 在原来基础上加一
1446
             bmovevalue = -1;
1450
             bmovevalue = -1;
1447
         }
1451
         }
1448
-        params.setMovevalue(1);
1452
+        params.setMovevalue(movevalue);
1449
         moveQtype.setMptorder(movevalue);
1453
         moveQtype.setMptorder(movevalue);
1450
         // 被交换位置的试题
1454
         // 被交换位置的试题
1451
         MsPaperQtype qtype = msPaperQtypeMapper.getQtypeForMoverOrder(params);
1455
         MsPaperQtype qtype = msPaperQtypeMapper.getQtypeForMoverOrder(params);
1456
+        if(qtype == null){
1457
+            throw new RuntimeException("请检查移动是否合理");
1458
+        }
1452
         qtype.setMptorder(bmovevalue);
1459
         qtype.setMptorder(bmovevalue);
1453
 
1460
 
1454
         List<MsPaperQtype> changeQuestions = new ArrayList<>();
1461
         List<MsPaperQtype> changeQuestions = new ArrayList<>();
1559
             movevalue = 1;// 在原来基础上加一
1566
             movevalue = 1;// 在原来基础上加一
1560
             bmovevalue = -1;
1567
             bmovevalue = -1;
1561
         }
1568
         }
1562
-        params.setMovevalue(1);
1569
+        params.setMovevalue(movevalue);
1563
         moveQuestion.setQorder(movevalue);
1570
         moveQuestion.setQorder(movevalue);
1564
         // 被交换位置的试题
1571
         // 被交换位置的试题
1565
         MsPaperQtypeQuestion question = msPaperQtypeQuestionMapper.getQuestionForMoverOrder(params);
1572
         MsPaperQtypeQuestion question = msPaperQtypeQuestionMapper.getQuestionForMoverOrder(params);
1573
+        if(question == null){
1574
+            throw new RuntimeException("请检查移动是否合理");
1575
+        }
1566
         question.setQorder(bmovevalue);
1576
         question.setQorder(bmovevalue);
1567
 
1577
 
1568
         List<MsPaperQtypeQuestion> changeQuestions = new ArrayList<>();
1578
         List<MsPaperQtypeQuestion> changeQuestions = new ArrayList<>();

+ 2
- 2
smarking/src/main/resources/application.properties View File

3
 spring.application.name=smarking
3
 spring.application.name=smarking
4
 #\u6CE8\u518C\u5230\u6211\u4EEC\u672C\u5730\u7684eureka\u6CE8\u518C\u4E2D\u5FC3\uFF0C\u7AEF\u53E38081
4
 #\u6CE8\u518C\u5230\u6211\u4EEC\u672C\u5730\u7684eureka\u6CE8\u518C\u4E2D\u5FC3\uFF0C\u7AEF\u53E38081
5
 eureka.client.service-url.defaultZone=http://xhschool:Xhkjedud07@127.0.0.1:8081/eureka/
5
 eureka.client.service-url.defaultZone=http://xhschool:Xhkjedud07@127.0.0.1:8081/eureka/
6
-eureka.client.register-with-eureka=false
7
-eureka.client.fetch-registry=false
6
+eureka.client.register-with-eureka=true
7
+eureka.client.fetch-registry=true
8
 #\u8BBE\u7F6Eeureka\u8F93\u51FA\u65E5\u5FD7\u7EA7\u522B
8
 #\u8BBE\u7F6Eeureka\u8F93\u51FA\u65E5\u5FD7\u7EA7\u522B
9
 logging.level.com.netflix=error
9
 logging.level.com.netflix=error
10
 
10
 

+ 1
- 1
smarking/src/main/resources/mapper/paper/MsPaperMapper.xml View File

38
     <!--删除试卷对应模板、题块、批阅设置-->
38
     <!--删除试卷对应模板、题块、批阅设置-->
39
     <delete id="deleteTemplageBlockByMpid">
39
     <delete id="deleteTemplageBlockByMpid">
40
         delete from ms_template where mpid=#{mpid};
40
         delete from ms_template where mpid=#{mpid};
41
-        delete from ms_paper_block where mpid=#{mpid};
41
+        delete from ms_paper_block where mpid=#{mpid}
42
     </delete>
42
     </delete>
43
 
43
 
44
     <!--获取考试试卷题量和分值-->
44
     <!--获取考试试卷题量和分值-->

+ 4
- 4
smarking/src/main/resources/mapper/paper/MsPaperQtypeMapper.xml View File

170
     <!--修改题型分,修改试卷分-->
170
     <!--修改题型分,修改试卷分-->
171
     <update id="updateQtypeScore">
171
     <update id="updateQtypeScore">
172
         update ms_paper_qtype set mptscore =
172
         update ms_paper_qtype set mptscore =
173
-            (select sum(qscore) from ms_paper_qtype_question where mptid = #{mptid}) where mptid = #{mptid},
173
+            (select sum(qscore) from ms_paper_qtype_question where mptid = #{mptid}) where mptid = #{mptid};
174
         update ms_paper set pscore = (select sum(qscore) from ms_paper_qtype_question where mpid = #{mpid}) where mpid = #{mpid}
174
         update ms_paper set pscore = (select sum(qscore) from ms_paper_qtype_question where mpid = #{mpid}) where mpid = #{mpid}
175
     </update>
175
     </update>
176
     <!--修改题型分和试题数量,修改试卷分和试题数量-->
176
     <!--修改题型分和试题数量,修改试卷分和试题数量-->
177
     <update id="updateQtypeScoreAndNum">
177
     <update id="updateQtypeScoreAndNum">
178
         update ms_paper_qtype set mptnum=mptnum-1, mptscore =
178
         update ms_paper_qtype set mptnum=mptnum-1, mptscore =
179
-        (select sum(qscore) from ms_paper_qtype_question where mptid = #{mptid}) where mptid = #{mptid},
179
+        (select sum(qscore) from ms_paper_qtype_question where mptid = #{mptid}) where mptid = #{mptid};
180
         update ms_paper set pnum=pnum-1, pscore = (select sum(qscore) from ms_paper_qtype_question where mpid = #{mpid}) where mpid = #{mpid}
180
         update ms_paper set pnum=pnum-1, pscore = (select sum(qscore) from ms_paper_qtype_question where mpid = #{mpid}) where mpid = #{mpid}
181
     </update>
181
     </update>
182
 
182
 
210
     </select>
210
     </select>
211
     <!--批量修改题型排序-线下-->
211
     <!--批量修改题型排序-线下-->
212
     <update id="updateBatchQtypeOrder">
212
     <update id="updateBatchQtypeOrder">
213
-        <foreach collection="list" item="q" separator=",">
213
+        <foreach collection="list" item="t" separator=";">
214
             update ms_paper_qtype set mptorder=#{t.mptorder} where mptid=#{t.mptid}
214
             update ms_paper_qtype set mptorder=#{t.mptorder} where mptid=#{t.mptid}
215
         </foreach>
215
         </foreach>
216
     </update>
216
     </update>
217
     <!--批量修改题型排序-移动-线下-->
217
     <!--批量修改题型排序-移动-线下-->
218
     <update id="updateBatchMoveQtypeOrder">
218
     <update id="updateBatchMoveQtypeOrder">
219
-        <foreach collection="list" item="q" separator=",">
219
+        <foreach collection="list" item="t" separator=";">
220
             update ms_paper_qtype set mptorder=mptorder + (#{t.mptorder}) where mptid=#{t.mptid}
220
             update ms_paper_qtype set mptorder=mptorder + (#{t.mptorder}) where mptid=#{t.mptid}
221
         </foreach>
221
         </foreach>
222
     </update>
222
     </update>

+ 4
- 4
smarking/src/main/resources/mapper/paper/MsPaperQtypeQuestionMapper.xml View File

81
 
81
 
82
     <!--批量修改试题信息-线下-->
82
     <!--批量修改试题信息-线下-->
83
     <update id="updateBatchQuestionInfo">
83
     <update id="updateBatchQuestionInfo">
84
-        <foreach collection="list" item="q" separator=",">
84
+        <foreach collection="list" item="q" separator=";">
85
             update ms_paper_qtype_question set ctype=#{q.ctype},qtypename=#{q.qtypename},qn=#{q.qn},qscore=#{q.qscore},qorder=#{q.qorder}
85
             update ms_paper_qtype_question set ctype=#{q.ctype},qtypename=#{q.qtypename},qn=#{q.qn},qscore=#{q.qscore},qorder=#{q.qorder}
86
             ,optionnum=#{q.optionnum},loseoption=#{q.loseoption},scoreset=#{q.scoreset} where mptqid=#{q.mptqid}
86
             ,optionnum=#{q.optionnum},loseoption=#{q.loseoption},scoreset=#{q.scoreset} where mptqid=#{q.mptqid}
87
         </foreach>
87
         </foreach>
88
     </update>
88
     </update>
89
     <!--批量修改试题排序-线下-->
89
     <!--批量修改试题排序-线下-->
90
     <update id="updateBatchQuestionOrder">
90
     <update id="updateBatchQuestionOrder">
91
-        <foreach collection="list" item="q" separator=",">
91
+        <foreach collection="list" item="q" separator=";">
92
             update ms_paper_qtype_question set qorder=#{q.qorder} where mptqid=#{q.mptqid}
92
             update ms_paper_qtype_question set qorder=#{q.qorder} where mptqid=#{q.mptqid}
93
         </foreach>
93
         </foreach>
94
     </update>
94
     </update>
95
     <!--批量修改试题排序-移动-线下-->
95
     <!--批量修改试题排序-移动-线下-->
96
     <update id="updateBatchMoveQuestionOrder">
96
     <update id="updateBatchMoveQuestionOrder">
97
-        <foreach collection="list" item="q" separator=",">
97
+        <foreach collection="list" item="q" separator=";">
98
             update ms_paper_qtype_question set qorder=qorder + (#{q.qorder}) where mptqid=#{q.mptqid}
98
             update ms_paper_qtype_question set qorder=qorder + (#{q.qorder}) where mptqid=#{q.mptqid}
99
         </foreach>
99
         </foreach>
100
     </update>
100
     </update>
126
 
126
 
127
     <!--批量设置试题切割坐标-->
127
     <!--批量设置试题切割坐标-->
128
     <update id="updateBatchQuestionCoor">
128
     <update id="updateBatchQuestionCoor">
129
-        <foreach collection="list" item="q" separator=",">
129
+        <foreach collection="list" item="q" separator=";">
130
             update ms_paper_qtype_question set pagenum=#{q.pagenum},stemcoor=#{q.stemcoor},quecoor=#{q.quecoor} where mptqid=#{q.mptqid}
130
             update ms_paper_qtype_question set pagenum=#{q.pagenum},stemcoor=#{q.stemcoor},quecoor=#{q.quecoor} where mptqid=#{q.mptqid}
131
         </foreach>
131
         </foreach>
132
     </update>
132
     </update>

Loading…
Cancel
Save