Pārlūkot izejas kodu

完善试卷分析

tags/正式版本
王宁 pirms 2 gadiem
vecāks
revīzija
ffce8c888a

+ 12
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java Parādīt failu

@@ -13,9 +13,11 @@ import com.xhkjedu.sexam.model.paper.EPaper;
13 13
 import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
14 14
 import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
15 15
 import com.xhkjedu.utils.N_Utils;
16
+import org.apache.commons.lang.SerializationUtils;
16 17
 import org.springframework.stereotype.Service;
17 18
 
18 19
 import javax.annotation.Resource;
20
+import java.io.Serializable;
19 21
 import java.lang.reflect.Array;
20 22
 import java.util.*;
21 23
 import java.util.stream.Collectors;
@@ -216,6 +218,7 @@ public class EReportStudentService {
216 218
                 q.remove("mhashear");
217 219
                 q.remove("mhearfile");
218 220
                 q.remove("mquestionid");
221
+                q.remove("mcomplexity");
219 222
                 q.remove("mctype");
220 223
                 q.remove("questionpid");
221 224
                 rtnlist.add(q);
@@ -258,12 +261,16 @@ public class EReportStudentService {
258 261
                         List<Map> points = (List<Map>) q.get("points");
259 262
                         mq.put("points", points);
260 263
                     }
264
+                    mq.put("complexity",q.get("mcomplexity").toString());
265
+                    mq.put("classavgscore",q.get("classavgscore").toString());
266
+                    mq.put("gradeavgscore",q.get("gradeavgscore").toString());
261 267
 
262 268
                     Double stuscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("stuscore").toString())).sum();
263 269
                     Double pscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("qscore").toString())).sum();
264 270
                     mq.put("qscore",pscore);
265 271
                     mq.put("stuscore",stuscore);
266 272
                     mq.put("srate", N_Utils.getDoubleDivideAndMulitiply(stuscore, pscore));
