Browse Source

学生报告,批量改分

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

+ 8
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentQuestionHistoryController.java View File

4
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestionHistory;
5
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestionHistory;
6
 import com.xhkjedu.sexam.service.paperstudent.EPaperStudentQuestionHistoryService;
6
 import com.xhkjedu.sexam.service.paperstudent.EPaperStudentQuestionHistoryService;
7
+import com.xhkjedu.sexam.vo.paperstudent.PaperStudentParamsVo;
8
+import com.xhkjedu.sexam.vo.paperstudent.QuestionScoreVo;
7
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
8
 import com.xhkjedu.utils.PageUtil;
10
 import com.xhkjedu.utils.PageUtil;
9
 import com.xhkjedu.vo.PageResult;
11
 import com.xhkjedu.vo.PageResult;
27
 
29
 
28
     //更改学生试题得分
30
     //更改学生试题得分
29
     @PostMapping("/upstus")
31
     @PostMapping("/upstus")
30
-    public ResultVo updateQuestionStuscore(@RequestBody EPaperStudentQuestionHistory psh) {
32
+    public ResultVo updateQuestionStuscore(@RequestBody PaperStudentParamsVo psh) {
31
         try {
33
         try {
32
-            N_Utils.validation(new Object[]{psh.getEpsqid(), "试题id", 1, psh.getTeacherid(),"教师id",1});
34
+            List<QuestionScoreVo> queslist = psh.getQuestions();
35
+            N_Utils.validation(new Object[]{psh.getTeacherid(),"教师id",1});
36
+            if(N_Utils.isListEmpty(queslist)){
37
+                return new ResultVo(1,"试题不能为空");
38
+            }
33
             ePaperStudentQuestionHistoryService.updateQuestionStuscore(psh);
39
             ePaperStudentQuestionHistoryService.updateQuestionStuscore(psh);
34
             return new ResultVo(0, "成功保存学生试题得分");
40
             return new ResultVo(0, "成功保存学生试题得分");
35
         } catch (Exception e) {
41
         } catch (Exception e) {

+ 22
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportStudentController.java View File

122
     public ResultVo listStudentSubjectErrorQues(@RequestBody ReportParamsVo params) {
122
     public ResultVo listStudentSubjectErrorQues(@RequestBody ReportParamsVo params) {
123
         Integer studentid = params.getStudentid();
123
         Integer studentid = params.getStudentid();
124
         Integer exmaid = params.getExamid();
124
         Integer exmaid = params.getExamid();
125
-        String subjectid = params.getSubjectid();
126
         N_Utils.validation(new Object[]{exmaid,"考试id",1,studentid,"学生id",1});
125
         N_Utils.validation(new Object[]{exmaid,"考试id",1,studentid,"学生id",1});
127
         List<Map> map = eReportStudentService.listStudentSubjectErrorQues(exmaid,studentid);
126
         List<Map> map = eReportStudentService.listStudentSubjectErrorQues(exmaid,studentid);
127
+        return new ResultVo(0, "获取科目错题数量成功", map);
128
+    }
129
+
130
+    //学生报告-错题集-学生科目下错题(附件)
131
+    @PostMapping("/serrorfj")
132
+    public ResultVo listStudentErrorQuesForFj(@RequestBody ReportParamsVo params) {
133
+        Integer studentid = params.getStudentid();
134
+        Integer exmaid = params.getExamid();
135
+        String subjectid = params.getSubjectid();
136
+        N_Utils.validation(new Object[]{exmaid,"考试id",1,studentid,"学生id",1,subjectid,"科目id",3});
137
+        List<Map> map = eReportStudentService.listStudentErrorQuestionsFj(exmaid,studentid,subjectid);
138
+        return new ResultVo(0, "获取科目错题成功", map);
139
+    }
140
+
141
+    //学生报告-错题集-学生科目下错题(题库)
142
+    @PostMapping("/serrorq")
143
+    public ResultVo listStudentErrorQuesForTK(@RequestBody ReportParamsVo params) {
144
+        Integer studentid = params.getStudentid();
145
+        Integer exmaid = params.getExamid();
146
+        String subjectid = params.getSubjectid();
147
+        N_Utils.validation(new Object[]{exmaid,"考试id",1,studentid,"学生id",1,subjectid,"科目id",3});
148
+        Map map = eReportStudentService.listStudentErrorQuestionsTk(exmaid,studentid,subjectid);
128
         return new ResultVo(0, "获取科目错题成功", map);
149
         return new ResultVo(0, "获取科目错题成功", map);
129
     }
150
     }
130
 
151
 

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperAnalyzeMapper.java View File

18
 
18
 
19
     //获取试卷分析
19
     //获取试卷分析
20
     Map getPaperAnalzyeByEpid(@Param("epid")Integer epid);
20
     Map getPaperAnalzyeByEpid(@Param("epid")Integer epid);
21
+
22
+    //根据考试id和科目获取试卷你分析
23
+    Map getPaperAnalzyeBySubjectid(@Param("examid")Integer examid,@Param("subjectid")String subjectid);
21
 }
24
 }

+ 3
- 6
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentQuestionMapper.java View File

52
     //报告生成-学生试卷
52
     //报告生成-学生试卷
53
     List<EPaperStudentQuestion> listExamStudentsAnswer(@Param("examid")Integer examid);
53
     List<EPaperStudentQuestion> listExamStudentsAnswer(@Param("examid")Integer examid);
54
 
54
 
55
-    //修改学生得分
56
-    void updateStuScoreByepsqid(@Param("stuscore")Double stuscore,@Param("epsqid")Integer epsqid);
57
-
58
-    //根据试题id获取考试信息
59
-    EPaperStudentQuestion getExamPaperStudntQuestionbyEpsqid(@Param("epsqid")Integer epsqid);
60
-
61
     //学生作答得分试卷-题库
55
     //学生作答得分试卷-题库
62
     List<Map> listQStuQuestionScore(@Param("epsid")Integer epsid);
56
     List<Map> listQStuQuestionScore(@Param("epsid")Integer epsid);
63
 
57
 
64
     //学生作答得分试卷-附件
58
     //学生作答得分试卷-附件
65
     List<Map> listFjStuQuestionScore(@Param("epsid")Integer epsid);
59
     List<Map> listFjStuQuestionScore(@Param("epsid")Integer epsid);
66
 
60
 
61
+    //根据学生试卷id获取学生作答内容
62
+    List<EPaperStudentQuestion> listStuQuestionsByEpsid(@Param("epsid")Integer epsid);
63
+
67
 }
64
 }

