Pārlūkot izejas kodu

线下试卷完善

ywx
王宁 pirms 1 mēnesi
vecāks
revīzija
a8402c994d

+ 14
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java Parādīt failu

@@ -1239,6 +1239,8 @@ public class MsPaperQtypeService {
1239 1239
             } else {
1240 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 1245
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1244 1246
 
@@ -1303,9 +1305,9 @@ public class MsPaperQtypeService {
1303 1305
         // 保存题型
1304 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 1311
         List<MsPaperQtypeQuestion> qtypeQuestions = paperQtype.getQuestions();
1310 1312
         for (MsPaperQtypeQuestion que : qtypeQuestions) {
1311 1313
             que.setMptid(mptid);
@@ -1316,6 +1318,8 @@ public class MsPaperQtypeService {
1316 1318
             } else {
1317 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 1324
         msPaperQtypeQuestionMapper.insertList(qtypeQuestions);
1321 1325
 
@@ -1445,10 +1449,13 @@ public class MsPaperQtypeService {
1445 1449
             movevalue = 1;// 在原来基础上加一
1446 1450
             bmovevalue = -1;
1447 1451
         }
1448
-        params.setMovevalue(1);
1452
+        params.setMovevalue(movevalue);
1449 1453
         moveQtype.setMptorder(movevalue);
1450 1454
         // 被交换位置的试题
1451 1455
         MsPaperQtype qtype = msPaperQtypeMapper.getQtypeForMoverOrder(params);
1456
+        if(qtype == null){
1457
+            throw new RuntimeException("请检查移动是否合理");
1458
+        }
1452 1459
         qtype.setMptorder(bmovevalue);
1453 1460
 
1454 1461
         List<MsPaperQtype> changeQuestions = new ArrayList<>();
@@ -1559,10 +1566,13 @@ public class MsPaperQtypeService {
1559 1566
             movevalue = 1;// 在原来基础上加一
1560 1567
             bmovevalue = -1;
1561 1568
         }
1562
-        params.setMovevalue(1);
1569
+        params.setMovevalue(movevalue);
1563 1570
         moveQuestion.setQorder(movevalue);
1564 1571
         // 被交换位置的试题
1565 1572
         MsPaperQtypeQuestion question = msPaperQtypeQuestionMapper.getQuestionForMoverOrder(params);
1573
+        if(question == null){
1574
+            throw new RuntimeException("请检查移动是否合理");
1575
+        }
1566 1576
         question.setQorder(bmovevalue);
1567 1577
 
1568 1578
         List<MsPaperQtypeQuestion> changeQuestions = new ArrayList<>();

+ 2
- 2
smarking/src/main/resources/application.properties Parādīt failu

@@ -3,8 +3,8 @@ server.port=8090
3 3
 spring.application.name=smarking
4 4
 #\u6CE8\u518C\u5230\u6211\u4EEC\u672C\u5730\u7684eureka\u6CE8\u518C\u4E2D\u5FC3\uFF0C\u7AEF\u53E38081
5 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 8
 #\u8BBE\u7F6Eeureka\u8F93\u51FA\u65E5\u5FD7\u7EA7\u522B
9 9
 logging.level.com.netflix=error
10 10
 

+ 1
- 1
smarking/src/main/resources/mapper/paper/MsPaperMapper.xml Parādīt failu

@@ -38,7 +38,7 @@
38 38
     <!--删除试卷对应模板、题块、批阅设置-->
39 39
     <delete id="deleteTemplageBlockByMpid">
40 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 42
     </delete>
43 43
 
44 44
     <!--获取考试试卷题量和分值-->

+ 4
- 4
smarking/src/main/resources/mapper/paper/MsPaperQtypeMapper.xml Parādīt failu

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

+ 4
- 4
smarking/src/main/resources/mapper/paper/MsPaperQtypeQuestionMapper.xml Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt