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,6 +4,8 @@ import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestionHistory;
6 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 9
 import com.xhkjedu.utils.N_Utils;
8 10
 import com.xhkjedu.utils.PageUtil;
9 11
 import com.xhkjedu.vo.PageResult;
@@ -27,9 +29,13 @@ public class EPaperStudentQuestionHistoryController {
27 29
 
28 30
     //更改学生试题得分
29 31
     @PostMapping("/upstus")
30
-    public ResultVo updateQuestionStuscore(@RequestBody EPaperStudentQuestionHistory psh) {
32
+    public ResultVo updateQuestionStuscore(@RequestBody PaperStudentParamsVo psh) {
31 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 39
             ePaperStudentQuestionHistoryService.updateQuestionStuscore(psh);
34 40
             return new ResultVo(0, "成功保存学生试题得分");
35 41
         } catch (Exception e) {

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

@@ -122,9 +122,30 @@ public class EReportStudentController {
122 122
     public ResultVo listStudentSubjectErrorQues(@RequestBody ReportParamsVo params) {
123 123
         Integer studentid = params.getStudentid();
124 124
         Integer exmaid = params.getExamid();
125
-        String subjectid = params.getSubjectid();
126 125
         N_Utils.validation(new Object[]{exmaid,"考试id",1,studentid,"学生id",1});
127 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 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,4 +18,7 @@ public interface EPaperAnalyzeMapper extends TkMapper<EPaperAnalyze> {
18 18
 
19 19
     //获取试卷分析
20 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,16 +52,13 @@ public interface EPaperStudentQuestionMapper extends TkMapper<EPaperStudentQuest
52 52
     //报告生成-学生试卷
53 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 56
     List<Map> listQStuQuestionScore(@Param("epsid")Integer epsid);
63 57
 
64 58
     //学生作答得分试卷-附件
65 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,6 +31,10 @@ public interface ERstudentMapper extends TkMapper<ERstudent> {
31 31
     List<Map> listStudentQuestionsTk(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
32 32
     //学生报告-试卷分析(附件)
33 33
     List<Map> listStudentQuestionsFj(@Param("epid")Integer epid,@Param("studentid")Integer studentid);
34
-    //学生报告-错题集-科目错题
34
+    //学生报告-错题集-科目错题
35 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,11 +5,14 @@ import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionHistoryMapper;
5 5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6 6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
7 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 10
 import com.xhkjedu.utils.N_Utils;
9 11
 import org.springframework.stereotype.Service;
10 12
 import org.springframework.transaction.annotation.Transactional;
11 13
 
12 14
 import javax.annotation.Resource;
15
+import java.util.ArrayList;
13 16
 import java.util.List;
14 17
 import java.util.Map;
15 18
 
@@ -32,24 +35,41 @@ public class EPaperStudentQuestionHistoryService {
32 35
      * @Date 2022/8/10 16:17
33 36
      **/
34 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,19 +1,21 @@
1 1
 package com.xhkjedu.sexam.service.report;
2 2
 
3
+import com.alibaba.fastjson.JSON;
3 4
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4 5
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5 6
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
7
+import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
6 8
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
7 9
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8 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 13
 import com.xhkjedu.utils.N_Utils;
10 14
 import org.springframework.stereotype.Service;
11 15
 
12 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 19
 import java.util.stream.Collectors;
18 20
 
19 21
 /**
@@ -36,6 +38,8 @@ public class EReportStudentService {
36 38
     private EPaperMapper ePaperMapper;
37 39
     @Resource
38 40
     private EPaperFileMapper ePaperFileMapper;
41
+    @Resource
42
+    private EPaperAnalyzeMapper ePaperAnalyzeMapper;
39 43
 
40 44
     /**
41 45
      * @Description 获取考试基本信息(科目、班级、班级下学生)
@@ -201,9 +205,9 @@ public class EReportStudentService {
201 205
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
202 206
                 map.put("stuanswer", q.get("stuanswer").toString());
203 207
                 map.put("stuanswertxt", q.get("stuanswertxt").toString());
208
+                map.put("answer", q.get("answer").toString());
204 209
                 map.put("qstem", q.get("qstem").toString());
205 210
                 map.put("qoption", q.get("qoption").toString());
206
-                map.put("qanswer", q.get("qanswer").toString());
207 211
                 map.put("qanalyze", q.get("qanalyze").toString());
208 212
                 map.put("hashear", Integer.parseInt(q.get("hashear").toString()));
209 213
                 map.put("hearfile", q.get("hearfile").toString());
@@ -246,7 +250,7 @@ public class EReportStudentService {
246 250
     }
247 251
 
248 252
     /**
249
-     * @Description 学生报告--错题集
253
+     * @Description 学生报告--错题集--科目错题数量
250 254
      * @Param [examid, studentid]
251 255
      * @Return java.util.List<java.util.Map>
252 256
      * @Author wn
@@ -256,26 +260,76 @@ public class EReportStudentService {
256 260
         List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid);
257 261
         for (Map map : list) {
258 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 281
             map.remove("questions");
273 282
             return list;
274 283
         }
275 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

@@ -0,0 +1,20 @@
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

@@ -0,0 +1,15 @@
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,5 +10,12 @@
10 10
     <select id="getPaperAnalzyeByEpid" resultType="java.util.Map">
11 11
         select * from e_paper_analyze where epid=#{epid}
12 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 21
 </mapper>

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

@@ -137,16 +137,6 @@
137 137
         left join t_user u on q.studentid=u.userid where s.examid=#{examid} and s.sstate=2 group by q.epsqid
138 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 141
     <resultMap id="qtypesQuestion" type="java.util.Map">
152 142
         <result column="ctype" property="ctype"></result>
@@ -231,4 +221,9 @@
231 221
         where psq.epsid=#{epsid} order by pt.eptorder, psq.qorder
232 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 229
 </mapper>

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

@@ -98,7 +98,7 @@
98 98
         <result property="stuanswertxt" column="stuanswertxt" />
99 99
         <result property="qstem" column="qstem" />
100 100
         <result property="qoption" column="qoption" />
101
-        <result property="qanswer" column="qanswer" />
101
+        <result property="answer" column="answer" />
102 102
         <result property="qanalyze" column="qanalyze" />
103 103
         <result property="hashear" column="hashear" />
104 104
         <result property="hearfile" column="hearfile" />
@@ -125,13 +125,14 @@
125 125
     </resultMap>
126 126
     <select id="listStudentQuestionsTk" resultMap="listStudentQues">
127 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 129
         q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
130 130
         mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
131 131
         cq.classavgscore,cq.gradeavgscore
132 132
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
133 133
         left join t_question mq on q.questionpid=mq.questionid
134 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 136
         where sq.epid=#{epid} and sq.studentid=#{studentid} GROUP BY sq.epsqid order by sq.qorder,q.sorder
136 137
     </select>
137 138
     <select id="listQuesPoints" resultType="java.util.Map">
@@ -154,23 +155,50 @@
154 155
         where sq.epid=#{epid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
155 156
     </select>
156 157
 
157
-    <!--学生报告-错题集-科目错题-->
158
+    <!--学生报告-错题集-科目错题-->
158 159
     <resultMap id="listStudentSubjectErrorQues" type="java.util.Map">
159 160
         <result property="subjectid" column="subjectid" />
160 161
         <result property="subjectname" column="subjectname" />
162
+        <result property="ptype" column="ptype" />
161 163
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
164
+            <result property="eptqid" column="eptqid" />
162 165
             <result property="questionid" column="questionid" />
163 166
             <result property="qlevel" column="qlevel" />
164 167
             <result property="questionpid" column="questionpid" />
165 168
         </collection>
166 169
     </resultMap>
167 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 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 176
         where sq.examid=#{examid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore group by s.subjectid order by s.subjectorder
174 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 204
 </mapper>

Loading…
Cancel
Save