Kaynağa Gözat

教师阅卷

tags/正式版本
雍文秀 2 yıl önce
ebeveyn
işleme
f590de05a3

+ 11
- 6
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml Dosyayı Görüntüle

@@ -22,25 +22,30 @@
22 22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
23 23
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
24 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 26
     </select>
27 27
     <!--已阅卷列表-->
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
+        ,100 pgrate
30 31
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
31 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 35
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
33 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 38
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
35 39
         union
36 40
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
37 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 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 46
         where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
40 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 49
     </select>
45 50
     <!--随机获取一条待批阅试题-->
46 51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
@@ -78,13 +83,13 @@
78 83
     <!--批阅试题-->
79 84
     <update id="correctQuestion">
80 85
         update e_paper_student_question
81
-        set stuscore=#{psq.stuscore},psq.checked=1
86
+        set stuscore=#{psq.stuscore},checked=1
82 87
         ,checkid=#{psq.checkid},checktime=unix_timestamp()
83 88
         ,good=#{psq.good},bad=#{psq.bad}
84 89
         <if test="psq.stuanswer!=null and psq.stuanswer!=''">
85 90
             and stuanswer=#{psq.stuanswer}
86 91
         </if>
87
-        where psq.epsqid=#{psq.epsqid}
92
+        where epsqid=#{psq.epsqid}
88 93
     </update>
89 94
     <!--学生未批改试题数量-->
90 95
     <select id="getNotCorrect" resultType="java.lang.Integer">

Loading…
İptal
Kaydet