+ 5
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportstu/ERstudentMapper.java View File

31
     List<Map> listStudentQuestionsTk(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
31
     List<Map> listStudentQuestionsTk(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
32
     //学生报告-试卷分析(附件)
32
     //学生报告-试卷分析(附件)
33
     List<Map> listStudentQuestionsFj(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
33
     List<Map> listStudentQuestionsFj(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
34
-    //学生报告-错题集-科目错题
34
+    //学生报告-错题集-科目错题
35
     List<Map> listStudentSubjectErrorQues(@Param("examid")Integer examid,@Param("studentid")Integer studentid);
35
     List<Map> listStudentSubjectErrorQues(@Param("examid")Integer examid,@Param("studentid")Integer studentid);
36
+    //学生报告-错题集-学生科目下错题
37
+    List<Map> listStudentErrorQuestionsForTk(@Param("examid")Integer examid,@Param("studentid")Integer studentid,@Param("subjectid")String subjectid);
38
+    //学生报告-错题集-学生科目下错题(附件)
39
+    List<Map> listStudentErrorQuestionsForFj(@Param("examid")Integer examid,@Param("studentid")Integer studentid,@Param("subjectid")String subjectid);
36
 }
40
 }

+ 34
- 14
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentQuestionHistoryService.java View File

5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
7
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestionHistory;
7
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestionHistory;
8
+import com.xhkjedu.sexam.vo.paperstudent.PaperStudentParamsVo;
9
+import com.xhkjedu.sexam.vo.paperstudent.QuestionScoreVo;
8
 import com.xhkjedu.utils.N_Utils;
10
 import com.xhkjedu.utils.N_Utils;
9
 import org.springframework.stereotype.Service;
11
 import org.springframework.stereotype.Service;
10
 import org.springframework.transaction.annotation.Transactional;
12
 import org.springframework.transaction.annotation.Transactional;
11
 
13
 
12
 import javax.annotation.Resource;
14
 import javax.annotation.Resource;
15
+import java.util.ArrayList;
13
 import java.util.List;
16
 import java.util.List;
14
 import java.util.Map;
17
 import java.util.Map;
15
 
18
 
32
      * @Date 2022/8/10 16:17
35
      * @Date 2022/8/10 16:17
33
      **/
36
      **/
34
     @Transactional(rollbackFor = Exception.class)
37
     @Transactional(rollbackFor = Exception.class)
35
-    public void updateQuestionStuscore(EPaperStudentQuestionHistory sqh){
36
-        //学生试题详情
37
-        EPaperStudentQuestion q = ePaperStudentQuestionMapper.getExamPaperStudntQuestionbyEpsqid(sqh.getEpsqid());
38
-        sqh.setExamid(q.getExamid());
39
-        sqh.setSubjectid(q.getSubjectid());
40
-        sqh.setEpid(q.getEpid());
41
-        sqh.setClassid(q.getClassid());
42
-        sqh.setStudentid(q.getStudentid());
43
-        sqh.setCreatetime(N_Utils.getSecondTimestamp());
44
-        sqh.setStuscore(q.getStuscore());
45
-        sqh.setQn(q.getQn());
38
+    public void updateQuestionStuscore(PaperStudentParamsVo psparams){
39
+        //获取学生试卷作答情况
40
+        List<EPaperStudentQuestion> stuques = ePaperStudentQuestionMapper.listStuQuestionsByEpsid(psparams.getEpsid());
41
+        List<QuestionScoreVo> queslist = psparams.getQuestions();
42
+        List<EPaperStudentQuestion> upqueslist = new ArrayList<>();//修改的试题分值
43
+        List<EPaperStudentQuestionHistory> sqhlist = new ArrayList<>();//修改历史记录
44
+        for(QuestionScoreVo q : queslist){
45
+            EPaperStudentQuestion sq = new EPaperStudentQuestion();
46
+            sq.setEpsqid(q.getEpsqid());
47
+            sq.setStuscore(q.getStuscore());
48
+            upqueslist.add(sq);
49
+
50
+            //获取该试题
51
+            EPaperStudentQuestion psques = stuques.stream().filter(s-> s.getEpsqid().equals(q.getEpsqid())).findFirst().orElse(null);
52
+            if(psques !=null){
53
+                EPaperStudentQuestionHistory sqh = new EPaperStudentQuestionHistory();
54
+                sqh.setExamid(psques.getExamid());
55
+                sqh.setSubjectid(psques.getSubjectid());
56
+                sqh.setEpid(psques.getEpid());
57
+                sqh.setClassid(psques.getClassid());
58
+                sqh.setStudentid(psques.getStudentid());
59
+                sqh.setCreatetime(N_Utils.getSecondTimestamp());
60
+                sqh.setStuscore(psques.getStuscore());
61
+                sqh.setUpscore(q.getStuscore());
62
+                sqh.setQn(psques.getQn());
63
+                sqhlist.add(sqh);
64
+            }
65
+        }
46
 
66
 
47
         //修改学生单个试题得分
67
         //修改学生单个试题得分
48
-        ePaperStudentQuestionMapper.updateStuScoreByepsqid(sqh.getUpscore(),sqh.getEpsqid());
68
+        ePaperStudentQuestionMapper.updateBatchStuQuestionScore(upqueslist);
49
         //修改学生试卷分值
69
         //修改学生试卷分值
50
-        ePaperStudentMapper.updateStuPaperscoreEpsid(q.getEpsid());
70
+        ePaperStudentMapper.updateStuPaperscoreEpsid(psparams.getEpsid());
51
         //保存更改学生分值记录
71
         //保存更改学生分值记录
52
-        ePaperStudentQuestionHistoryMapper.insertSelective(sqh);
72
+        ePaperStudentQuestionHistoryMapper.insertList(sqhlist);
53
     }
73
     }
54
 
74
 
55
     /**
75
     /**

+ 74
- 20
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

1
 package com.xhkjedu.sexam.service.report;
1
 package com.xhkjedu.sexam.service.report;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
3
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
6
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
7
+import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
8
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
7
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
9
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
11
+import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
12
+import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
9
 import com.xhkjedu.utils.N_Utils;
13
 import com.xhkjedu.utils.N_Utils;
10
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
11
 
15
 
12
 import javax.annotation.Resource;
16
 import javax.annotation.Resource;
13
-import java.util.ArrayList;
14
-import java.util.HashMap;
15
-import java.util.List;
16
-import java.util.Map;
17
+import java.lang.reflect.Array;
18
+import java.util.*;
17
 import java.util.stream.Collectors;
19
 import java.util.stream.Collectors;
18
 
20
 
19
 /**
21
 /**
36
     private EPaperMapper ePaperMapper;
38
     private EPaperMapper ePaperMapper;
37
     @Resource
39
     @Resource
38
     private EPaperFileMapper ePaperFileMapper;
40
     private EPaperFileMapper ePaperFileMapper;
41
+    @Resource
42
+    private EPaperAnalyzeMapper ePaperAnalyzeMapper;
39
 
43
 
40
     /**
44
     /**
41
      * @Description 获取考试基本信息(科目、班级、班级下学生)
45
      * @Description 获取考试基本信息(科目、班级、班级下学生)
201
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
205
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
202
                 map.put("stuanswer", q.get("stuanswer").toString());
206
                 map.put("stuanswer", q.get("stuanswer").toString());
203
                 map.put("stuanswertxt", q.get("stuanswertxt").toString());
207
                 map.put("stuanswertxt", q.get("stuanswertxt").toString());
208
+                map.put("answer", q.get("answer").toString());
204
                 map.put("qstem", q.get("qstem").toString());
209
                 map.put("qstem", q.get("qstem").toString());
205
                 map.put("qoption", q.get("qoption").toString());
210
                 map.put("qoption", q.get("qoption").toString());
206
-                map.put("qanswer", q.get("qanswer").toString());
207
                 map.put("qanalyze", q.get("qanalyze").toString());
211
                 map.put("qanalyze", q.get("qanalyze").toString());
208
                 map.put("hashear", Integer.parseInt(q.get("hashear").toString()));
212
                 map.put("hashear", Integer.parseInt(q.get("hashear").toString()));
209
                 map.put("hearfile", q.get("hearfile").toString());
213
                 map.put("hearfile", q.get("hearfile").toString());
246
     }
250
     }
247
 
251
 
248
     /**
252
     /**
249
-     * @Description 学生报告--错题集
253
+     * @Description 学生报告--错题集--科目错题数量
250
      * @Param [examid, studentid]
254
      * @Param [examid, studentid]
251
      * @Return java.util.List<java.util.Map>
255
      * @Return java.util.List<java.util.Map>
252
      * @Author wn
256
      * @Author wn
256
         List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid);
260
         List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid);
257
         for (Map map : list) {
261
         for (Map map : list) {
258
             List<Map> queslist = (List<Map>) map.get("questions");
262
             List<Map> queslist = (List<Map>) map.get("questions");
259
-            //单题的数量
260
-            List<Map> dtlist = queslist.stream().filter(s -> Integer.parseInt(s.get("qlevel").toString()) == 1).collect(Collectors.toList());
261
-            //子题
262
-            List<Map> sonlist = queslist.stream().filter(s -> Integer.parseInt(s.get("qlevel").toString()) == 3).collect(Collectors.toList());
263
-            Map<String,List<Map>> mtmap = sonlist.stream().collect(Collectors.groupingBy(s -> s.get("questionpid").toString()));
264
-            int num = 0;
265
-            if(N_Utils.isListNotEmpty(dtlist)){
266
-                num = dtlist.size();
267
-            }
268
-            if(mtmap!=null && mtmap.size()>0){
269
-                num = num + mtmap.size();
263
+            Integer ptype = Integer.parseInt(map.get("ptype").toString());
264
+            if(ptype==1){
265
+                //单题的数量
266
+                List<Map> dtlist = queslist.stream().filter(s -> Integer.parseInt(s.get("qlevel").toString()) == 1).collect(Collectors.toList());
267
+                //子题
268
+                List<Map> sonlist = queslist.stream().filter(s -> Integer.parseInt(s.get("qlevel").toString()) == 3).collect(Collectors.toList());
269
+                Map<String,List<Map>> mtmap = sonlist.stream().collect(Collectors.groupingBy(s -> s.get("questionpid").toString()));
270
+                int num = 0;
271
+                if(N_Utils.isListNotEmpty(dtlist)){
272
+                    num = dtlist.size();
273
+                }
274
+                if(mtmap!=null && mtmap.size()>0){
275
+                    num = num + mtmap.size();
276
+                }
277
+                map.put("num",num);
278
+            }else{
279
+                map.put("num",queslist.size());
270
             }
280
             }
271
-            map.put("num",num);
272
             map.remove("questions");
281
             map.remove("questions");
273
             return list;
282
             return list;
274
         }
283
         }
275
         return list;
284
         return list;
276
     }
285
     }
277
 
286
 
278
-    public void listStudentErrorQuestions(Integer examid, Integer studentid,String subjectid){
279
-        
287
+    /**
288
+     * @Description 学生报告--错题集--题库
289
+     * @Param [examid, studentid, subjectid]
290
+     * @Return java.util.Map
291
+     * @Author wn
292
+     * @Date 2022/8/29 16:15
293
+     **/
294
+    public Map listStudentErrorQuestionsTk(Integer examid, Integer studentid,String subjectid){
295
+        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForTk(examid,studentid,subjectid);
296
+        Map panalyze = ePaperAnalyzeMapper.getPaperAnalzyeBySubjectid(examid,subjectid);
297
+        String pointjson = panalyze.get("pointjson").toString();
298
+        List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
299
+        List<Map> pointqueslist = new ArrayList<>();
300
+        for(Map pointmap : pointlist){
301
+            //知识点包含的试题
302
+            List<QuestionOrderVo> ques = (List<QuestionOrderVo>) pointmap.get("ques");
303
+            List<Integer> eptqidlist = new ArrayList<>();//知识点关联的所有试题
304
+            for(QuestionOrderVo qovo : ques){
305
+                Integer[] eptqids = qovo.getEptqids();
306
+                eptqidlist.addAll(Arrays.asList(eptqids));
307
+            }
308
+            //获取知识点下试题
309
+            List<Map> poinques = list.stream().filter(s -> eptqidlist.contains(Integer.parseInt(s.get("eptqid").toString()))).collect(Collectors.toList());
310
+            if(N_Utils.isListNotEmpty(poinques)){
311
+                Map pmap = new HashMap();
312
+                pmap.put("pointid",pointmap.get("pointid").toString());
313
+                pmap.put("pointname",pointmap.get("pointname").toString());
314
+                pmap.put("questions",setPaperQuestionForTK(poinques));
315
+                pointqueslist.add(pmap);
316
+            }
317
+        }
318
+        Map map = new HashMap();
319
+        map.put("questions",setPaperQuestionForTK(list));
320
+        map.put("points",pointqueslist);
321
+        return map;
322
+    }
323
+
324
+    /**
325
+     * @Description 学生报告-错题集-学生科目下错题(附件)
326
+     * @Param [examid, studentid, subjectid]
327
+     * @Return java.util.Map
328
+     * @Author wn
329
+     * @Date 2022/8/29 16:15
330
+     **/
331
+    public List<Map> listStudentErrorQuestionsFj(Integer examid, Integer studentid,String subjectid){
332
+        return eRstudentMapper.listStudentErrorQuestionsForFj(examid,studentid,subjectid);
280
     }
333
     }
334
+
281
 }
