|
@@ -4,13 +4,14 @@
|
4
|
4
|
<!--获取学生作业详情-->
|
5
|
5
|
<select id="getPaperQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
|
6
|
6
|
SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
|
7
|
|
- ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,u.username studentname,psq.psid
|
8
|
|
- ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypename,q.hashear,q.hearfile
|
|
7
|
+ ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore
|
|
8
|
+ ,psq.stuscore,psq.qorder,u.username studentname,psq.psid,psq.qn
|
|
9
|
+ ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypename,q.hashear,q.hearfile,q.qlevel,q.sorder
|
9
|
10
|
,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
|
10
|
11
|
,(CASE WHEN q.ctype IN(16,17) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
|
11
|
12
|
,(CASE WHEN q.questionpid IS NULL THEN ''
|
12
|
13
|
ELSE (SELECT json_object('qstem',fq.qstem,'qoption',fq.qoption,'qanswer',fq.qanswer,'qanalyze',fq.qanalyze
|
13
|
|
- ,'qtypename',fq.qtypename,'hashear',fq.hashear,'hearfile',fq.hearfile)
|
|
14
|
+ ,'qtypename',fq.qtypename,'hashear',fq.hashear,'hearfile',fq.hearfile,'qlevel',fq.qlevel)
|
14
|
15
|
FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
|
15
|
16
|
FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
|
16
|
17
|
LEFT JOIN t_user u ON psq.studentid=u.userid
|
|
@@ -19,26 +20,28 @@
|
19
|
20
|
<!--获取学生待批改试题列表-->
|
20
|
21
|
<select id="listCorrectQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
|
21
|
22
|
SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
|
22
|
|
- ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,u.username studentname,psq.psid
|
|
23
|
+ ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore
|
|
24
|
+ ,psq.stuscore,psq.qorder,u.username studentname,psq.psid,psq.qn
|
23
|
25
|
,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypeid,q.qtypename
|
24
|
26
|
,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
|
25
|
27
|
,(CASE WHEN q.ctype IN(7,8) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
|
26
|
28
|
FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
|
27
|
29
|
LEFT JOIN t_user u ON psq.studentid=u.userid
|
28
|
|
- WHERE psq.psid=#{psid} and q.ctype=3
|
|
30
|
+ WHERE psq.psid=#{psid} and q.ctype in(3,13,14,15)
|
29
|
31
|
ORDER BY psq.qorder
|
30
|
32
|
</select>
|
31
|
33
|
<!--作业关联试题列表-->
|
32
|
34
|
<select id="listPaperQuestion" resultType="com.xhkjedu.sstudy.model.paperstudent.TPaperStudentQuestion">
|
33
|
|
- SELECT ps.paperid,ps.classid,ps.studentid,ptq.questionid,ptq.ptqscore AS qscore,ptq.ptqorder qorder,ps.schoolid,ps.psid
|
|
35
|
+ SELECT ps.paperid,ps.classid,ps.studentid,ptq.questionid,ptq.ptqscore AS qscore,ptq.ptqorder qorder
|
|
36
|
+ ,ps.schoolid,ps.psid,ptq.qn
|
34
|
37
|
FROM t_paper_student ps LEFT JOIN t_paper_qtype_question ptq ON ps.paperid=ptq.paperid WHERE ps.psid=#{psid}
|
35
|
38
|
</select>
|
36
|
39
|
<!--批量保存-->
|
37
|
40
|
<insert id="batchSave" parameterType="java.util.List">
|
38
|
|
- INSERT INTO t_paper_student_question (paperid,classid,studentid,questionid,qscore,qorder,schoolid,psid)
|
|
41
|
+ INSERT INTO t_paper_student_question (paperid,classid,studentid,questionid,qscore,qorder,qn,schoolid,psid)
|
39
|
42
|
VALUES
|
40
|
43
|
<foreach collection ="list" item="r" index= "index" separator =",">
|
41
|
|
- (#{r.paperid},#{r.classid},#{r.studentid},#{r.questionid},#{r.qscore},#{r.qorder},#{r.schoolid},#{r.psid})
|
|
44
|
+ (#{r.paperid},#{r.classid},#{r.studentid},#{r.questionid},#{r.qscore},#{r.qorder},#{r.qn},#{r.schoolid},#{r.psid})
|
42
|
45
|
</foreach>
|
43
|
46
|
</insert>
|
44
|
47
|
<!--获取学生未提交试题集合-->
|
|
@@ -72,6 +75,7 @@
|
72
|
75
|
<resultMap id="questionResult" type="java.util.Map">
|
73
|
76
|
<result property="qscore" column="qscore"></result>
|
74
|
77
|
<result property="qorder" column="qorder"></result>
|
|
78
|
+ <result property="qn" column="qn"></result>
|
75
|
79
|
<result property="qstem" column="qstem"></result>
|
76
|
80
|
<result property="qoption" column="qoption"></result>
|
77
|
81
|
<result property="qanswer" column="qanswer"></result>
|
|
@@ -94,13 +98,13 @@
|
94
|
98
|
</collection>
|
95
|
99
|
</resultMap>
|
96
|
100
|
<select id="qcorrectList" resultMap="questionResult">
|
97
|
|
- select psq.qscore,psq.qorder,q.qstem,q.qoption,q.qanswer,q.qanalyze
|
|
101
|
+ select psq.qscore,psq.qorder,psq.qn,q.qstem,q.qoption,q.qanswer,q.qanalyze
|
98
|
102
|
,psq.stuscore,psq.answered,psq.checked,psq.checkcomm,psq.psid,psq.psqid
|
99
|
103
|
,psq.device,psq.useranswer,psq.converted,psq.answertype,psq.useranswertext,psq.useranswertxt,u.username,ps.psstate
|
100
|
104
|
from t_paper_student_question psq left join t_question q on psq.questionid = q.questionid
|
101
|
105
|
left join t_user u on psq.studentid = u.userid
|
102
|
106
|
left join t_paper_student ps on psq.psid=ps.psid
|
103
|
|
- where psq.paperid=#{paperid} and psq.classid=#{classid} and q.ctype=3
|
|
107
|
+ where psq.paperid=#{paperid} and psq.classid=#{classid} and q.ctype in(3,13,14,15)
|
104
|
108
|
order by psq.checked,psq.psqid
|
105
|
109
|
</select>
|
106
|
110
|
<!--获取学生作业未批改试题数量-->
|