Explorar el Código

自动评阅试题

tags/正式版本
王宁 hace 2 años
padre
commit
82fd7c7303

+ 63
- 64
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java Ver fichero

@@ -228,78 +228,75 @@ public class EPaperStudentService {
228 228
             if (answerVo.getAnswered() == 1){
229 229
                 String qanswer = answerVo.getAnswer();
230 230
                 List<String> qanswers = JSON.parseArray(qanswer,String.class);
231
-                if(N_Utils.isListEmpty(stuanswers) && N_Utils.isEmpty(psq.getStuanswertxt())
232
-                        && N_Utils.isEmpty(psq.getStuanswertxt())){
233
-                    psq.setStuscore(stuscore);
234
-                    psq.setChecked(2);
235
-                    psq.setChecktime(timestamp);
236
-                    psq.setAnswered(0);
237
-                }else{
238
-                    int ctype = answerVo.getCtype();
239
-                    if(psq.getAnswertype() == 1){
240
-                        if(N_Utils.isObjectiveQuestion(ctype)){
241
-                            //客观题进行批阅
242
-                            if(ctype == 1 || ctype == 4 || ctype == 5 || ctype == 6){
243
-                                //单选、判断
244
-                                if(stuanswer.equalsIgnoreCase(qanswer)) {
245
-                                    stuscore = answerVo.getScore();
246
-                                }
247
-                            }else if(ctype == 2){//多选
248
-                                //多选、选错不得分
249
-                                if(stuanswers.get(0).length() <= qanswer.length()){
250
-                                    String[] qanswerList = qanswers.get(0).split("");
251
-                                    String[] stuanswerList = stuanswers.get(0).split("");
252
-                                    int rightNum = 0;//选对个数
253
-                                    for(String sa : stuanswerList){
254
-                                        int right = 0;
255
-                                        for(String qa : qanswerList){
256
-                                            if(qa.equals(sa)){
257
-                                                right = 1;
258
-                                                rightNum ++;
259
-                                            }
260
-                                        }
261
-                                        if(right == 0){//说明选错
262
-                                            rightNum = 0;
263
-                                            break;
231
+                int ctype = answerVo.getCtype();
232
+                if(psq.getAnswertype() == 1){
233
+                    if(N_Utils.isObjectiveQuestion(ctype)){
234
+                        //客观题进行批阅
235
+                        if(ctype == 1 || ctype == 4 || ctype == 5 || ctype == 6){
236
+                            //单选、判断
237
+                            if(stuanswer.equalsIgnoreCase(qanswer)) {
238
+                                stuscore = answerVo.getScore();
239
+                            }
240
+                        }else if(ctype == 2){//多选
241
+                            //多选、选错不得分
242
+                            if(stuanswers.get(0).length() <= qanswer.length()){
243
+                                String[] qanswerList = qanswers.get(0).split("");
244
+                                String[] stuanswerList = stuanswers.get(0).split("");
245
+                                int rightNum = 0;//选对个数
246
+                                for(String sa : stuanswerList){
247
+                                    int right = 0;
248
+                                    for(String qa : qanswerList){
249
+                                        if(qa.equals(sa)){
250
+                                            right = 1;
251
+                                            rightNum ++;
264 252
                                         }
265 253
                                     }
266
-                                    if(rightNum>0){
267
-                                        if(qanswerList.length == rightNum){
268
-                                            //全选对
269
-                                            stuscore = answerVo.getScore();
270
-                                        }else if (qanswerList.length > rightNum){
271
-                                            //少选得半分
272
-                                            stuscore = ExamUtil.div(answerVo.getScore(),2,1);
273
-                                        }
254
+                                    if(right == 0){//说明选错
255
+                                        rightNum = 0;
256
+                                        break;
274 257
                                     }
275 258
                                 }
276
-                            }else if(ctype == 7 || ctype == 8 || ctype == 10){
277
-                                //完形填空、阅读理解、任务型阅读
278
-                                Double qscore = ExamUtil.div(answerVo.getScore(),qanswers.size());
279
-                                Double stuScoreDouble = 0d;
280
-                                for(int i=0;i<qanswers.size();i++){
281
-                                    if(qanswers.get(i).equalsIgnoreCase(stuanswers.get(i))){
282
-                                        stuScoreDouble = ExamUtil.add(stuScoreDouble,qscore);
259
+                                if(rightNum>0){
260
+                                    if(qanswerList.length == rightNum){
261
+                                        //全选对
262
+                                        stuscore = answerVo.getScore();
263
+                                    }else if (qanswerList.length > rightNum){
264
+                                        //少选得半分
265
+                                        stuscore = ExamUtil.div(answerVo.getScore(),2,1);
283 266
                                     }
284 267
                                 }
285
-                                stuscore = ExamUtil.round(stuScoreDouble,1);
286 268
                             }
287
-                            if(stuscore.compareTo(answerVo.getScore()) == 1){
288
-                                stuscore = answerVo.getScore();
269
+                        }else if(ctype == 7 || ctype == 8 || ctype == 10){
270
+                            //完形填空、阅读理解、任务型阅读
271
+                            Double qscore = ExamUtil.div(answerVo.getScore(),qanswers.size());
272
+                            Double stuScoreDouble = 0d;
273
+                            for(int i=0;i<qanswers.size();i++){
274
+                                if(qanswers.get(i).equalsIgnoreCase(stuanswers.get(i))){
275
+                                    stuScoreDouble = ExamUtil.add(stuScoreDouble,qscore);
276
+                                }
289 277
                             }
278
+                            stuscore = ExamUtil.round(stuScoreDouble,1);
279
+                        }
280
+                        if(stuscore.compareTo(answerVo.getScore()) == 1){
281
+                            stuscore = answerVo.getScore();
282
+                        }
290 283
 
291
-                            psq.setChecked(2);
292
-                            psq.setChecktime(timestamp);
293
-                        }else{
294
-                            if(stuanswers.size() > 1){
295
-                                coverted = 0;//上传的多张图片设为0未转换
296
-                            }
297
-                            psq.setChecked(0);
284
+                        psq.setChecked(2);
285
+                        psq.setChecktime(timestamp);
286
+                    }else{
287
+                        if(stuanswers.size() > 1){
288
+                            coverted = 0;//上传的多张图片设为0未转换
298 289
                         }
290
+                        psq.setChecked(0);
299 291
                     }
300
-                    psq.setAnswered(0);
292
+                }else{
301 293
                     psq.setChecked(0);
302 294
                 }
295
+            }else{
296
+                psq.setStuscore(stuscore);
297
+                psq.setAnswered(0);
298
+                psq.setChecked(2);
299
+                psq.setChecktime(timestamp);
303 300
             }
304 301
         }
305 302
         psq.setStuscore(stuscore);
@@ -340,7 +337,7 @@ public class EPaperStudentService {
340 337
         int noCheckNum = ePaperStudentQuestionMapper.getStuQuestionNoCheckNum(epsid);
341 338
         int checked = 0;
342 339
         if(noCheckNum == 0){
343
-            checked = 1;//试卷中所有试题都批完后标识试卷已批改
340
+            checked = 2;//试卷中所有试题都批完后标识试卷已批改
344 341
         }
345 342
         paperStudent.setChecked(checked);
346 343
         ePaperStudentMapper.updateStudentPaper(paperStudent);//修改试卷信息
@@ -396,7 +393,7 @@ public class EPaperStudentService {
396 393
         paperStudent.setStuscore(paperscore);
397 394
         int checked = 0;
398 395
         if(checknum == sqlist.size()){
399
-            checked = 1;
396
+            checked = 2;
400 397
         }
401 398
         paperStudent.setChecked(checked);
402 399
 
@@ -470,14 +467,16 @@ public class EPaperStudentService {
470 467
             paperStudent.setStuscore(paperscore);
471 468
             int checked = 0;
472 469
             if(checknum == sqlist.size()){
473
-                checked = 1;
470
+                checked = 2;
474 471
             }
475 472
             paperStudent.setChecked(checked);
476 473
 
477 474
             ePaperStudentQuestionMapper.updateBatchStuQuestion(sqlist);
478 475
             ePaperStudentMapper.updateStudentPaper(paperStudent);
479
-            //获取试卷中需要合并图片的试题
480
-            chandleStudentQuestionNoconvertedPic(pswvo.getEpsid(),2);
476
+            if(checked == 0){
477
+                //获取试卷中需要合并图片的试题
478
+                chandleStudentQuestionNoconvertedPic(pswvo.getEpsid(),2);
479
+            }
481 480
         }
482 481
     }
483 482
 

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/PaperStudentWebVo.java Ver fichero

@@ -22,7 +22,7 @@ public class PaperStudentWebVo {
22 22
     private List<EPaperStudentQuestion> questions;
23 23
 
24 24
     //学生答题卡图片
25
-    private List<String> stupic;
25
+    private String stupic;
26 26
 
27 27
     private Integer epid;//试卷id
28 28
 

+ 1
- 1
sexam/src/main/resources/application.properties Ver fichero

@@ -55,7 +55,7 @@ rabbitmq.examImgMergeQueue=xhkjedutest.xhschool.examImgMergeQueue_dev
55 55
 rabbitmq.examImgMergeHandleQueue=xhkjedutest.xhschool.examImgMergeHandleQueue_dev
56 56
 rabbitmq.examBaseToPdfQueue=xhkjedutest.xhschool.examBaseToPdfQueue_dev
57 57
 rabbitmq.examBaseToPdfHandleQueue=xhkjedutest.xhschool.examBaseToPdfHandleQueue_dev
58
-spring.rabbitmq.host=116.63.199.166
58
+spring.rabbitmq.host=49.4.26.249
59 59
 spring.rabbitmq.port=5672
60 60
 spring.rabbitmq.username=xhkjedu
61 61
 spring.rabbitmq.password=xhkjedud07

Loading…
Cancelar
Guardar