335
 }

+ 20
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/PaperStudentParamsVo.java View File

1
+package com.xhkjedu.sexam.vo.paperstudent;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.ArrayList;
6
+import java.util.List;
7
+
8
+/**
9
+ * @Description
10
+ * @Author WN
11
+ * Date 2022/8/29 14:53
12
+ **/
13
+@Data
14
+public class PaperStudentParamsVo {
15
+    private Integer teacherid;
16
+
17
+    private Integer epsid;//学生试卷id
18
+
19
+    private List<QuestionScoreVo> questions = new ArrayList<>();
20
+}

+ 15
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/QuestionScoreVo.java View File

1
+package com.xhkjedu.sexam.vo.paperstudent;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description
7
+ * @Author WN
8
+ * Date 2022/8/29 14:54
9
+ **/
10
+@Data
11
+public class QuestionScoreVo {
12
+    private Integer epsqid;//学生试题id
13
+
14
+    private Double stuscore;//学生试题得分
15
+}

+ 7
- 0
sexam/src/main/resources/mapper/paper/EPaperAnalyzeMapper.xml View File

10
     <select id="getPaperAnalzyeByEpid" resultType="java.util.Map">
10
     <select id="getPaperAnalzyeByEpid" resultType="java.util.Map">
11
         select * from e_paper_analyze where epid=#{epid}
