Browse Source

学生作业报告优化

tags/正式3.10.0
雍文秀 1 year ago
parent
commit
530511305b

+ 62
- 62
sstudy/src/main/resources/mapper/paperreport/PaperStudentReportMapper.xml View File

@@ -25,55 +25,55 @@
25 25
     </select>
26 26
     <!--作业分析-->
27 27
     <select id="getPaperAnalyze" resultType="java.util.Map">
28
-        select p.paperid,p.papertype,p.papername,pa.pointjson,ifnull(ps.showanswer,0)showanswer,ps.psid
28
+        select p.paperid,p.papertype,p.papername,pa.pointjson,ifnull(ps.showanswer,0) as showanswer,ps.psid
29 29
         ,(select pc.showtype from t_paper_class pc where pc.paperid=ps.paperid and pc.classid=ps.classid)showtype
30 30
         from t_paper p left join t_paper_analyze pa on p.paperid = pa.paperid
31 31
         left join t_paper_student ps on p.paperid = ps.paperid
32 32
         where p.paperid=#{paperid} and ps.classid=#{classid} and ps.studentid=#{studentid}
33 33
     </select>
34 34
     <resultMap id="typeResult" type="java.util.Map">
35
-        <result property="ptid" column="ptid"></result>
36
-        <result property="ptorder" column="ptorder"></result>
37
-        <result property="qtypename" column="qtypename"></result>
35
+        <result property="ptid" column="ptid"/>
36
+        <result property="ptorder" column="ptorder"/>
37
+        <result property="qtypename" column="qtypename"/>
38 38
         <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
39
-            <result property="ptqid" column="ptqid"></result>
40
-            <result property="qn" column="qn"></result>
41
-            <result property="qorder" column="qorder"></result>
42
-            <result property="qscore" column="qscore"></result>
43
-            <result property="answerjson" column="answerjson"></result>
44
-            <result property="ctype" column="ctype"></result>
45
-            <result property="questionid" column="questionid"></result>
46
-            <result property="classavgscore" column="classavgscore"></result>
47
-            <result property="classscorerate" column="classscorerate"></result>
48
-            <result property="stuscore" column="stuscore"></result>
49
-            <result property="scorerate" column="scorerate"></result>
50
-            <result property="answertype" column="answertype"></result>
51
-            <result property="useranswer" column="useranswer"></result>
52
-            <result property="converted" column="converted"></result>
53
-            <result property="useranswertxt" column="useranswertxt"></result>
54
-            <result property="good" column="good"></result>
55
-            <result property="qstem" column="qstem"></result>
56
-            <result property="qoption" column="qoption"></result>
57
-            <result property="qanswer" column="qanswer"></result>
58
-            <result property="qanalyze" column="qanalyze"></result>
59
-            <result property="hashear" column="hashear"></result>
60
-            <result property="hearfile" column="hearfile"></result>
61
-            <result property="qlevel" column="qlevel"></result>
62
-            <result property="optionnum" column="optionnum"></result>
63
-            <result property="ptqid" column="ptqid"></result>
64
-            <result property="checkcomm" column="checkcomm"></result>
65
-            <result property="answered" column="answered"></result>
39
+            <result property="ptqid" column="ptqid"/>
40
+            <result property="qn" column="qn"/>
41
+            <result property="qorder" column="qorder"/>
42
+            <result property="qscore" column="qscore"/>
43
+            <result property="answerjson" column="answerjson"/>
44
+            <result property="ctype" column="ctype"/>
45
+            <result property="questionid" column="questionid"/>
46
+            <result property="classavgscore" column="classavgscore"/>
47
+            <result property="classscorerate" column="classscorerate"/>
48
+            <result property="stuscore" column="stuscore"/>
49
+            <result property="scorerate" column="scorerate"/>
50
+            <result property="answertype" column="answertype"/>
51
+            <result property="useranswer" column="useranswer"/>
52
+            <result property="converted" column="converted"/>
53
+            <result property="useranswertxt" column="useranswertxt"/>
54
+            <result property="good" column="good"/>
55
+            <result property="qstem" column="qstem"/>
56
+            <result property="qoption" column="qoption"/>
57
+            <result property="qanswer" column="qanswer"/>
58
+            <result property="qanalyze" column="qanalyze"/>
59
+            <result property="hashear" column="hashear"/>
60
+            <result property="hearfile" column="hearfile"/>
61
+            <result property="qlevel" column="qlevel"/>
62
+            <result property="optionnum" column="optionnum"/>
63
+            <result property="ptqid" column="ptqid"/>
64
+            <result property="checkcomm" column="checkcomm"/>
65
+            <result property="answered" column="answered"/>
66 66
         </collection>
