Browse Source

教师阅卷

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

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

22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
23
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
23
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
24
         left join e_base eb on es.examid = eb.examid
24
         left join e_base eb on es.examid = eb.examid
25
-        where a.tjnum!=a.pynum group by a.epid
25
+        where a.tjnum!=a.pynum
26
     </select>
26
     </select>
27
     <!--已阅卷列表-->
27
     <!--已阅卷列表-->
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
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
31
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
31
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
32
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
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
32
         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
33
         left join e_paper_correctclass pc on p.epid = pc.epid
36
         left join e_paper_correctclass pc on p.epid = pc.epid
37
+        left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
34
         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
35
         union
39
         union
36
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
40
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
37
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
41
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
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
38
         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
45
+        left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
39
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
46
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
40
         left join e_base eb on es.examid = eb.examid
47
         left join e_base eb on es.examid = eb.examid
41
-        left join e_paper_student ps on a.epid=ps.epid
42
-        group by a.epid
43
-        having count(case when ps.checked!=2 then ps.epsid else null end)=0
48
+        where a.tjnum>0 and a.tjnum=a.pynum
44
     </select>
49
     </select>
45
     <!--随机获取一条待批阅试题-->
50
     <!--随机获取一条待批阅试题-->
46
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
78
     <!--批阅试题-->
83
     <!--批阅试题-->
79
     <update id="correctQuestion">
84
     <update id="correctQuestion">
80
         update e_paper_student_question
85
         update e_paper_student_question
81
-        set stuscore=#{psq.stuscore},psq.checked=1
86
+        set stuscore=#{psq.stuscore},checked=1
82
         ,checkid=#{psq.checkid},checktime=unix_timestamp()
87
         ,checkid=#{psq.checkid},checktime=unix_timestamp()
83
         ,good=#{psq.good},bad=#{psq.bad}
88
         ,good=#{psq.good},bad=#{psq.bad}
84
         <if test="psq.stuanswer!=null and psq.stuanswer!=''">
89
         <if test="psq.stuanswer!=null and psq.stuanswer!=''">
85
             and stuanswer=#{psq.stuanswer}
90
             and stuanswer=#{psq.stuanswer}
86
         </if>
91
         </if>
87
-        where psq.epsqid=#{psq.epsqid}
92
+        where epsqid=#{psq.epsqid}
88
     </update>
93
     </update>
89
     <!--学生未批改试题数量-->
94
     <!--学生未批改试题数量-->
90
     <select id="getNotCorrect" resultType="java.lang.Integer">
95
     <select id="getNotCorrect" resultType="java.lang.Integer">

Loading…
Cancel
Save