11
         select * from e_paper_analyze where epid=#{epid}
12
     </select>
12
     </select>
13
+    
14
+    <!--根据考试id和科目获取试卷你分析-->
15
+    <select id="getPaperAnalzyeBySubjectid" resultType="java.util.Map">
16
+        select a.* from e_paper_analyze a left join e_paper p on a.epid= p.epid
17
+        left join e_subject s on p.esid=s.esid
18
+        where s.examid=#{examid} and s.subjectid=#{subjectid}
19
+    </select>
13
 
20
 
14
 </mapper>
21
 </mapper>

+ 5
- 10
sexam/src/main/resources/mapper/paperstudent/EPaperStudentQuestionMapper.xml View File

137
         left join t_user u on q.studentid=u.userid where s.examid=#{examid} and s.sstate=2 group by q.epsqid
137
         left join t_user u on q.studentid=u.userid where s.examid=#{examid} and s.sstate=2 group by q.epsqid
138
     </select>
138
     </select>
139
 
139
 
140
-    <!--修改学生得分-->
141
-    <update id="updateStuScoreByepsqid">
142
-        update e_paper_student_question set stuscore=#{stuscore} where epsqid=#{epsqid}
143
-    </update>
144
-    <!---根据试题id获取考试信息-->
145
-    <select id="getExamPaperStudntQuestionbyEpsqid" resultType="com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion">
146
-        select q.*,s.examid,s.subjectid from e_paper_student_question q left join e_paper_student s on s.epsid=q.epsid
147
-        where q.epsqid=#{epsqid}
148
-    </select>
149
-
150
     <!--学生作答试卷题库-->
