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,11 +80,10 @@ public class EPaperCorrectTeacherController {
80 80
      **/
81 81
     @PostMapping("/get_cq")
82 82
     public ResultVo getCorrectQuestion(@RequestBody EPTeacherVo vo) {
83
-        Integer epid = vo.getEpid();
84 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,15 +112,14 @@ public class EPaperCorrectTeacherController {
113 112
      **/
114 113
     @PostMapping("/list_jl")
115 114
     public ResultVo listRecord(@RequestBody EPaperCorrectquestion vo) {
116
-        Integer epid = vo.getEpid();
117 115
         Integer teacherid = vo.getTeacherid();
118
-        Integer qorder = vo.getQorder();
116
+        Integer eptqid = vo.getEptqid();
119 117
         Integer page = vo.getPage();
120 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 120
                 , page, "页码", 1, pageSize, "显示条数", 1});
123 121
         PageHelper.startPage(page, pageSize);
124
-        List<Map> list = correctTeacherService.listRecord(epid, teacherid, qorder);
122
+        List<Map> list = correctTeacherService.listRecord(eptqid, teacherid);
125 123
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
126 124
         return new ResultVo(0, "获取成功", pageResult);
127 125
     }

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

@@ -15,12 +15,11 @@ public interface EPaperCorrectTeacherMapper {
15 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 25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
@@ -29,7 +28,7 @@ public interface EPaperCorrectTeacherMapper {
29 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 34
     void correctQuestion(@Param("psq") EPaperStudentQuestion psq);

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

@@ -38,17 +38,17 @@ public class EPaperCorrectTeacherService {
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 42
         lock.lock();
43 43
         Map map = new HashMap();
44 44
         try {
45 45
             //随机获取一条待批阅试题
46
-            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(epid, teacherid, qorders, classids);
46
+            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(teacherid, eptqids, classids);
47 47
             if (sq == null) return new ResultVo(1, "已批阅完成");
48 48
             //修改试卷学生试题为批阅中
49 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 52
             Integer tjnum = q.getTjnum();
53 53
             Integer pynum = q.getPynum();
54 54
             map.put("sq", sq);//学生待批试题
@@ -73,8 +73,8 @@ public class EPaperCorrectTeacherService {
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,8 +16,8 @@ public class EPTeacherVo {
16 16
     //教师id
17 17
     private Integer teacherid;
18 18
 
19
-    //试题排序
20
-    private String qorders;
19
+    //试卷试题ids
20
+    private String eptqids;
21 21
 
22 22
     //班级ids
23 23
     private String classids;

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

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

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

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

Loading…
Cancel
Save