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,8 +180,14 @@ public class EReportStudentService {
180 180
         List<Map> list = null;
181 181
         if (ptype == 1) {
182 182
             list = eRstudentMapper.listStudentQuestionsTk(epid, studentid);
183
+            setPaperQuestionForTK(list);
183 184
         } else {
184 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 191
             List<Map> files = ePaperFileMapper.listPaperFiles(epid);
186 192
             map.put("files", files);
187 193
         }
@@ -203,8 +209,10 @@ public class EReportStudentService {
203 209
                 map.put("ctype", Integer.parseInt(q.get("ctype").toString()));
204 210
                 map.put("qn", q.get("qn").toString());
205 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 216
                 map.put("answered", Integer.parseInt(q.get("answered").toString()));
209 217
                 map.put("answertype", Integer.parseInt(q.get("answertype").toString()));
210 218
                 map.put("stuanswer", q.get("stuanswer").toString());
@@ -231,6 +239,8 @@ public class EReportStudentService {
231 239
                 map.put("qlevel", qlevel);
232 240
                 map.put("classavgscore", Double.parseDouble(q.get("classavgscore").toString()));
233 241
                 map.put("gradeavgscore", Double.parseDouble(q.get("gradeavgscore").toString()));
242
+                map.put("srate",N_Utils.getDoubleDivideAndMulitiply(stuscore,pscore));//得分率
243
+
234 244
                 if (q.get("points") != null) {
235 245
                     List<Map> points = (List<Map>) q.get("points");
236 246
                     map.put("points", points);
@@ -249,7 +259,6 @@ public class EReportStudentService {
249 259
                     mq.put("qorder", Integer.parseInt(q.get("qorder").toString()));
250 260
                     mq.put("ctype", Integer.parseInt(q.get("mctype").toString()));
251 261
                     mq.put("qstem", q.get("mqstem").toString());
252
-                    mq.put("qoption", q.get("mqoption").toString());
253 262
                     if(N_Utils.isNotEmpty(q.get("mqoption"))){
254 263
                         mq.put("qoption", q.get("mqoption").toString());
255 264
                     }else{
@@ -275,6 +284,11 @@ public class EReportStudentService {
275 284
                         List<Map> points = (List<Map>) q.get("points");
276 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 292
                     mq.put("sonques", sonqueslist);
279 293
                     rtnlist.add(mq);
280 294
                 }
@@ -362,7 +376,14 @@ public class EReportStudentService {
362 376
      * @Date 2022/8/29 16:15
363 377
      **/
364 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