140
     <!--学生作答试卷题库-->
151
     <resultMap id="qtypesQuestion" type="java.util.Map">
141
     <resultMap id="qtypesQuestion" type="java.util.Map">
152
         <result column="ctype" property="ctype"></result>
142
         <result column="ctype" property="ctype"></result>
231
         where psq.epsid=#{epsid} order by pt.eptorder, psq.qorder
221
         where psq.epsid=#{epsid} order by pt.eptorder, psq.qorder
232
     </select>
222
     </select>
233
 
223
 
224
+    <!--根据学生试卷id获取学生作答内容-->
225
+    <select id="listStuQuestionsByEpsid" resultType="com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion">
226
+        select * from e_paper_student_question where epsid=#{epsid} order by epsqid
227
+    </select>
228
+
234
 </mapper>
229
 </mapper>

+ 35
- 7
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

98
         <result property="stuanswertxt" column="stuanswertxt" />
98
         <result property="stuanswertxt" column="stuanswertxt" />
99
         <result property="qstem" column="qstem" />
99
         <result property="qstem" column="qstem" />
100
         <result property="qoption" column="qoption" />
100
         <result property="qoption" column="qoption" />
101
-        <result property="qanswer" column="qanswer" />
101
+        <result property="answer" column="answer" />
102
         <result property="qanalyze" column="qanalyze" />
