瀏覽代碼

学生开始考试web

tags/正式版本
王宁 2 年之前
父節點
當前提交
b32c041a07

+ 16
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java 查看文件

@@ -2,8 +2,10 @@ package com.xhkjedu.sexam.controller.paperstudent;
2 2
 
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.sexam.model.paper.EPaperQtype;
5 6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
6 7
 import com.xhkjedu.sexam.service.paperstudent.EPaperStudentService;
8
+import com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo;
7 9
 import com.xhkjedu.utils.N_Utils;
8 10
 import com.xhkjedu.utils.PageUtil;
9 11
 import com.xhkjedu.vo.PageResult;
@@ -47,5 +49,19 @@ public class EPaperStudentController {
47 49
         }
48 50
     }
49 51
 
52
+    //学生开始考试(android)
53
+    @PostMapping("/spa")
54
+    public ResultVo startPaperForAndroid(@RequestBody EPaperStudent eps){
55
+        N_Utils.validation(new Object[]{eps.getEpsid(),"学生试卷id",1});
56
+        List<Map> list = ePaperStudentService.startPaperForAndroid(eps);
57
+        return new ResultVo(0,"成功获取学生试卷",list);
58
+    }
59
+    //学生开始考试(web)
60
+    @PostMapping("/spw")
61
+    public ResultVo startPaperForWeb(@RequestBody EPaperStudent eps){
62
+        N_Utils.validation(new Object[]{eps.getEpsid(),"学生试卷id",1});
63
+        EPaperStudentVo psvo = ePaperStudentService.startPaperForWeb(eps);
64
+        return new ResultVo(0,"成功获取学生试卷",psvo);
65
+    }
50 66
 
51 67
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperQtypeMapper.java 查看文件

@@ -32,4 +32,7 @@ public interface EPaperQtypeMapper extends TkMapper<EPaperQtype> {
32 32
     //批量保存答题卡
33 33
     void updateBatchQuestionForScan(@Param("list")List<EPaperQtypeQuestion> list);
34 34
 
35
+    //试卷中所有试题基础信息
36
+    List<EPaperQtypeQuestion> listQuestionsByEpid(@Param("epid") Integer epid);
37
+
35 38
 }

+ 17
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java 查看文件

@@ -1,7 +1,9 @@
1 1
 package com.xhkjedu.sexam.mapper.paperstudent;
2 2
 
3 3
 import com.xhkjedu.sexam.base.TkMapper;
4
+import com.xhkjedu.sexam.model.paper.EPaperQtype;
4 5
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
6
+import com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo;
5 7
 import org.apache.ibatis.annotations.Param;
6 8
 import org.springframework.stereotype.Repository;
7 9
 
@@ -22,4 +24,19 @@ public interface EPaperStudentMapper extends TkMapper<EPaperStudent> {
22 24
 
23 25
     //学生已结束考试列表
24 26
     List<Map> listExamsEndForStudent(@Param("studentid")Integer studentid);
27
+
28
+    //考试试卷基本信息
29
+    EPaperStudentVo getExamSubjectByEpsid(@Param("epsid")Integer epsid);
30
+
31
+    //学生试卷题库(android)
32
+    List<Map> listStuPaperQuestionsForAndroid(@Param("epsid")Integer epsid);
33
+
34
+    //学生试卷附件(android)
35
+    List<Map> listStuPaperFjQuestionsForAndroid(@Param("epsid")Integer epsid);
36
+
37
+    //学生试卷题库(web)
38
+    List<EPaperQtype> listStuPaperQuestionsForWeb(@Param("epsid")Integer epsid);
39
+
40
+    //学生试卷附件(web)
41
+    List<EPaperQtype> listStuPaperFjQuestionsForWeb(@Param("epsid")Integer epsid);
25 42
 }

+ 15
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentQuestionMapper.java 查看文件

@@ -0,0 +1,15 @@
1
+package com.xhkjedu.sexam.mapper.paperstudent;
2
+
3
+import com.xhkjedu.sexam.base.TkMapper;
4
+import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
5
+import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
6
+import org.springframework.stereotype.Repository;
7
+
8
+/**
9
+ * @Description
10
+ * @Author WN
11
+ * Date 2022/7/27 15:07
12
+ **/
13
+@Repository
14
+public interface EPaperStudentQuestionMapper extends TkMapper<EPaperStudentQuestion> {
15
+}

