Browse Source

教师阅卷

tags/正式版本
雍文秀 2 years ago
parent
commit
ece74b9825

+ 6
- 8
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectTeacherController.java View File

80
      **/
80
      **/
81
     @PostMapping("/get_cq")
81
     @PostMapping("/get_cq")
82
     public ResultVo getCorrectQuestion(@RequestBody EPTeacherVo vo) {
82
     public ResultVo getCorrectQuestion(@RequestBody EPTeacherVo vo) {
83
-        Integer epid = vo.getEpid();
84
         Integer teacherid = vo.getTeacherid();
83
         Integer teacherid = vo.getTeacherid();
85
-        String qorders = vo.getQorders();
86
-        N_Utils.validation(new Object[]{epid, "试卷id", 1, teacherid, "教师id", 1, qorders, "页码", 2});
87
-        return correctTeacherService.getCorrectQuestion(epid, teacherid, qorders, vo.getClassids());
84
+        String eptqids = vo.getEptqids();
85
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, eptqids, "试卷试题ids", 2});
86
+        return correctTeacherService.getCorrectQuestion(teacherid, eptqids, vo.getClassids());
88
     }
87
     }
89
 
88
 
90
     /**
89
     /**
113
      **/
112
      **/
114
     @PostMapping("/list_jl")
113
     @PostMapping("/list_jl")
115
     public ResultVo listRecord(@RequestBody EPaperCorrectquestion vo) {
114
     public ResultVo listRecord(@RequestBody EPaperCorrectquestion vo) {
116
-        Integer epid = vo.getEpid();
117
         Integer teacherid = vo.getTeacherid();
115
         Integer teacherid = vo.getTeacherid();
118
-        Integer qorder = vo.getQorder();
116
+        Integer eptqid = vo.getEptqid();
119
         Integer page = vo.getPage();
117
         Integer page = vo.getPage();
120
         Integer pageSize = vo.getPageSize();
118
         Integer pageSize = vo.getPageSize();
121
-        N_Utils.validation(new Object[]{epid, "试卷id", 1, teacherid, "教师id", 1, qorder, "试题排序", 1
119
+        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1
122
                 , page, "页码", 1, pageSize, "显示条数", 1});
120
                 , page, "页码", 1, pageSize, "显示条数", 1});
123
         PageHelper.startPage(page, pageSize);
121
         PageHelper.startPage(page, pageSize);
124
-        List<Map> list = correctTeacherService.listRecord(epid, teacherid, qorder);
122
+        List<Map> list = correctTeacherService.listRecord(eptqid, teacherid);
125
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
123
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
126
         return new ResultVo(0, "获取成功", pageResult);
124
         return new ResultVo(0, "获取成功", pageResult);
127
     }
125
     }

+ 4
- 5
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperCorrectTeacherMapper.java View File

15
     List<Map> listMarked(@Param("teacherid") Integer teacherid);
15
     List<Map> listMarked(@Param("teacherid") Integer teacherid);
16
 
16
 
17
     //随机获取一条待批阅试题
17
     //随机获取一条待批阅试题
18
-    EPaperSQuestionVo getCorrectQuestion(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid,
19
-                                         @Param("qorders") String qorders, @Param("classids") String classids);
18
+    EPaperSQuestionVo getCorrectQuestion(@Param("teacherid") Integer teacherid,
19
+                                         @Param("eptqids") String eptqids, @Param("classids") String classids);
20
 
20
 
21
     //试题批阅情况
21
     //试题批阅情况
22
-    EPaperSQuestionVo getCheckQuestion(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid,
23
-                                       @Param("qorder") Integer qorder);
22
+    EPaperSQuestionVo getCheckQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
24
 
23
 
25
     //修改试卷学生试题为批阅中
24
     //修改试卷学生试题为批阅中
26
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
29
     Map getPreQuestion(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid);
28
     Map getPreQuestion(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid);
30
 
29
 
31
     //阅卷记录
30
     //阅卷记录
32
-    List<Map> listRecord(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid, @Param("qorder") Integer qorder);
31
+    List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
33
 
32
 
34
     //批阅试题
33
     //批阅试题
35
     void correctQuestion(@Param("psq") EPaperStudentQuestion psq);
34
     void correctQuestion(@Param("psq") EPaperStudentQuestion psq);

+ 5
- 5
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectTeacherService.java View File

38
     }
38
     }
39
 
39
 
40
     //随机获取待批试题
40
     //随机获取待批试题
41
-    public ResultVo getCorrectQuestion(Integer epid, Integer teacherid, String qorders, String classids) {
41
+    public ResultVo getCorrectQuestion(Integer teacherid, String eptqids, String classids) {
42
         lock.lock();
42
         lock.lock();
43
         Map map = new HashMap();
43
         Map map = new HashMap();
44
         try {
44
         try {
45
             //随机获取一条待批阅试题
45
             //随机获取一条待批阅试题
46
-            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(epid, teacherid, qorders, classids);
46
+            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(teacherid, eptqids, classids);
47
             if (sq == null) return new ResultVo(1, "已批阅完成");
47
             if (sq == null) return new ResultVo(1, "已批阅完成");
48
             //修改试卷学生试题为批阅中
48
             //修改试卷学生试题为批阅中
49
             correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);
49
             correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);
50
             //试题批阅情况
50
             //试题批阅情况
51
-            EPaperSQuestionVo q = correctTeacherMapper.getCheckQuestion(epid, teacherid, sq.getQorder());
51
+            EPaperSQuestionVo q = correctTeacherMapper.getCheckQuestion(sq.getEptqid(), teacherid);
52
             Integer tjnum = q.getTjnum();
52
             Integer tjnum = q.getTjnum();
53
             Integer pynum = q.getPynum();
53
             Integer pynum = q.getPynum();
54
             map.put("sq", sq);//学生待批试题
54
             map.put("sq", sq);//学生待批试题
73
     }
73
     }
