Browse Source

完善试卷分析

tags/正式版本
王宁 2 years ago
parent
commit
ffce8c888a

+ 12
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

13
 import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
13
 import com.xhkjedu.sexam.vo.paper.QuestionOrderVo;
14
 import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
14
 import com.xhkjedu.sexam.vo.paper.QuestionPointVo;
15
 import com.xhkjedu.utils.N_Utils;
15
 import com.xhkjedu.utils.N_Utils;
16
+import org.apache.commons.lang.SerializationUtils;
16
 import org.springframework.stereotype.Service;
17
 import org.springframework.stereotype.Service;
17
 
18
 
18
 import javax.annotation.Resource;
19
 import javax.annotation.Resource;
20
+import java.io.Serializable;
19
 import java.lang.reflect.Array;
21
 import java.lang.reflect.Array;
20
 import java.util.*;
22
 import java.util.*;
21
 import java.util.stream.Collectors;
23
 import java.util.stream.Collectors;
216
                 q.remove("mhashear");
218
                 q.remove("mhashear");
217
                 q.remove("mhearfile");
219
                 q.remove("mhearfile");
218
                 q.remove("mquestionid");
220
                 q.remove("mquestionid");
221
+                q.remove("mcomplexity");
219
                 q.remove("mctype");
222
                 q.remove("mctype");
220
                 q.remove("questionpid");
223
                 q.remove("questionpid");
221
                 rtnlist.add(q);
224
                 rtnlist.add(q);
258
                         List<Map> points = (List<Map>) q.get("points");
261
                         List<Map> points = (List<Map>) q.get("points");
259
                         mq.put("points", points);
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
                     Double stuscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("stuscore").toString())).sum();
268
                     Double stuscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("stuscore").toString())).sum();
263
                     Double pscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("qscore").toString())).sum();
269
                     Double pscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("qscore").toString())).sum();
264
                     mq.put("qscore",pscore);
270
                     mq.put("qscore",pscore);
265
                     mq.put("stuscore",stuscore);
271
                     mq.put("stuscore",stuscore);
266
                     mq.put("srate", N_Utils.getDoubleDivideAndMulitiply(stuscore, pscore));
272
                     mq.put("srate", N_Utils.getDoubleDivideAndMulitiply(stuscore, pscore));
273
+
267
                     for(Map sonmap : sonqueslist){
274
                     for(Map sonmap : sonqueslist){
268
                         sonmap.remove("mqstem");
275
                         sonmap.remove("mqstem");
269
                         sonmap.remove("msum");
276
                         sonmap.remove("msum");
274
                         sonmap.remove("mhearfile");
281
                         sonmap.remove("mhearfile");
275
                         sonmap.remove("mquestionid");
282
                         sonmap.remove("mquestionid");
276
                         sonmap.remove("mctype");
283
                         sonmap.remove("mctype");
284
+                        sonmap.remove("mcomplexity");
277
                         sonmap.remove("points");
285
                         sonmap.remove("points");
278
                         sonmap.remove("hashear");
286
                         sonmap.remove("hashear");
279
                         sonmap.remove("hearfile");
287
                         sonmap.remove("hearfile");
347
                 Map pmap = new HashMap();
355
                 Map pmap = new HashMap();
348
                 pmap.put("pointid", pointmap.get("pointid").toString());
356
                 pmap.put("pointid", pointmap.get("pointid").toString());
349
                 pmap.put("pointname", pointmap.get("pointname").toString());
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
                 pointqueslist.add(pmap);
362
                 pointqueslist.add(pmap);
352
             }
363
             }
353
         }
364
         }

+ 11
- 9
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

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

+ 8
- 0
sexam/src/test/java/com/xhkjedu/sexam/SexamApplicationTests.java View File

13
 
13
 
14
     @Resource
14
     @Resource
15
     private EReportGenerateService eReportGenerateService;
15
     private EReportGenerateService eReportGenerateService;
16
+    @Resource
17
+    private EPaperQtypeService ePaperQtypeService;
16
 
18
 
17
     @Test
19
     @Test
18
     void contextLoads() {
20
     void contextLoads() {
19
 //        eReportGenerateService.saveClassQuestions(2);
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
 }

Loading…
Cancel
Save