67 67
     </resultMap>
68 68
     <!--题库作业试题-->
69 69
     <select id="listTkSt" resultMap="typeResult">
70
-        select pq.qtypename,pq.ptid,pq.ptorder,psq.qorder,sum(psq.qscore)qscore,tq.ctype,
71
-        (case when tq.qlevel=1 then pqq.qn else pqq.ptqorder end)qn,
72
-        pqq.questionpid questionid,tq.qtypename qqtypename
70
+        select pq.qtypename,pq.ptid,pq.ptorder,psq.qorder,sum(psq.qscore) as qscore,tq.ctype,
71
+        (if(tq.qlevel=1, pqq.qn, pqq.ptqorder)) as qn,
72
+        pqq.questionpid as questionid,tq.qtypename qqtypename
73 73
         <if test="showanswer==1">
74
-            ,q.classavgscore,q.classscorerate,truncate(sum(psq.stuscore)*100/sum(psq.qscore),2)scorerate
75
-            ,sum(psq.stuscore)stuscore,psq.good,tq.qanswer,tq.qanalyze
76
-            ,(case when tq.qlevel=1 then psq.checkcomm else '' end)checkcomm
74
+            ,q.classavgscore,q.classscorerate,truncate(sum(psq.stuscore)*100/sum(psq.qscore),2) as scorerate
75
+            ,sum(psq.stuscore) as stuscore,psq.good,tq.qanswer,tq.qanalyze
76
+            ,(if(tq.qlevel=1, psq.checkcomm, '')) as checkcomm
77 77
         </if>
78 78
         ,psq.answered,psq.answertype,psq.useranswer,psq.converted,psq.useranswertxt
79 79
         ,tq.qstem,tq.qoption,tq.hashear,tq.hearfile,tq.qlevel
@@ -87,8 +87,8 @@
87 87
     </select>
88 88
     <!--附件作业试题-->
89 89
     <select id="listFjSt" resultMap="typeResult">
90
-        select pq.qtypename,pq.psqtypeid ptid,pq.pstorder ptorder,ps.qn,ps.psorder qorder,ps.psscore qscore,ps.ctype,
91
-        ps.optionnum,ps.pscaid ptqid,ps.qtypename qqtypename
90
+        select pq.qtypename,pq.psqtypeid as ptid,pq.pstorder as ptorder,ps.qn,ps.psorder as qorder
91
+        ,ps.psscore as qscore,ps.ctype,ps.optionnum,ps.pscaid as ptqid,ps.qtypename as qqtypename
92 92
         <if test="showanswer==1">
93 93
             ,q.classavgscore,q.classscorerate,truncate(pss.stuscore*100/pss.qscore,2)scorerate
94 94
             ,pss.stuscore,pss.good,pss.checkcomm,ps.psanswer qanswer
@@ -106,7 +106,7 @@
106 106
         select q.questionid,q.questionpid,q.qscore,q.qn
107 107
         ,q.answered,q.answertype,q.useranswer,q.converted,q.useranswertxt
108 108
         <if test="showanswer==1">
109
-            ,q.stuscore,q.good,ifnull(q.checkcomm,'')checkcomm,tq.qanswer,tq.qanalyze
109
+            ,q.stuscore,q.good,ifnull(q.checkcomm,'') as checkcomm,tq.qanswer,tq.qanalyze
110 110
         </if>
111 111
         ,tq.sorder,tq.qstem,tq.qoption,tq.ctype,tq.qtypename
112 112
         from t_question tq right join t_paper_student_question q on tq.questionid=q.questionid
@@ -116,28 +116,28 @@
116 116
     </select>
117 117
     <!--优秀作答-->
118 118
     <resultMap id="answerResult" type="java.util.Map">
119
-        <result property="ptid" column="ptid"></result>
120
-        <result property="qorder" column="qorder"></result>
121
-        <result property="qn" column="mqn"></result>
119
+        <result property="ptid" column="ptid"/>
120
+        <result property="qorder" column="qorder"/>
121
+        <result property="qn" column="mqn"/>
122 122
         <collection property="students" ofType="java.util.Map" javaType="java.util.List">
123
-            <result property="studentid" column="studentid"></result>
124
-            <result property="username" column="username"></result>
125
-            <result property="headpic" column="headpic"></result>
126
-            <result property="qorder" column="qorder"></result>
127
-            <result property="psid" column="psid"></result>
123
+            <result property="studentid" column="studentid"/>
124
+            <result property="username" column="username"/>
125
+            <result property="headpic" column="headpic"/>
126
+            <result property="qorder" column="qorder"/>
127
+            <result property="psid" column="psid"/>
128 128
             <collection property="questions" ofType="java.util.Map" javaType="java.util.List">