74
 
74
 
75
     //阅卷记录
75
     //阅卷记录
76
-    public List<Map> listRecord(Integer epid, Integer teacherid, Integer qorder) {
77
-        return correctTeacherMapper.listRecord(epid, teacherid, qorder);
76
+    public List<Map> listRecord(Integer eptqid, Integer teacherid) {
77
+        return correctTeacherMapper.listRecord(eptqid, teacherid);
78
     }
78
     }
79
 
79
 
80
     //批阅试题
80
     //批阅试题

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPTeacherVo.java View File

16
     //教师id
16
     //教师id
17
     private Integer teacherid;
17
     private Integer teacherid;
18
 
18
 
19
-    //试题排序
20
-    private String qorders;
19
+    //试卷试题ids
20
+    private String eptqids;
21
 
21
 
22
     //班级ids
22
     //班级ids
23
     private String classids;
23
     private String classids;

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperSQuestionVo.java View File

14
     private Integer epsqid;//试卷学生试题id
14
     private Integer epsqid;//试卷学生试题id
15
     private String stuanswer;//学生答案
15
     private String stuanswer;//学生答案
16
     private String qn;//试题题号
16
     private String qn;//试题题号
17
-    private Integer qorder;//试题排序
17
+    private Integer eptqid;//试题排序
18
     private double qscore;//分值
18
     private double qscore;//分值
19
     private Integer tjnum;//提交人数
19
     private Integer tjnum;//提交人数
20
     private Integer pynum;//批阅人数
20
     private Integer pynum;//批阅人数

+ 13
- 13
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml View File

5
     <select id="listPending" resultType="java.util.Map">
5
     <select id="listPending" resultType="java.util.Map">
6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
8
-        from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
9
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
8
+        from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.eptqid)qns
9
+        ,group_concat(distinct pq.eptqid order by pq.eptqid)eptqids,group_concat(distinct pc.classid)classids
10
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
10
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
11
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
11
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
14
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
14
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
15
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
15
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
16
         union
16
         union
17
-        select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
18
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
17
+        select p.esid,p.epid,group_concat(distinct pq.qn order by pq.eptqid)qns
18
+        ,group_concat(distinct pq.eptqid order by pq.eptqid)eptqids,0 classids
19
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
19
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
20
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
20
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
28
     <select id="listMarked" resultType="java.util.Map">
28
     <select id="listMarked" resultType="java.util.Map">
29
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
29
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
30
         ,100 pgrate
30
         ,100 pgrate
31
-        from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
32
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
31
+        from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.eptqid)qns
32
+        ,group_concat(distinct pq.eptqid order by pq.eptqid)eptqids,group_concat(distinct pc.classid)classids
33
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
33
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
34
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
34
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
35
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
35
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
37
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
37
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
38
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
38
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
39
         union
39
         union
40
-        select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
41
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
40
+        select p.esid,p.epid,group_concat(distinct pq.qn order by pq.eptqid)qns
41
+        ,group_concat(distinct pq.eptqid order by pq.eptqid)eptqids,0 classids
42
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
42
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
43
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
43
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
44
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
44
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
49
     </select>
49
     </select>
50
     <!--随机获取一条待批阅试题-->
50
     <!--随机获取一条待批阅试题-->
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
52
-        select psq.epsqid,psq.stuanswer,psq.qn,psq.qorder,psq.qscore,psq.epsid
53
-        from e_paper_student_question psq where psq.epid=#{epid} and psq.qorder in(${qorders})
52
+        select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.epsid
53
+        from e_paper_student_question psq where psq.eptqid in(${eptqids})
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
55
         <if test="classids!=null and classids!=''">
55
         <if test="classids!=null and classids!=''">
56
             and psq.classid in(${classids})
56
             and psq.classid in(${classids})
61
     <select id="getCheckQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
61
     <select id="getCheckQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
62
         select count(psq.epsqid)tjnum,count(case when psq.checked=2 then psq.epsqid else null end)pynum
62
         select count(psq.epsqid)tjnum,count(case when psq.checked=2 then psq.epsqid else null end)pynum
63
         ,count(case when psq.checked=2 and psq.checkid=#{teacherid} then psq.epsqid else null end)wpynum
63
         ,count(case when psq.checked=2 and psq.checkid=#{teacherid} then psq.epsqid else null end)wpynum
64
-        from e_paper_student_question psq where psq.epid=#{epid} and psq.qorder=#{qorder} and psq.answered=1
64
+        from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.answered=1
65
     </select>
65
     </select>
66
     <!--修改试卷学生试题为批阅中-->
66
     <!--修改试卷学生试题为批阅中-->
67
     <update id="updateCheckQuestionById">
67
     <update id="updateCheckQuestionById">
75
     </select>
75
     </select>
76
     <!--阅卷记录-->
76
     <!--阅卷记录-->
77
     <select id="listRecord" resultType="java.util.Map">
77
     <select id="listRecord" resultType="java.util.Map">
78
-        select psq.epsqid,psq.stuanswer,psq.qorder,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.checktime
79
-        from e_paper_student_question psq where psq.epid=#{epid} and psq.qorder=#{qorder}
78
+        select psq.epsqid,psq.stuanswer,psq.eptqid,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.checktime
79
+        from e_paper_student_question psq where psq.eptqid=#{eptqid}
80
         and psq.checked=2 and psq.checkid=#{teacherid}
80
         and psq.checked=2 and psq.checkid=#{teacherid}
81
         order by psq.checktime desc
81
         order by psq.checktime desc
82
     </select>
82
     </select>

Loading…
Cancel
Save