Browse Source

保存试卷答案

学生试卷-题型试题、作答、得分情况
ywx
雍文秀 1 week ago
parent
commit
7b92d4694b

+ 1
- 2
smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentController.java View File

183
     @PostMapping("/stu_paper")
183
     @PostMapping("/stu_paper")
184
     public ResultVo listStuPaperQtypeQueAnswerForWeb(@RequestBody MsPaperStudent paperStudent) {
184
     public ResultVo listStuPaperQtypeQueAnswerForWeb(@RequestBody MsPaperStudent paperStudent) {
185
         N_Utils.validation(new Object[]{paperStudent.getMpsid(), "学生试卷id", 1});
185
         N_Utils.validation(new Object[]{paperStudent.getMpsid(), "学生试卷id", 1});
186
-        List<Map<String,Object>> rtnlst = msPaperStudentService.listStuPaperQtypeQueAnswerForWeb(paperStudent.getMpsid());
187
-        return new ResultVo(0, "查询成功", rtnlst);
186
+        return new ResultVo(0, "查询成功", msPaperStudentService.listStuPaperQtypeQueAnswerForWeb(paperStudent.getMpsid()));
188
     }
187
     }
189
 
188
 
190
 }
189
 }

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

288
         // 更新试卷设置答案状态
288
         // 更新试卷设置答案状态
289
         msPaperMapper.updatePaperAnswer(1, mpid);
289
         msPaperMapper.updatePaperAnswer(1, mpid);
290
         // 保存试卷答案
290
         // 保存试卷答案
291
-        msPaperQtypeQuestionMapper.updateBatchQuestionAnswer(changelist);
291
+        if (N_Utils.isListNotEmpty(changelist)) msPaperQtypeQuestionMapper.updateBatchQuestionAnswer(changelist);
292
 
292
 
293
         // 判断考试状态是开始,已提交学生重新批阅,需要重新批阅
293
         // 判断考试状态是开始,已提交学生重新批阅,需要重新批阅
294
         PExamSubjectVo examSubjectVo = msPaperMapper.getSubjectStateByMpid(mpid);
294
         PExamSubjectVo examSubjectVo = msPaperMapper.getSubjectStateByMpid(mpid);

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckService.java View File

42
      **/
42
      **/
43
     public void add(MsPaperCheck msPaperCheck) {
43
     public void add(MsPaperCheck msPaperCheck) {
44
         Integer checkstate = msSubjectMapper.getCheckStateByMsId(msPaperCheck.getMsid());//根据考试科目id获取阅卷状态
44
         Integer checkstate = msSubjectMapper.getCheckStateByMsId(msPaperCheck.getMsid());//根据考试科目id获取阅卷状态
45
-        if (checkstate.equals(0)) throw new ServiceException("开始阅卷后不支持修改");
45
+        if (!checkstate.equals(0)) throw new ServiceException("开始阅卷后不支持修改");
46
         saveOrUpdate(msPaperCheck);
46
         saveOrUpdate(msPaperCheck);
47
     }
47
     }
48
 
48
 

+ 1
- 11
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java View File

