Browse Source

批阅

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

+ 33
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectTeacherController.java View File

@@ -159,4 +159,37 @@ public class EPaperCorrectTeacherController {
159 159
         Map map = correctTeacherService.markProgress(examid);
160 160
         return new ResultVo(0, "获取成功", map);
161 161
     }
162
+
163
+    /**
164
+     * 已批阅试题上一份
165
+     *
166
+     * @return com.xhkjedu.vo.ResultVo
167
+     * @Param [vo]
168
+     * @Author ywx
169
+     * @Date 2022/9/22 11:38
170
+     **/
171
+    @PostMapping("/get_yppre")
172
+    public ResultVo getCheckedPreQuestion(@RequestBody EPTeacherVo vo) {
173
+        Integer eptqid = vo.getEptqid();
174
+        Integer teacherid = vo.getTeacherid();
175
+        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1});
176
+        return correctTeacherService.getCheckedQuestion(eptqid, teacherid, vo.getChecktime(), 1);
177
+    }
178
+
179
+    /**
180
+     * 已批阅试题下一份
181
+     *
182
+     * @return com.xhkjedu.vo.ResultVo
183
+     * @Param [vo]
184
+     * @Author ywx
185
+     * @Date 2022/9/22 14:05
186
+     **/
187
+    @PostMapping("/get_ypnext")
188
+    public ResultVo getCheckedNextQuestion(@RequestBody EPTeacherVo vo) {
189
+        Integer eptqid = vo.getEptqid();
190
+        Integer teacherid = vo.getTeacherid();
191
+        Integer checktime = vo.getChecktime();
192
+        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1, checktime, "批改时间", 1});
193
+        return correctTeacherService.getCheckedQuestion(eptqid, teacherid, checktime, 2);
194
+    }
162 195
 }

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

@@ -51,4 +51,8 @@ public interface EPaperCorrectTeacherMapper {
51 51
 
52 52
     //获取试卷试题题号
53 53
     List<Map> listQnByEpId(@Param("epid") Integer epid);
54
+
55
+    //获取已批阅试题
56
+    Map getCheckedQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid
57
+            , @Param("checktime") Integer checktime, @Param("type") Integer type);
54 58
 }

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

@@ -59,14 +59,18 @@ public class EPaperCorrectTeacherService {
59 59
         try {
60 60
             //随机获取一条待批阅试题
61 61
             EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(teacherid, eptqid, classids);
62
-            if (sq == null) return new ResultVo(0, "已批阅完成");
63
-            //修改试卷学生试题为批阅中
64
-            correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);
62
+            if (sq == null) {
63
+                Map question = correctTeacherMapper.getCheckedQuestion(eptqid, teacherid, null, 1);
64
+                map.put("sq", question);//学生已批试题
65
+            } else {
66
+                map.put("sq", sq);//学生待批试题
67
+                //修改试卷学生试题为批阅中
68
+                correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);
69
+            }
65 70
             //试题批阅情况
66
-            EPaperSQuestionVo q = correctTeacherMapper.getCheckQuestion(sq.getEptqid(), teacherid);
71
+            EPaperSQuestionVo q = correctTeacherMapper.getCheckQuestion(eptqid, teacherid);
67 72
             Integer tjnum = q.getTjnum();
68 73
             Integer pynum = q.getPynum();
69
-            map.put("sq", sq);//学生待批试题
70 74
             map.put("tjnum", tjnum);//提交人数
71 75
             map.put("pynum", pynum);//批阅人数
72 76
             map.put("wpynum", q.getWpynum());//我批阅人数
@@ -207,4 +211,10 @@ public class EPaperCorrectTeacherService {
207 211
         map.put("papers", papers);
208 212
         return map;
209 213
     }
214
+
215
+    //获取已批阅试题
216
+    public ResultVo getCheckedQuestion(Integer eptqid, Integer teacherid, Integer checktime, Integer type) {
217
+        Map question = correctTeacherMapper.getCheckedQuestion(eptqid, teacherid, checktime, type);
218
+        return new ResultVo(0, "获取成功", question);
219
+    }
210 220
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java View File

@@ -139,7 +139,7 @@ public class EScanbatchService {
139 139
         Map map = eScanbatchMapper.getScanDetail(epid);
140 140
         List<Map> classes = eClassMapper.listByExamId(examid);
141 141
         int jhnum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
142
-        Integer ysnum = (Integer) map.get("ysnum");//已扫人数
142
+        Integer ysnum = N_Utils.str2Int(map.get("ysnum").toString());//已扫人数
143 143
         Integer wsnum = ExamUtil.subtractInt(jhnum, ysnum);
144 144
         map.put("jhnum", jhnum);//计划人数
145 145
         map.put("wsnum", wsnum);//未扫人数

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

@@ -24,4 +24,7 @@ public class EPTeacherVo {
24 24
 
25 25
     //班级ids
26 26
     private String classids;
27
+
28
+    //批改时间
29
+    private Integer checktime;
27 30
 }

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

@@ -122,4 +122,22 @@
122 122
         select q.qn,q.eptqid
123 123
         from e_paper_qtype_question q where q.epid=#{epid}
124 124
     </select>
125
+    <!--获取已批阅试题-->
126
+    <select id="getCheckedQuestion" resultType="java.util.Map">
127
+        select psq.epsqid,psq.qn,psq.eptqid,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
128
+        ,psq.answertype,psq.stuanswer,psq.stuanswertxt,checked,psq.checktime
129
+        from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.checked=2 and psq.checkid=#{teacherid}
130
+        <if test="type==1 and checktime!=null">
131
+            and psq.checktime &lt; #{checktime}
132
+        </if>
133
+        <if test="type==2 and checktime!=null">
134
+            and psq.checktime > #{checktime}
135
+        </if>
136
+        <if test="type==1">
137
+            order by psq.checktime asc limit 1
138
+        </if>
139
+        <if test="type==2">
140
+            order by psq.checktime desc limit 1
141
+        </if>
142
+    </select>
125 143
 </mapper>

Loading…
Cancel
Save