273
+
267 274
                     for(Map sonmap : sonqueslist){
268 275
                         sonmap.remove("mqstem");
269 276
                         sonmap.remove("msum");
@@ -274,6 +281,7 @@ public class EReportStudentService {
274 281
                         sonmap.remove("mhearfile");
275 282
                         sonmap.remove("mquestionid");
276 283
                         sonmap.remove("mctype");
284
+                        sonmap.remove("mcomplexity");
277 285
                         sonmap.remove("points");
278 286
                         sonmap.remove("hashear");
279 287
                         sonmap.remove("hearfile");
@@ -347,7 +355,10 @@ public class EReportStudentService {
347 355
                 Map pmap = new HashMap();
348 356
                 pmap.put("pointid", pointmap.get("pointid").toString());
349 357
                 pmap.put("pointname", pointmap.get("pointname").toString());
350
-                pmap.put("questions", setPaperQuestionForTK(poinques));
358
+                List<Map> plist = new ArrayList<>();
359
+                String jsonlist = JSON.toJSONString(poinques);
360
+                plist = JSON.parseArray(jsonlist,Map.class);
361
+                pmap.put("questions", setPaperQuestionForTK(plist));
351 362
                 pointqueslist.add(pmap);
352 363
             }
353 364
         }

+ 11
- 9
sexam/src/main/resources/mapper/report/ERstudentMapper.xml Parādīt failu

@@ -104,6 +104,7 @@
104 104
         <result property="hearfile" column="hearfile" />
105 105
         <result property="qlevel" column="qlevel" />
106 106
         <result property="sorder" column="sorder" />
107
+        <result property="complexity" column="complexity" />
107 108
         <result property="questionpid" column="questionpid" />
108 109
         <result property="mquestionid" column="mquestionid" />
109 110
         <result property="mqstem" column="mqstem" />
@@ -115,6 +116,7 @@
115 116
         <result property="mqlevel" column="mqlevel" />
116 117
         <result property="mctype" column="mctype" />
117 118
         <result property="msnum" column="msnum" />
119
+        <result property="mcomplexity" column="mcomplexity" />
118 120
         <result property="classavgscore" column="classavgscore" />
119 121
         <result property="gradeavgscore" column="gradeavgscore" />
120 122
         <collection property="points" ofType="java.util.Map" javaType="java.util.List"
@@ -126,12 +128,12 @@
126 128
     <select id="listStudentQuestionsTk" resultMap="listStudentQues">
127 129
         select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
128 130
         sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,q.qstem,q.qoption,q.qanalyze,q.hashear,q.hearfile,
129
-        q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
131
+        q.qlevel,q.sorder,q.complexity,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
130 132
         mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
131
-        cq.classavgscore,cq.gradeavgscore
133
+        mq.complexity mcomplexity,cq.classavgscore,cq.gradeavgscore
132 134
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
133 135
         left join t_question mq on q.questionpid=mq.questionid
134
-        left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
136
+        left join e_rclass_question cq on (sq.questionid=cq.questionid or mq.questionid=cq.questionid)
135 137
         left join e_paper_qtype_question pq on sq.eptqid=pq.eptqid
136 138
         where sq.epid=#{epid} and sq.studentid=#{studentid} GROUP BY sq.epsqid order by sq.qorder,q.sorder
137 139
     </select>
@@ -149,9 +151,10 @@
149 151
 
150 152
     <!--学生报告-试卷分析(题库)-->
151 153
     <select id="listStudentQuestionsFj" resultType="java.util.Map">
152
-        select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
153
-               sq.answertype,sq.stuanswer,sq.stuanswertxt,cq.classavgscore,cq.gradeavgscore
154
+        select sq.epsqid,sq.eptqid,sq.ctype,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
155
+               sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,pq.qtypename,cq.classavgscore,cq.gradeavgscore
154 156
         from e_paper_student_question sq left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
157
+        left join e_paper_qtype_question pq on sq.eptqid=pq.eptqid
155 158
         where sq.epid=#{epid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
156 159
     </select>
157 160
 
@@ -181,12 +184,12 @@
181 184
     <select id="listStudentErrorQuestionsForTk" resultMap="listStudentQues">
182 185
         select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
183 186
                sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.hashear,q.hearfile,
184
-               q.qlevel,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
187
+               q.qlevel,q.sorder,q.complexity,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
185 188
                mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
186
-               cq.classavgscore,cq.gradeavgscore
189
+               mq.complexity mcomplexity,cq.classavgscore,cq.gradeavgscore
187 190
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
188 191
         left join t_question mq on q.questionpid=mq.questionid
189
-        left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
192
+        left join e_rclass_question cq on (sq.questionid=cq.questionid or mq.questionid=cq.questionid)
190 193
         left join e_paper_qtype_question pq on sq.eptqid=pq.eptqid
191 194
         where sq.examid=#{examid} and sq.subjectid=#{subjectid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore
192 195
         GROUP BY sq.epsqid order by sq.qorder,q.sorder
@@ -200,7 +203,6 @@
200 203
         from e_paper_student_question sq left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
201 204
         left join e_paper_qtype_question q on sq.eptqid=q.eptqid
202 205
         where sq.examid=#{examid} and sq.subjectid=#{subjectid} and sq.studentid=#{studentid} group by sq.epsqid order by sq.qorder
203
-
204 206
     </select>
205 207
 
206 208
 </mapper>

+ 8
- 0
sexam/src/test/java/com/xhkjedu/sexam/SexamApplicationTests.java Parādīt failu

@@ -13,10 +13,18 @@ class SexamApplicationTests {
13 13
 
14 14
     @Resource
15 15
     private EReportGenerateService eReportGenerateService;
16
+    @Resource
17
+    private EPaperQtypeService ePaperQtypeService;
16 18
 
17 19
     @Test
18 20
     void contextLoads() {
19 21
 //        eReportGenerateService.saveClassQuestions(2);
22
+//        EPaper epaper = new EPaper();
23
+//        epaper.setEpid(6);
24
+//        epaper.setPnum(12);
25
+//        epaper.setPscore(100.0);
26
+//        ePaperQtypeService.savePaperAnalyzeForQuestion(epaper);
27
+
20 28
     }
21 29
 
22 30
 }

Notiek ielāde…
Atcelt
Saglabāt