377
     public List<Map> getScore(MsCheckParam param) {
377
     public List<Map> getScore(MsCheckParam param) {
378
         List<Map> score = msPaperCheckTeacherArbitrateMapper.getScore(param);
378
         List<Map> score = msPaperCheckTeacherArbitrateMapper.getScore(param);
379
         for (Map map : score) {
379
         for (Map map : score) {
380
-            double diffscore1 = 0;
381
-            double diffscore2 = 0;
382
-            if (map.get("scoreway").equals(2)) {
383
-                Object qscore = map.get("qscore");
384
-                Object diffscore = map.get("diffscore");
385
-                double scoreDiff1 = MarkingUtil.scoreDiff(map.get("firstccore"), qscore);
386
-                double scoreDiff2 = MarkingUtil.scoreDiff(map.get("secondcscore"), qscore);
387
-                diffscore1 = MarkingUtil.sub(diffscore, scoreDiff1);
388
-                diffscore2 = MarkingUtil.sub(diffscore, scoreDiff2);
389
-            }
390
-            map.put("diffscore1", diffscore1);
380
+            double diffscore2 = MarkingUtil.scoreDiff(map.get("firstccore"), map.get("secondcscore"));
391
             map.put("diffscore2", diffscore2);
381
             map.put("diffscore2", diffscore2);
392
         }
382
         }
393
         return score;
383
         return score;

+ 3
- 3
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java View File

404
     //格式化科目数据列表
404
     //格式化科目数据列表
405
     private List<Map<String, Object>> formatSubjectList(StudentParams params, List<Map<String, Object>> list
405
     private List<Map<String, Object>> formatSubjectList(StudentParams params, List<Map<String, Object>> list
406
             , List<String> infoFields, String[] gradeFields, String groupname) {
406
             , List<String> infoFields, String[] gradeFields, String groupname) {
407
-        Map<Integer, List<Map>> collect = list.stream().collect(Collectors.groupingBy(
408
-                m -> N_Utils.obj2Int(m.get("subjectid")), LinkedHashMap::new, Collectors.toList()));
407
+        Map<String, List<Map>> collect = list.stream().collect(Collectors.groupingBy(
408
+                m -> m.get("subjectid").toString(), LinkedHashMap::new, Collectors.toList()));
409
         List<Map<String, Object>> result = new ArrayList<>();
409
         List<Map<String, Object>> result = new ArrayList<>();
410
-        for (Map.Entry<Integer, List<Map>> entry : collect.entrySet()) {
410
+        for (Map.Entry<String, List<Map>> entry : collect.entrySet()) {
411
             List<Map> values = entry.getValue();
411
             List<Map> values = entry.getValue();
412
             Map<String, Object> map = new LinkedHashMap<>();
412
             Map<String, Object> map = new LinkedHashMap<>();
413
             Map info = values.get(0);
413
             Map info = values.get(0);

+ 5
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentService.java View File

314
      * @Param [mpsid]
314
      * @Param [mpsid]
315
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
315
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
316
      **/
316
      **/
317
-    public List<Map<String,Object>> listStuPaperQtypeQueAnswerForWeb(Integer mpsid){
317
+    public Map<String,Object> listStuPaperQtypeQueAnswerForWeb(Integer mpsid){
318
         Integer papertype = msPaperMapper.getPaperTypeByMpsid(mpsid);
318
         Integer papertype = msPaperMapper.getPaperTypeByMpsid(mpsid);
319
         List<Map<String,Object>> rtnList;
319
         List<Map<String,Object>> rtnList;
320
         if(papertype == 1) {
320
         if(papertype == 1) {
323
         }else{
323
         }else{
324
             rtnList = msPaperStudentQuestionMapper.listStuPaperQtypeQueAnswerForWebFj(mpsid);
324
             rtnList = msPaperStudentQuestionMapper.listStuPaperQtypeQueAnswerForWebFj(mpsid);
325
         }
325
         }
326
-        return rtnList;
326
+        Map<String, Object> map = new HashMap<>();
327
+        map.put("papertype", papertype);
328
+        map.put("qtypes", rtnList);
329
+        return map;
327
     }
330
     }
328
 }
331
 }

+ 1
- 0
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java View File

966
     // 根据指定科目字段排序
966
     // 根据指定科目字段排序
967
     public static List<Map<String, Object>> sortBySubjectField(List<Map<String, Object>> students
967
     public static List<Map<String, Object>> sortBySubjectField(List<Map<String, Object>> students
968
             , String fieldValue, String fieldName,String groupname, Integer od,String listName) {
968
             , String fieldValue, String fieldName,String groupname, Integer od,String listName) {
969
+        if (od == null) od = 2;
969
         if (N_Utils.isEmpty(fieldValue)) {
970
         if (N_Utils.isEmpty(fieldValue)) {
970
             if (od.equals(2)) {//降序
971
             if (od.equals(2)) {//降序
971
                 return students.stream().sorted(Comparator.comparing(student -> student.get(fieldName).toString(), Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList());
972
                 return students.stream().sorted(Comparator.comparing(student -> student.get(fieldName).toString(), Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList());

+ 2
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

69
     </select>
69
     </select>
70
     <!--获取考试下所有科目名称-->
70
     <!--获取考试下所有科目名称-->
71
     <select id="listSubjectNameByExamId" resultType="java.util.Map">
71
     <select id="listSubjectNameByExamId" resultType="java.util.Map">
72
-        select distinct s.subjectid,s.subjectname,p.mpid from ms_subject s
72
+        select distinct s.subjectid,s.subjectname,p.mpid,s.msid
73
+        from ms_subject s
73
         left join ms_paper p on s.msid=p.msid where s.examid=#{examid} order by s.msid
74
         left join ms_paper p on s.msid=p.msid where s.examid=#{examid} order by s.msid
74
     </select>
75
     </select>
75
     <!--根据考试科目id获取阅卷状态-->
76
     <!--根据考试科目id获取阅卷状态-->

Loading…
Cancel
Save