102
         <result property="qanalyze" column="qanalyze" />
103
         <result property="hashear" column="hashear" />
103
         <result property="hashear" column="hashear" />
104
         <result property="hearfile" column="hearfile" />
104
         <result property="hearfile" column="hearfile" />
125
     </resultMap>
125
     </resultMap>
126
     <select id="listStudentQuestionsTk" resultMap="listStudentQues">
126
     <select id="listStudentQuestionsTk" resultMap="listStudentQues">
127
         select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
127
         select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
128
-        sq.answertype,sq.stuanswer,sq.stuanswertxt,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.hashear,q.hearfile,
128
+        sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,q.qstem,q.qoption,q.qanalyze,q.hashear,q.hearfile,
129
         q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
129
         q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
130
         mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
130
         mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
131
         cq.classavgscore,cq.gradeavgscore
131
         cq.classavgscore,cq.gradeavgscore
132
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
132
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
133
         left join t_question mq on q.questionpid=mq.questionid
133
         left join t_question mq on q.questionpid=mq.questionid
134
         left join e_rclass_question cq on sq.eptqid=cq.eptqid
134
         left join e_rclass_question cq on sq.eptqid=cq.eptqid
135
+        left join e_paper_qtype_question pq on sq.eptqid=pq.eptqid
135
         where sq.epid=#{epid} and sq.studentid=#{studentid} GROUP BY sq.epsqid order by sq.qorder,q.sorder