129
-                <result property="studentid" column="studentid"></result>
130
-                <result property="qn" column="qn"></result>
131
-                <result property="qorder" column="qorder"></result>
132
-                <result property="psqid" column="psqid"></result>
133
-                <result property="questionpid" column="questionpid"></result>
134
-                <result property="stuscore" column="stuscore"></result>
135
-                <result property="answertype" column="answertype"></result>
136
-                <result property="useranswer" column="useranswer"></result>
137
-                <result property="converted" column="converted"></result>
138
-                <result property="useranswertxt" column="useranswertxt"></result>
139
-                <result property="checkcomm" column="checkcomm"></result>
140
-                <result property="checkid" column="checkid"></result>
129
+                <result property="studentid" column="studentid"/>
130
+                <result property="qn" column="qn"/>
131
+                <result property="qorder" column="qorder"/>
132
+                <result property="psqid" column="psqid"/>
133
+                <result property="questionpid" column="questionpid"/>
134
+                <result property="stuscore" column="stuscore"/>
135
+                <result property="answertype" column="answertype"/>
136
+                <result property="useranswer" column="useranswer"/>
137
+                <result property="converted" column="converted"/>
138
+                <result property="useranswertxt" column="useranswertxt"/>
139
+                <result property="checkcomm" column="checkcomm"/>
140
+                <result property="checkid" column="checkid"/>
141 141
             </collection>
142 142
         </collection>
143 143
     </resultMap>
@@ -152,9 +152,9 @@
152 152
     </select>
153 153
     <!--作业基本信息-->
154 154
     <select id="getPaper" resultType="java.util.Map">
155
-        select p.papername,p.papertype,p.paperclass,p.createtime,p.hasfile,p.committype,p.timetype
155
+        select p.papername,p.papertype,p.paperclass,p.createtime,p.hasfile,p.hearfile,p.committype,p.timetype
156 156
         ,pg.starttime,pg.stoptime,pg.showtype,ps.papernum,ps.paperscore,ps.showanswer
157
-        ,(case when ps.showanswer=1 then ps.userscore else 0 end)userscore
157
+        ,(if(ps.showanswer=1, ps.userscore, 0)) as userscore
158 158
         from t_paper p left join t_paper_class pg on p.paperid = pg.paperid
159 159
         left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
160 160
         where p.paperid=#{paperid} and pg.classid=#{classid} and ps.studentid=#{studentid}

+ 40
- 41
sstudy/src/main/resources/mapper/paperstudent/PaperStudedntScantronMapper.xml View File

@@ -17,7 +17,7 @@
17 17
     <select id="listPaperStudentScantronsNoAnswer" resultType="java.util.Map">
18 18
         SELECT pss.pssid,pss.paperid,pss.studentid,pss.psid,pss.qn,pss.qorder,pss.answered,pss.answertype,
19 19
         pss.useranswer,pss.converted,pss.useranswertxt,pss.qscore,pss.pscaid,pss.checkcomm,
20
-        psc.qtypeid,psc.qtypename,psc.ctype,psc.optionnum,0 costtime,0 stuscore,psc.psanswer
20
+        psc.qtypeid,psc.qtypename,psc.ctype,psc.optionnum,0 as costtime,0 as stuscore,'[]' as psanswer
21 21
         FROM t_paper_student_scantron pss
22 22
         LEFT JOIN t_paper_scantron psc ON pss.pscaid = psc.pscaid
23 23
         WHERE pss.psid=#{psid} order by pss.qorder
@@ -117,7 +117,7 @@
117 117
 
118 118
     <!--获取学生未提交试题集合-->
119 119
     <select id="listPSQByNotDo" resultType="com.xhkjedu.sstudy.model.paperstudent.TPaperStudentScantron">
120
-        SELECT pss.pscaid,pss.qscore,ps.qtypeid,ps.psorder qorder
120
+        SELECT pss.pscaid,pss.qscore,ps.qtypeid,ps.psorder as qorder
121 121
         FROM t_paper_student_scantron pss left join t_paper_scantron ps on pss.pscaid = ps.pscaid
122 122
         WHERE pss.pscaid=#{psid} AND pss.checked=0 AND pss.answered=0
123 123
     </select>
@@ -194,23 +194,23 @@
194 194
 
195 195
     <!--附件作业 按题批阅列表-->
196 196
     <resultMap id="questionResult" type="java.util.Map">
