Browse Source

获取学生试卷及试题作答

ywx
雍文秀 8 months ago
parent
commit
f9f599e2f5

+ 1
- 1
src/main/java/com/xhkjedu/controller/EPaperVerifyController.java View File

@@ -39,7 +39,7 @@ public class EPaperVerifyController {
39 39
     //获取学生试卷及试题作答
40 40
     @PostMapping("/get_stuPaper")
41 41
     public ResultVo getStudentPaper(@RequestBody EPaperStudent0608 ps) {
42
-        N_Utils.validation(new Object[]{ps.getExamid(), "考试id", 1, ps.getSubjectid(), "科目", 2,ps.getStudentid(),"学生id",1});
42
+        N_Utils.validation(new Object[]{ps.getExamid(), "考试id", 1, ps.getSubjectid(), "科目", 2});
43 43
         Map map = ePaperVerifyService.getStudentPaper(ps);
44 44
         return new ResultVo(0, "获取成功!", map);
45 45
     }

+ 9
- 2
src/main/resources/EPaperVerifyMapper.xml View File

@@ -37,11 +37,18 @@
37 37
     </resultMap>
38 38
     <select id="getStudentPaper" resultMap="stuPaper">
39 39
         SELECT ps.epsid,ps.epid,ps.stupic,ps.studentid,u.username,u.examno,ps.classid,c.classname,pt.qtypename,psq.epsqid,psq.eptqid,psq.qn,psq.ctype,psq.stuanswer
40
-        FROM e_paper_student0608 ps LEFT JOIN e_paper_student_question0608 psq ON ps.epsid=psq.epsid
40
+        from (select ps.epsid FROM e_paper_student0608 ps
41
+        WHERE ps.examid=#{ps.examid} AND ps.subjectid=#{ps.subjectid} and ps.verified=#{ps.verified}
42
+        <if test="ps.epsid!=null and ps.epsid!=0">ps.epsid>#{ps.epsid}</if>
43
+        <if test="ps.classid!=null and ps.classid!=0">ps.classid=#{ps.classid}</if>
44
+        <if test="ps.studentid!=null and ps.studentid!=0">ps.studentid=#{ps.studentid}</if>
45
+        order by ps.epsid
46
+        limit 1)ps
47
+        left join e_paper_student0608 ps on ps.epsid=ps1.epsid
48
+        LEFT JOIN e_paper_student_question0608 psq ON ps.epsid=psq.epsid
41 49
         left JOIN e_paper_qtype_question pt ON psq.eptqid=pt.eptid
42 50
         left join t_user u on ps.studentid=u.userid
43 51
         left join t_class c on ps.classid=c.classid
44
-        WHERE ps.examid=#{ps.examid} AND ps.subjectid=#{ps.subjectid} AND ps.studentid=#{ps.studentid} and ps.verified=#{ps.verified}
45 52
     </select>
46 53
     <!--识别正确跳过-->
47 54
     <update id="correctSkip">

Loading…
Cancel
Save