+ 6
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EPaperStudentQuestion.java 查看文件

@@ -25,11 +25,16 @@ public class EPaperStudentQuestion extends BaseBean {
25 25
     //试卷学生id
26 26
     private Integer epsid;
27 27
 
28
+    private Integer eptqid;//试卷中试题id
29
+
28 30
     //试题id
29 31
     private String questionid;
30 32
 
33
+    //题号
34
+    private String qn;
35
+
31 36
     //试题排序
32
-    private String qorder;
37
+    private Integer qorder;
33 38
 
34 39
     //是否作答0未作答1已作做答
35 40
     private Integer answered;

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java 查看文件

@@ -84,7 +84,7 @@ public class EPaperQtypeService {
84 84
         }
85 85
 
86 86
         //更加试卷状态是否需要生成分析和更改科目状态
87
-        if(paper.getPstate()!=null && paper.getPstate() == 1){
87
+        if(espVo.getExammode() == 2 && paper.getPstate()!=null && paper.getPstate() == 1){
88 88
             //如果提交试卷,更改科目状态
89 89
             eSubjectMapper.updateExamSubjectState(1,espVo.getEsid());
90 90
         }

+ 99
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java 查看文件

@@ -1,10 +1,18 @@
1 1
 package com.xhkjedu.sexam.service.paperstudent;
2 2
 
3
+import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
3 4
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
5
+import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
6
+import com.xhkjedu.sexam.model.paper.EPaperQtype;
7
+import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
4 8
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
9
+import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
10
+import com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo;
5 11
 import org.springframework.stereotype.Service;
6 12
 
7 13
 import javax.annotation.Resource;
14
+import java.util.ArrayList;
15
+import java.util.HashMap;
8 16
 import java.util.List;
9 17
 import java.util.Map;
10 18
 
@@ -17,6 +25,10 @@ import java.util.Map;
17 25
 public class EPaperStudentService {
18 26
     @Resource
19 27
     private EPaperStudentMapper ePaperStudentMapper;
28
+    @Resource
29
+    private EPaperQtypeMapper ePaperQtypeMapper;
30
+    @Resource
31
+    private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
20 32
 
21 33
     /**
22 34
      * @Description  学生进行中考试列表
@@ -41,16 +53,99 @@ public class EPaperStudentService {
41 53
     }
42 54
 
43 55
     /**
44
-     * @Description 开始考试
56
+     * @Description 开始考试(andorid)
45 57
      * @Param [eps]
46 58
      * @Return java.util.Map
47 59
      * @Author wn
48 60
      * @Date 2022/7/27 11:48
49 61
      **/
50
-    public Map startPaper(EPaperStudent eps){
62
+    public List<Map> startPaperForAndroid(EPaperStudent eps){
63
+        Integer epsid = eps.getEpsid();
64
+        //获取试卷基本信息
65
+        EPaperStudentVo psvo = ePaperStudentMapper.getExamSubjectByEpsid(epsid);
66
+        Integer ptype = psvo.getPtype();
67
+
68
+        List<Map> questions = null;
69
+        if(ptype == 1){
70
+            //题库试卷试题
71
+            questions = ePaperStudentMapper.listStuPaperQuestionsForAndroid(epsid);
72
+        }else{
73
+            questions = ePaperStudentMapper.listStuPaperFjQuestionsForAndroid(epsid);
74
+        }
75
+        //判断是否生成学生试卷,未生成则需要生成,如果已生成直接返回
76
+        if(questions == null || questions.size() == 0){
77
+
78
+            //保存试卷关联信息
79
+            savePaperStudentQuestion(psvo);
80
+            //保存后重新获取返回
81
+            if(ptype == 1){
82
+                questions = ePaperStudentMapper.listStuPaperQuestionsForAndroid(epsid);
83
+            }else{
84
+                questions = ePaperStudentMapper.listStuPaperFjQuestionsForAndroid(epsid);
85
+            }
86
+        }
87
+        return questions;
88
+    }
89
+
90
+    //保存学生试卷关联信息
91
+    private void savePaperStudentQuestion(EPaperStudentVo psvo){
92
+        //生成学生试卷
93
+        List<EPaperQtypeQuestion> pqlist = ePaperQtypeMapper.listQuestionsByEpid(psvo.getEpid());
94
+
95
+        List<EPaperStudentQuestion> psqlist = new ArrayList<>();
96
+        for(EPaperQtypeQuestion q : pqlist){
97
+            EPaperStudentQuestion sq = new EPaperStudentQuestion();
98
+            sq.setClassid(psvo.getClassid());
99
+            sq.setStudentid(psvo.getStudentid());
100
+            sq.setEpid(psvo.getEpid());
101
+            sq.setEpsid(psvo.getEpsid());
102
+            sq.setEptqid(q.getEptqid());
103
+            sq.setQuestionid(q.getQuestionid());
104
+            sq.setQn(q.getQn());
105
+            sq.setQorder(q.getQorder());
106
+            sq.setQscore(q.getScore());
107
+            sq.setAnswered(0);
108
+            sq.setConverted(0);
109
+            sq.setChecked(0);
110
+            sq.setStuscore(0.0);
111
+            psqlist.add(sq);
112
+        }
113
+        ePaperStudentQuestionMapper.insertList(psqlist);//保存试卷
114
+    }
115
+
116
+    /**
117
+     * @Description 开始考试(web)
118
+     * @Param [eps]
119
+     * @Return java.util.List<java.util.Map>
120
+     * @Author wn
121
+     * @Date 2022/7/27 15:36
122
+     **/
123
+    public EPaperStudentVo startPaperForWeb(EPaperStudent eps){
124
+        Integer epsid = eps.getEpsid();
125
+        //获取试卷基本信息
126
+        EPaperStudentVo psvo = ePaperStudentMapper.getExamSubjectByEpsid(epsid);
127
+        Integer ptype = psvo.getPtype();
51 128
 
52
-        Map map = null;
53
-        return map;
129
+        List<EPaperQtype> questions = null;
130
+        if(ptype == 1){
131
+            //题库试卷试题
132
+            questions = ePaperStudentMapper.listStuPaperQuestionsForWeb(epsid);
133
+        }else{
134
+            questions = ePaperStudentMapper.listStuPaperFjQuestionsForWeb(epsid);
135
+        }
136
+        //判断是否生成学生试卷,未生成则需要生成,如果已生成直接返回
137
+        if(questions == null || questions.size() == 0){
138
+            //保存试卷关联信息
139
+            savePaperStudentQuestion(psvo);
140
+            //保存后重新获取返回
141
+            if(ptype == 1){
142
+                questions = ePaperStudentMapper.listStuPaperQuestionsForWeb(epsid);
143
+            }else{
144
+                questions = ePaperStudentMapper.listStuPaperFjQuestionsForWeb(epsid);
145
+            }
146
+        }
147
+        psvo.setQtypelist(questions);
148
+        return psvo;
54 149
     }
55 150
 
56 151
 }

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EExamSubjectPaperVo.java 查看文件

@@ -17,5 +17,7 @@ public class EExamSubjectPaperVo {
17 17
 
18 18
     private String subjectid;//科目id
19 19
 
20
+    private Integer exammode;//考试模式1线上2线下
21
+
20 22
     private Integer examstate;//考试状态0未开始1已开始2已结束
21 23
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQtypeQuestionVo.java 查看文件

@@ -67,6 +67,9 @@ public class EPaperQtypeQuestionVo {
67 67
     //子题数量
68 68
     private Integer snum;
69 69
 
70
+    //母题主键
71
+    private String mquestionid;
72
+
70 73
     //母题难易度
71 74
     private Integer  mcomplexity;
72 75
 

+ 48
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/EPaperStudentVo.java 查看文件

@@ -0,0 +1,48 @@
1
+package com.xhkjedu.sexam.vo.paperstudent;
2
+
3
+import com.xhkjedu.sexam.model.paper.EPaperQtype;
4
+import lombok.Data;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+/**
10
+ * @Description 考试详细信息
11
+ * @Author WN
12
+ * Date 2022/7/27 14:53
13
+ **/
14
+@Data
15
+public class EPaperStudentVo {
16
+    private Integer epsid;//考试试卷学生表
17
+
18
+    private Integer examid;//考试id
19
+
20
+    private String examname;//考试名称
21
+
22
+    private Integer esid;//考试科目id
23
+
24
+    private Integer classid;//班级id
25
+
26
+    private Integer studentid;//学生id
27
+
28
+    private String subjectid;//科目id
29
+
30
+    private String subjectname;//科目名称
31
+
32
+    private String sdate;//科目考试日期
33
+
34
+    private String begintime;//科目考试开始时间
35
+
36
+    private String endtime;//科目考试结束时间
37
+
38
+    private Integer epid;//试卷id
39
+
40
+    private Integer ptype;//试卷类型
41
+
42
+    private Integer pnum;//试卷中试题数量
43
+
44
+    private Double pscore;//试卷总分
45
+
46
+    //试题集合
47
+    private List<EPaperQtype> qtypelist;
48
+}

+ 7
- 6
sexam/src/main/resources/mapper/paper/EPaperMapper.xml 查看文件

@@ -4,8 +4,8 @@
4 4
 
5 5
     <!--获取考试下有科目试卷信息-->
6 6
     <select id="listExamPapers" resultType="java.util.Map">
7
-        select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate
8
-        ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename
7
+        select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
8
+               es.esstate,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename
9 9
         from e_subject es left join e_paper ep on es.esid=ep.esid
10 10
         left join t_user u on ep.handleid=u.userid
11 11
         left join t_user u2 on es.teacherid=u2.userid
@@ -14,13 +14,14 @@
14 14
 
15 15
     <!--教师出卷列表-->
16 16
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
17
-        select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate
18
-        ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,es.examid,e.examname,e.examtype,e.exammode
17
+        select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
18
+               es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
19
+               es.examid,e.examname,e.examtype,e.exammode
19 20
         from e_subject es left join e_paper ep on es.esid=ep.esid
20 21
         left join e_base e on es.examid=e.examid
21 22
         left join t_user u on ep.handleid=u.userid
22 23
         left join t_user u2 on es.teacherid=u2.userid
23
-        where es.teacherid=#{teacherid}
24
+        where e.deleted=1 and es.teacherid=#{teacherid}
24 25
         <if test="esstate == 1">
25 26
             and es.esstate=1
26 27
         </if>
@@ -94,7 +95,7 @@
94 95
 
95 96
     <!--考试科目获取试卷信息-->
96 97
     <select id="getPaperParamsByEsid" resultType="com.xhkjedu.sexam.vo.paper.EExamSubjectPaperVo">
97
-        select es.esid,es.subjectid,es.examid,e.examstate,ep.epid
98
+        select es.esid,es.subjectid,es.examid,e.examstate,e.exammode,ep.epid
98 99
         from e_subject es left join e_paper ep on es.esid=ep.esid
99 100
         left join e_base e on es.examid=e.examid where es.esid=#{esid}
100 101
     </select>

+ 4
- 1
sexam/src/main/resources/mapper/paper/EPaperQtypeMapper.xml 查看文件

@@ -158,6 +158,9 @@
158 158
         </where>
159 159
     </update>
160 160
 
161
+    <!--试卷中所有试题基础信息-->
162
+    <select id="listQuestionsByEpid" resultType="com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion">
163
+        select * from e_paper_qtype_question where epid=#{epid} order by qorder
164
+    </select>
161 165
 
162
-    
163 166
 </mapper>

+ 115
- 5
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml 查看文件

@@ -4,11 +4,11 @@
4 4
 
5 5
     <!--学生进行中考试列表-->
6 6
     <select id="listExamPapersForStudent" resultType="java.util.Map">
7
-        select es.esid,es.examid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
7
+        select eps.epsid, es.esid,es.examid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
8 8
         e.examname,e.gradeid,e.examtype,ep.epid
9 9
         from e_paper_student eps left join e_subject es on eps.esid=es.esid
10 10
          left join e_paper ep on eps.epid=ep.epid left join e_base e on eps.examid=e.examid
11
-        where eps.studentid=#{studentid} and e.examstate=1
11
+        where e.deleted=1 and eps.studentid=#{studentid} and e.examstate=1 GROUP BY eps.epsid
12 12
         order by abs(UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime))-UNIX_TIMESTAMP())
13 13
     </select>
14 14
 
@@ -32,11 +32,121 @@
32 32
     <!--学生已结束考试列表-->
33 33
     <select id="listExamsEndForStudent" resultMap="examsEndForStu">
34 34
         select e.examid,e.examname,e.examdate,e.gradeid,e.examtype,e.exammode,e.examcomm,
35
-               es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime
35
+        es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime
36 36
         from e_subject es left join e_base e on es.examid=e.examid
37
-                          left join e_class_student cs on es.examid=cs.examid
38
-        where cs.studentid=#{studentid} and e.examstate=2 group by es.esid
37
+        left join e_paper_student eps on es.examid=eps.examid
38
+        where e.deleted=1 and eps.studentid=#{studentid} and e.examstate=2 group by es.esid
39 39
         order by e.examdate desc,es.sdate desc,es.begintime desc
40 40
     </select>
41 41
 
42
+    <!--考试试卷基本信息-->
43
+    <select id="getExamSubjectByEpsid" resultType="com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo">
44
+        select ps.epsid,ps.examid,ps.esid,ps.classid,ps.studentid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
45
+               e.examname,ps.epid,p.ptype,p.pnum,p.pscore
46
+        from e_paper_student ps left join e_subject es on ps.esid=es.esid
47
+        left join e_base e on ps.examid=ps.examid
48
+        left join e_paper p on ps.epid=p.epid
49
+        where ps.epsid=#{epsid}
50
+    </select>
51
+    <!--学生试卷题库(android)-->
52
+    <select id="listStuPaperQuestionsForAndroid" resultType="java.util.Map">
53
+        select distinct psq.epsqid,psq.questionid,psq.qn,psq.qorder,psq.answered,psq.ansertype,psq.stuanswer,
54
+        psq.stuanswertxt,psq.eptqid,pq.score,q.qstem,q.qoption,q.ctype,q.hearfile,q.qtypeid,
55
+        q.qtypename,q.qlevel,q.snum,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,
56
+        mq.qoption mqoption,mq.ctype mctype,mq.qtypeid mqtypeid,mq.qtypename mqtypename
57
+        from e_paper_student_question psq left join e_paper_qtype_question pq on psq.eptqid=pq.eptqid
58
+        left join t_question q on psq.questionid=q.questionid
59
+        left join t_question mq on q.questionpid=mq.questionid
60
+        where psq.epsid=#{epsid} order by psq.qorder
61
+    </select>
62
+    <!--学生试卷附件(android)-->
63
+    <select id="listStuPaperFjQuestionsForAndroid" resultType="java.util.Map">
64
+        select distinct psq.epsqid,psq.questionid,psq.qn,psq.qorder,psq.answered,psq.ansertype,psq.stuanswer,
65
+        psq.stuanswertxt,psq.eptqid,pq.score,pq.optionnum,pq.ctype,pq.qtypeid,pq.qtypename
66
+        from e_paper_student_question psq left join e_paper_qtype_question pq on psq.eptqid=pq.eptqid
67
+        where psq.epsid=#{epsid} order by psq.qorder
68
+    </select>
69
+
70
+    <resultMap id="qtypesQuestion" type="com.xhkjedu.sexam.vo.paper.EPaperQtypeVo">
71
+        <result column="eptid" property="eptid"></result>
72
+        <result column="ctype" property="ctype"></result>
73
+        <result column="eptname" property="eptname"></result>
74
+        <result column="eptnum" property="eptnum"></result>
75
+        <result column="eptorder" property="eptorder"></result>
76
+        <result column="eptscore" property="eptscore"></result>
77
+        <collection property="questions" ofType="com.xhkjedu.sexam.vo.paper.EPaperQtypeQuestionVo" javaType="java.util.List">
78
+            <result column="epsqid" property="epsqid"></result>
79
+            <result column="questionid" property="questionid"></result>
80
+            <result column="qscore" property="qscore"></result>
81
+            <result column="qorder" property="qorder"></result>
82
+            <result column="answered" property="answered"></result>
83
+            <result column="ansertype" property="ansertype"></result>
84
+            <result column="stuanswer" property="stuanswer"></result>
85
+            <result column="stuanswertxt" property="stuanswertxt"></result>
86
+            <result column="eptqid" property="eptqid"></result>
87
+            <result column="qtypeid" property="qtypeid"></result>
88
+            <result column="qtypename" property="qtypename"></result>
89
+            <result column="qctype" property="qctype"></result>
90
+            <result column="qstem" property="qstem"></result>
91
+            <result column="qoption" property="qoption"></result>
92
+            <result column="qanswer" property="qanswer"></result>
93
+            <result column="qanalyze" property="qanalyze"></result>
94
+            <result column="qlevel" property="qlevel"></result>
95
+            <result column="sorder" property="sorder"></result>
96
+            <result column="snum" property="snum"></result>
97
+            <result column="questionpid" property="questionpid"></result>
98
+            <result column="mquestionid" property="mquestionid"></result>
99
+            <result column="mqstem" property="mqstem"></result>
100
+            <result column="mqtypeid" property="mqtypeid"></result>
101
+            <result column="mqtypename" property="mqtypename"></result>
102
+            <result column="mctype" property="mctype"></result>
103
+        </collection>
104
+    </resultMap>
105
+    <!--试题详情-->
106
+    <!--学生试卷题库(web)-->
107
+    <select id="listStuPaperQuestionsForWeb" resultMap="qtypesQuestion">
108
+        select pt.eptid,pt.ctype,pt.eptname,pt.eptnum,pt.eptorder,pt.eptscore,
109
+               psq.epsqid,psq.questionid,psq.qorder,psq.qscore,psq.answered,psq.ansertype,psq.stuanswer,
110
+               psq.stuanswertxt,psq.eptqid,q.qstem,q.qoption,q.ctype qctype,q.hearfile,q.qtypeid,
111
+               q.qtypename,q.qlevel,q.snum,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,
112
+               mq.qoption mqoption,mq.ctype mctype,mq.qtypeid mqtypeid,mq.qtypename mqtypename
113
+        from e_paper_student_question psq
114
+        left join e_paper_qtype pt on psq.epid=pt.epid
115
+        left join t_question q on psq.questionid=q.questionid
116
+        left join t_question mq on q.questionpid=mq.questionid
117
+        where psq.epsid=#{epsid} order by pt.eptorder,psq.qorder
118
+    </select>
119
+
120
+    <resultMap id="fjtypeQuestions" type="com.xhkjedu.sexam.vo.paper.EPaperQtypeVo">
121
+        <result column="eptid" property="eptid"></result>
122
+        <result column="ctype" property="ctype"></result>
123
+        <result column="eptname" property="eptname"></result>
124
+        <result column="eptnum" property="eptnum"></result>
125
+        <result column="eptorder" property="eptorder"></result>
126
+        <result column="eptscore" property="eptscore"></result>
127
+        <collection property="questions" ofType="java.util.Map" javaType="java.util.Map">
128
+            <result column="epsqid" property="epsqid"></result>
129
+            <result column="score" property="score"></result>
130
+            <result column="qorder" property="qorder"></result>
131
+            <result column="qn" property="qn"></result>
132
+            <result column="eptqid" property="eptqid"></result>
133
+            <result column="qtypeid" property="qtypeid"></result>
134
+            <result column="qtypename" property="qtypename"></result>
135
+            <result column="qctype" property="qctype"></result>
136
+            <result column="optionnum" property="optionnum"></result>
137
+            <result column="answered" property="answered"></result>
138
+            <result column="ansertype" property="ansertype"></result>
139
+            <result column="stuanswer" property="stuanswer"></result>
140
+            <result column="stuanswertxt" property="stuanswertxt"></result>
141
+        </collection>
142
+    </resultMap>
143
+    <!--学生试卷附件(web)-->
144
+    <select id="listStuPaperFjQuestionsForWeb" resultMap="fjtypeQuestions">
145
+        select pt.eptid,pt.ctype,pt.eptname,pt.eptnum,pt.eptorder,pt.eptscore,
146
+               psq.epsqid,psq.qn,psq.qorder,psq.answered,psq.ansertype,psq.stuanswer,
147
+               psq.stuanswertxt,psq.eptqid,psq.qscore score,pq.optionnum,pq.ctype qctype,pq.qtypeid,pq.qtypename
148
+        from e_paper_student_question psq left join e_paper_qtype_question pq on psq.eptqid=pq.eptqid
149
+        left join e_paper_qtype pt on psq.epid=pt.epid
150
+        where psq.epsid=#{epsid} order by pt.eptorder, psq.qorder
151
+    </select>
42 152
 </mapper>

Loading…
取消
儲存