197
-        <result property="qscore" column="qscore"></result>
198
-        <result property="qorder" column="qorder"></result>
199
-        <result property="qn" column="qn"></result>
197
+        <result property="qscore" column="qscore"/>
198
+        <result property="qorder" column="qorder"/>
199
+        <result property="qn" column="qn"/>
200 200
         <collection property="students" ofType="java.util.Map" javaType="java.util.List">
201
-            <result property="stuscore" column="stuscore"></result>
202
-            <result property="answered" column="answered"></result>
203
-            <result property="checked" column="checked"></result>
204
-            <result property="checkcomm" column="checkcomm"></result>
205
-            <result property="psid" column="psid"></result>
206
-            <result property="pssid" column="pssid"></result>
207
-            <result property="answertype" column="answertype"></result>
208
-            <result property="useranswer" column="useranswer"></result>
209
-            <result property="converted" column="converted"></result>
210
-            <result property="useranswertext" column="useranswertext"></result>
211
-            <result property="useranswertxt" column="useranswertxt"></result>
212
-            <result property="good" column="good"></result>
213
-            <result property="studentname" column="username"></result>
201
+            <result property="stuscore" column="stuscore"/>
202
+            <result property="answered" column="answered"/>
203
+            <result property="checked" column="checked"/>
204
+            <result property="checkcomm" column="checkcomm"/>
205
+            <result property="psid" column="psid"/>
206
+            <result property="pssid" column="pssid"/>
207
+            <result property="answertype" column="answertype"/>
208
+            <result property="useranswer" column="useranswer"/>
209
+            <result property="converted" column="converted"/>
210
+            <result property="useranswertext" column="useranswertext"/>
211
+            <result property="useranswertxt" column="useranswertxt"/>
212
+            <result property="good" column="good"/>
213
+            <result property="studentname" column="username"/>
214 214
         </collection>
215 215
     </resultMap>
216 216
     <select id="sqcorrectList" resultMap="questionResult">
@@ -258,30 +258,29 @@
258 258
 
259 259
 
260 260
     <resultMap id="typeSQuestion" type="com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo">
261
-        <result property="qtypename" column="qtypename"></result>
262
-        <result property="ptorder" column="ptorder"></result>
263
-        <result property="ptscore" column="ptscore"></result>
264
-        <result property="ptnum" column="ptnum"></result>
261
+        <result property="qtypename" column="qtypename"/>
262
+        <result property="ptorder" column="ptorder"/>
263
+        <result property="ptscore" column="ptscore"/>
264
+        <result property="ptnum" column="ptnum"/>
265 265
         <collection property="scantrons" ofType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentScantronVo">
266
-            <result property="pssid" column="pssid"></result>
267
-            <result property="paperid" column="paperid"></result>
268
-            <result property="studentid" column="studentid"></result>
269
-            <result property="psid" column="psid"></result>
270
-            <result property="pscaid" column="pscaid"></result>
271
-            <result property="qn" column="qn"></result>
272
-            <result property="qorder" column="qorder"></result>
273
-            <result property="answered" column="answered"></result>
274
-            <result property="answertype" column="answertype"></result>
275
-            <result property="useranswer" column="useranswer"></result>
276
-            <result property="converted" column="converted"></result>
277
-            <result property="useranswertxt" column="useranswertxt"></result>
278
-            <result property="answertype" column="answertype"></result>
279
-            <result property="qscore" column="qscore"></result>
280
-            <result property="qtypeid" column="qtypeid"></result>
281
-            <result property="qtypename" column="qtypename"></result>
282
-            <result property="ctype" column="ctype"></result>
283
-            <result property="optionnum" column="optionnum"></result>
284
-            <result property="checkcomm" column="checkcomm"></result>
266
+            <result property="pssid" column="pssid"/>
267
+            <result property="paperid" column="paperid"/>
268
+            <result property="studentid" column="studentid"/>
269
+            <result property="psid" column="psid"/>
270
+            <result property="pscaid" column="pscaid"/>
271
+            <result property="qn" column="qn"/>
272
+            <result property="qorder" column="qorder"/>
273
+            <result property="answered" column="answered"/>
274
+            <result property="answertype" column="answertype"/>
275
+            <result property="useranswer" column="useranswer"/>
276
+            <result property="converted" column="converted"/>
277
+            <result property="useranswertxt" column="useranswertxt"/>
278
+            <result property="qscore" column="qscore"/>
279
+            <result property="qtypeid" column="qtypeid"/>
280
+            <result property="qtypename" column="qtypename"/>
281
+            <result property="ctype" column="ctype"/>
282
+            <result property="optionnum" column="optionnum"/>
283
+            <result property="checkcomm" column="checkcomm"/>
285 284
         </collection>
286 285
     </resultMap>
287 286
     <!--学生作答时作业试题-->

Loading…
Cancel
Save