136
         where sq.epid=#{epid} and sq.studentid=#{studentid} GROUP BY sq.epsqid order by sq.qorder,q.sorder
136
     </select>
137
     </select>
137
     <select id="listQuesPoints" resultType="java.util.Map">
138
     <select id="listQuesPoints" resultType="java.util.Map">
154
         where sq.epid=#{epid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
155
         where sq.epid=#{epid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
155
     </select>
156
     </select>
156
 
157
 
157
-    <!--学生报告-错题集-科目错题-->
158
+    <!--学生报告-错题集-科目错题-->
158
     <resultMap id="listStudentSubjectErrorQues" type="java.util.Map">
159
     <resultMap id="listStudentSubjectErrorQues" type="java.util.Map">
159
         <result property="subjectid" column="subjectid" />
160
         <result property="subjectid" column="subjectid" />
160
         <result property="subjectname" column="subjectname" />
161
         <result property="subjectname" column="subjectname" />
162
+        <result property="ptype" column="ptype" />
161
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
163
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
164
+            <result property="eptqid" column="eptqid" />
162
             <result property="questionid" column="questionid" />
165
             <result property="questionid" column="questionid" />
163
             <result property="qlevel" column="qlevel" />
166
             <result property="qlevel" column="qlevel" />
164
             <result property="questionpid" column="questionpid" />
167
             <result property="questionpid" column="questionpid" />
165
         </collection>
168
         </collection>
166
     </resultMap>
169
     </resultMap>
167
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
170
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
168
-        select sq.subjectid,s.subjectname,q.questionid,q.qlevel,q.questionpid
171
+        select sq.subjectid,s.subjectname,sq.eptqid,q.questionid,q.qlevel,q.questionpid
169
         from e_paper_student_question sq
172
         from e_paper_student_question sq
170
-                 left join t_question q on q.questionid=sq.questionid
171
-                 left join t_subject s on sq.subjectid=s.subjectid
172
-                 left join t_question mq on q.questionpid=mq.questionid
173
+        left join t_question q on q.questionid=sq.questionid
174
+        left join t_subject s on sq.subjectid=s.subjectid
175
+        left join t_question mq on q.questionpid=mq.questionid
173
         where sq.examid=#{examid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore group by s.subjectid order by s.subjectorder
176
         where sq.examid=#{examid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore group by s.subjectid order by s.subjectorder
174
     </select>
177
     </select>
178
+    <!--学生报告-错题集-学生科目下错题(题库)-->
179
+    <select id="listStudentErrorQuestionsForTk" resultMap="listStudentQues">
180
+        select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
181
+               sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.hashear,q.hearfile,
182
+               q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
183
+               mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
184
+               cq.classavgscore,cq.gradeavgscore
185
+        from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
186
+        left join t_question mq on q.questionpid=mq.questionid
187
+        left join e_rclass_question cq on sq.eptqid=cq.eptqid
188
+        left join e_paper_qtype_question pq on sq.eptqid=pq.eptqid
189
+        where sq.examid=#{examid} and sq.subjectid=#{subjectid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore
190
+        GROUP BY sq.epsqid order by sq.qorder,q.sorder
191
+    </select>
192
+
193
+    <!--学生报告-错题集-学生科目下错题(附件)-->
194
+    <select id="listStudentErrorQuestionsForFj" resultType="java.util.Map">
195
+        select sq.epsqid,sq.eptqid,sq.ctype,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
196
+               sq.answertype,sq.stuanswer,sq.stuanswertxt,q.qtypeid,q.qtypename,q.optionnum,q.answer,
197
+               cq.classavgscore,cq.gradeavgscore
198
+        from e_paper_student_question sq left join e_rclass_question cq on sq.eptqid=cq.eptqid
199
+        left join e_paper_qtype_question q on sq.eptqid=q.eptqid
200
+        where sq.examid=#{examid} and sq.subjectid=#{subjectid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
201
+
202
+    </select>
175
 
203
 
176
 </mapper>
204
 </mapper>

Loading…
Cancel
Save