Browse Source

试卷错题集计算得分率

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

+ 25
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

180
         List<Map> list = null;
180
         List<Map> list = null;
181
         if (ptype == 1) {
181
         if (ptype == 1) {
182
             list = eRstudentMapper.listStudentQuestionsTk(epid, studentid);
182
             list = eRstudentMapper.listStudentQuestionsTk(epid, studentid);
183
+            setPaperQuestionForTK(list);
183
         } else {
184
         } else {
184
             list = eRstudentMapper.listStudentQuestionsFj(epid, studentid);
185
             list = eRstudentMapper.listStudentQuestionsFj(epid, studentid);
186
+            for(Map qmap : list){
187
+                Double stuscore = Double.parseDouble(qmap.get("stuscore").toString());
188
+                Double pscore = Double .parseDouble(qmap.get("qscore").toString());
189
+                qmap.put("srate",N_Utils.getDoubleDivideAndMulitiply(stuscore,pscore));
190
+            }
185
             List<Map> files = ePaperFileMapper.listPaperFiles(epid);
191
             List<Map> files = ePaperFileMapper.listPaperFiles(epid);
186
             map.put("files", files);
192
             map.put("files", files);
187
         }
193
         }
203
                 map.put("ctype", Integer.parseInt(q.get("ctype").toString()));
209
                 map.put("ctype", Integer.parseInt(q.get("ctype").toString()));
204
                 map.put("qn", q.get("qn").toString());
210
                 map.put("qn", q.get("qn").toString());
205
                 map.put("qorder", Integer.parseInt(q.get("qorder").toString()));
211
                 map.put("qorder", Integer.parseInt(q.get("qorder").toString()));
206
-                map.put("qscore", Double.parseDouble(q.get("qscore").toString()));
207
-                map.put("stuscore", Double.parseDouble(q.get("stuscore").toString()));
212
+                Double stuscore = Double.parseDouble(q.get("qscore").toString());
213
+                Double pscore = Double .parseDouble(map.get("qscore").toString());
214
+                map.put("qscore", pscore);
215
+                map.put("stuscore", stuscore);
208
                 map.put("answered", Integer.parseInt(q.get("answered").toString()));
216
                 map.put("answered", Integer.parseInt(q.get("answered").toString()));
209
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
217
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
210
                 map.put("stuanswer", q.get("stuanswer").toString());
218
                 map.put("stuanswer", q.get("stuanswer").toString());
231
                 map.put("qlevel", qlevel);
239
                 map.put("qlevel", qlevel);
232
                 map.put("classavgscore", Double.parseDouble(q.get("classavgscore").toString()));
240
                 map.put("classavgscore", Double.parseDouble(q.get("classavgscore").toString()));
233
                 map.put("gradeavgscore", Double.parseDouble(q.get("gradeavgscore").toString()));
241
                 map.put("gradeavgscore", Double.parseDouble(q.get("gradeavgscore").toString()));
242
+                map.put("srate",N_Utils.getDoubleDivideAndMulitiply(stuscore,pscore));//得分率
243
+
234
                 if (q.get("points") != null) {
244
                 if (q.get("points") != null) {
235
                     List<Map> points = (List<Map>) q.get("points");
245
                     List<Map> points = (List<Map>) q.get("points");
236
                     map.put("points", points);
246
                     map.put("points", points);
249
                     mq.put("qorder", Integer.parseInt(q.get("qorder").toString()));
259
                     mq.put("qorder", Integer.parseInt(q.get("qorder").toString()));
250
                     mq.put("ctype", Integer.parseInt(q.get("mctype").toString()));
260
                     mq.put("ctype", Integer.parseInt(q.get("mctype").toString()));
251
                     mq.put("qstem", q.get("mqstem").toString());
261
                     mq.put("qstem", q.get("mqstem").toString());
252
-                    mq.put("qoption", q.get("mqoption").toString());
253
                     if(N_Utils.isNotEmpty(q.get("mqoption"))){
262
                     if(N_Utils.isNotEmpty(q.get("mqoption"))){
254
                         mq.put("qoption", q.get("mqoption").toString());
263
                         mq.put("qoption", q.get("mqoption").toString());
255
                     }else{
264
                     }else{
275
                         List<Map> points = (List<Map>) q.get("points");
284
                         List<Map> points = (List<Map>) q.get("points");
276
                         mq.put("points", points);
285
                         mq.put("points", points);
277
                     }
286
                     }
287
+
288
+                    Double stuscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("stuscore").toString())).sum();
289
+                    Double pscore = sonqueslist.stream().mapToDouble(s -> Double.parseDouble(s.get("pscore").toString())).sum();
290
+                    mq.put("srate",N_Utils.getDoubleDivideAndMulitiply(stuscore,pscore));
291
+
278
                     mq.put("sonques", sonqueslist);
292
                     mq.put("sonques", sonqueslist);
279
                     rtnlist.add(mq);
293
                     rtnlist.add(mq);
280
                 }
294
                 }
362
      * @Date 2022/8/29 16:15
376
      * @Date 2022/8/29 16:15
363
      **/
377
      **/
364
     public List<Map> listStudentErrorQuestionsFj(Integer examid, Integer studentid,String subjectid){
378
     public List<Map> listStudentErrorQuestionsFj(Integer examid, Integer studentid,String subjectid){
365
-        return eRstudentMapper.listStudentErrorQuestionsForFj(examid,studentid,subjectid);
379
+        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForFj(examid,studentid,subjectid);
380
+        for(Map map : list){
381
+            Double stuscore = Double.parseDouble(map.get("stuscore").toString());
382
+            Double pscore = Double .parseDouble(map.get("qscore").toString());
383
+            Double srate = N_Utils.getDoubleDivideAndMulitiply(stuscore,pscore);
384
+            map.put("srate",srate);
385
+        }
386
+        return list;
366
     }
387
     }
367
 
388
 
368
 }
389
 }

Loading…
Cancel
Save