Browse Source

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 years ago
parent
commit
febfe10f59

+ 41
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/reportstu/ERStudentQtype.java View File

@@ -0,0 +1,41 @@
1
+package com.xhkjedu.sexam.model.reportstu;
2
+
3
+import com.xhkjedu.sexam.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+/**
10
+ * @Description考考试报告试卷学生题型分析表
11
+ * @Author WN
12
+ * Date 2022/8/15 14:10
13
+ **/
14
+@Table(name = "e_rstudent_qtype")
15
+@Data
16
+public class ERStudentQtype extends BaseBean {
17
+    @Id
18
+    //考试报告试卷学生题型分析表
19
+    private Integer erstid;
20
+
21
+    //考试id
22
+    private Integer examid;
23
+
24
+    //科目id
25
+    private Integer subjectid;
26
+
27
+    //学生id
28
+    private Integer studentid;
29
+
30
+    //班级id
31
+    private Integer classid;
32
+
33
+    //题型名称
34
+    private String qtypename;
35
+
36
+    //学生得分
37
+    private Double stuscore;
38
+
39
+    //学生得分率
40
+    private Double stusrate;
41
+}

+ 5
- 5
sexam/src/main/java/com/xhkjedu/sexam/model/reportstu/ERstudentPoint.java View File

@@ -31,7 +31,7 @@ public class ERstudentPoint extends BaseBean {
31 31
     //知识点名称
32 32
     private String pointname;
33 33
 
34
-    //知识点题号
34
+   /* //知识点题号
35 35
     private String qns;
36 36
 
37 37
     //知识点分值
@@ -39,14 +39,14 @@ public class ERstudentPoint extends BaseBean {
39 39
 
40 40
     //分值占比
41 41
     private Double srate;
42
-
42
+*/
43 43
     //学生得分
44 44
     private Double stuscore;
45 45
 
46 46
     //学生得分率
47
-    private Double sturate;
47
+    private Double stusrate;
48 48
 
49
-    //班级得分
49
+    /*//班级得分
50 50
     private Double classscore;
51 51
 
52 52
     //班级得分率
@@ -56,5 +56,5 @@ public class ERstudentPoint extends BaseBean {
56 56
     private Double gradescore;
57 57
 
58 58
     //年级得分率
59
-    private Double graderate;
59
+    private Double graderate;*/
60 60
 }

+ 49
- 17
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

@@ -200,9 +200,10 @@ public class EPaperQtypeService {
200 200
         List<EPaperQPointVo> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
201 201
 
202 202
         //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11综合题12听力
203
-        List<EPaperQsVo> typelist = new ArrayList<>();//题型分析
203
+        List<Map> typelist = new ArrayList<>();//题型分析
204 204
         //处理出试卷中所有试题、知识点
205 205
         for(EPaperQtypeVo qt : qtypelist){
206
+            List<Integer> qorderlist = new ArrayList<>();
206 207
             for(EPaperQtypeQuestionVo q : qt.getQuestions()){
207 208
                 //处理试题关联知识点
208 209
                 List<EPaperQPointVo> pointslist = q.getPoints();
@@ -221,15 +222,20 @@ public class EPaperQtypeService {
221 222
                     q.setQuestionpid("000");
222 223
                 }
223 224
                 queslist.add(q);
225
+                if(!qorderlist.contains(q.getQorder())){
226
+                    qorderlist.add(q.getQorder());
227
+                }
224 228
             }
225 229
 
226 230
             double storerate = N_Utils.getDoubleDivideAndMulitiply(qt.getEptscore(), ePaper.getPscore());
227 231
             EPaperQsVo tvo = new EPaperQsVo();
228
-            tvo.setQtname(qt.getEptname());
229
-            tvo.setNum(qt.getEptnum());
230
-            tvo.setScore(qt.getEptscore());
231
-            tvo.setSrate(storerate);
232
-            typelist.add(tvo);
232
+            Map tmap = new HashMap();
233
+            tmap.put("qtname",qt.getEptname());
234
+            tmap.put("num",qt.getEptnum());
235
+            tmap.put("score",qt.getEptscore());
236
+            tmap.put("srate",storerate);
237
+            tmap.put("qns",qorderlist);
238
+            typelist.add(tmap);
233 239
         }
234 240
 
235 241
         //获取出所有单题和母题,进行判断区分
@@ -320,7 +326,7 @@ public class EPaperQtypeService {
320 326
             pm.put("pointname",pvo.get(0).getPointname());
321 327
             pm.put("score",cscore);
322 328
             pm.put("srate",scorerate);
323
-            pm.put("order",JSON.toJSONString(thlist));
329
+            pm.put("order",thlist);
324 330
             pointlist.add(pm);
325 331
         }
326 332
 
@@ -360,9 +366,21 @@ public class EPaperQtypeService {
360 366
         double zscorerate = N_Utils.getDoubleDivideAndMulitiply(zscore, ePaper.getPscore());
361 367
         double kscorerate = N_Utils.getDoubleReduce(100.0,zscorerate);
362 368
 
363
-        List<EPaperQsVo> ranglist = new ArrayList<>();
364
-        ranglist.add(new EPaperQsVo("主观题",zscore,znum,zscorerate,znumrate));
365
-        ranglist.add(new EPaperQsVo("客观题",kscore,knum,kscorerate,knumrate));
369
+        List<Map> ranglist = new ArrayList<>();
370
+        Map zgmap = new HashMap();
371
+        zgmap.put("qtname","主观题");
372
+        zgmap.put("score","zscore");
373
+        zgmap.put("num","znum");
374
+        zgmap.put("srate","zscorerate");
375
+        zgmap.put("nrate","znumrate");
376
+        ranglist.add(zgmap);
377
+        Map kgmap = new HashMap();
378
+        kgmap.put("qtname","客观题");
379
+        kgmap.put("score","kscore");
380
+        kgmap.put("num","knum");
381
+        kgmap.put("srate","kscorerate");
382
+        kgmap.put("nrate","knumrate");
383
+        ranglist.add(kgmap);
366 384
 
367 385
         Map ztmap = new HashMap<>();
368 386
         ztmap.put("pnum", ePaper.getPnum());
@@ -372,18 +390,32 @@ public class EPaperQtypeService {
372 390
         //题型分布(按照名称进行分组)
373 391
         fjtypelist.stream().sorted(Comparator.comparing(EPaperQtype::getEptorder)).collect(Collectors.toList());
374 392
         Map<String,List<EPaperQtype>> qtypemap =  fjtypelist.stream().collect(Collectors.groupingBy(EPaperQtype:: getEptname, Collectors.toList()));
375
-        List<EPaperQsVo> qtlist = new ArrayList<>();
393
+        List<Map> qtlist = new ArrayList<>();
376 394
         for(Map.Entry<String, List<EPaperQtype>> entry : qtypemap.entrySet()){
377 395
             List<EPaperQtype> aq = entry.getValue();
378 396
             int num = aq.stream().mapToInt(EPaperQtype::getEptnum).sum();
379 397
             double tscore = aq.stream().collect(Collectors.summingDouble(EPaperQtype:: getEptscore));
380 398
             double storerate = N_Utils.getDoubleDivideAndMulitiply(tscore, ePaper.getPscore());
381
-            EPaperQsVo qvo = new EPaperQsVo();
382
-            qvo.setQtname(entry.getKey());
383
-            qvo.setNum(num);
384
-            qvo.setScore(tscore);
385
-            qvo.setSrate(storerate);
386
-            qtlist.add(qvo);
399
+            //获取小题题号
400
+
401
+            List<String> allqns = new ArrayList<>();
402
+            for(EPaperQtype t : aq){
403
+                List<EPaperQtypeQuestion> qlist = t.getQuestions();
404
+                List<String> qnlist = qlist.stream().map(EPaperQtypeQuestion :: getQn).collect(Collectors.toList());
405
+                for(String n : qnlist){
406
+                    if(!allqns.contains(n)){
407
+                        allqns.add(n);
408
+                    }
409
+                }
410
+            }
411
+
412
+            Map tmap = new HashMap();
413
+            tmap.put("qtname",entry.getKey());
414
+            tmap.put("num",num);
415
+            tmap.put("score",tscore);
416
+            tmap.put("srate",storerate);
417
+            tmap.put("qns",allqns);
418
+            qtlist.add(tmap);
387 419
         }
388 420
 
389 421
         EPaperAnalyze epa = new EPaperAnalyze();

+ 11
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -21,7 +21,9 @@ import com.xhkjedu.sexam.model.reportclass.ERclass;
21 21
 import com.xhkjedu.sexam.model.reportclass.ERclassQtype;
22 22
 import com.xhkjedu.sexam.model.reportclass.ERclassQuestion;
23 23
 import com.xhkjedu.sexam.model.reportclass.ERclassQuestionPoint;
24
+import com.xhkjedu.sexam.model.reportstu.ERStudentQtype;
24 25
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
26
+import com.xhkjedu.sexam.model.reportstu.ERstudentPoint;
25 27
 import com.xhkjedu.sexam.utils.ExamUtil;
26 28
 import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
27 29
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeQuestionVo;
@@ -348,6 +350,8 @@ public class EReportGenerateService {
348 350
         List<ERclassQtype> rtypelist = new ArrayList<>();
349 351
         List<ERclassQuestion> rqlist = new ArrayList<>();
350 352
         List<ERclassQuestionPoint> rpointlist = new ArrayList<>();
353
+        List<ERStudentQtype> stuqtypes = new ArrayList<>();
354
+        List<ERstudentPoint> stupoints = new ArrayList<>();
351 355
 
352 356
         for(Map map : subjects){
353 357
             String subjectid = map.get("subjectid").toString();
@@ -362,6 +366,9 @@ public class EReportGenerateService {
362 366
                 fjtypelist = ePaperQtypeMapper.listPaperQtypeQuesitonsForFj(epid);//试卷题型试题信息(附件)
363 367
             }
364 368
 
369
+            //获取试卷只是分析
370
+            Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
371
+
365 372
             //遍及试卷处理题型下各班级得分情况
366 373
             for(EPaperQtypeVo t : fjtypelist){
367 374
                 Double eptscore = t.getEptscore();
@@ -465,8 +472,6 @@ public class EReportGenerateService {
465 472
 
466 473
             //仅有题库试卷有知识点
467 474
             if(ptype == 1){
468
-                //获取试卷只是分析
469
-                Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
470 475
                 String pointjson = epa.get("pointjson").toString();
471 476
                 List<Map> pointlist = JSON.parseArray(pointjson,Map.class);
472 477
                 //遍历知识点处理年级班级知识点情况
@@ -476,9 +481,8 @@ public class EReportGenerateService {
476 481
                     String pointname = pointmap.get("pointname").toString();
477 482
                     Double score = Double.parseDouble(pointmap.get("score").toString());
478 483
                     Double scorerate = Double.parseDouble(pointmap.get("scorerate").toString());
479
-                    String qnstr = pointmap.get("order").toString();
484
+                    List<Integer> qnlst = (List<Integer>) pointmap.get("order");//试题排序集合
480 485
 
481
-                    List<String> qnlst = JSON.parseArray(qnstr,String.class);//题号集合
482 486
                     List<EPaperStudentQuestion> gstus = stulist.stream().filter(o -> o.getEpid().equals(epid) && qnlst.contains(o.getQn())).collect(Collectors.toList());
483 487
                     Double gstuscore = gstus.stream().mapToDouble(EPaperStudentQuestion :: getStuscore).sum();
484 488
                     Double gscore = gstus.stream().mapToDouble(EPaperStudentQuestion :: getQscore).sum();
@@ -501,16 +505,14 @@ public class EReportGenerateService {
501 505
                         pointvo.setPointname(pointname);
502 506
                         pointvo.setScore(score);
503 507
                         pointvo.setSrate(scorerate);
504
-                        pointvo.setQns(qnstr);
508
+                        pointvo.setQns(qnlst.stream().map(String::valueOf).collect(Collectors.joining(",")));
505 509
                         pointvo.setGradeavgscore(gavgscore);
506 510
                         pointvo.setGradesrate(gsrate);
507 511
                         pointvo.setClassavgscore(cavgscore);
508 512
                         pointvo.setClasssrate(csrate);
509 513
                         rpointlist.add(pointvo);
510 514
                     }
511
-
512 515
                 }
513
-
514 516
             }
515 517
         }
516 518
         eRclassQtypeMapper.insertList(rtypelist);
@@ -657,4 +659,6 @@ public class EReportGenerateService {
657 659
         rtnmap.put("badlist",JSON.toJSONString(badlist));
658 660
         return rtnmap;
659 661
     }
662
+
663
+
660 664
 }

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQsVo.java View File

@@ -20,6 +20,8 @@ public class EPaperQsVo {
20 20
     private double srate;//分值占比
21 21
 
22 22
     private double nrate;//数量占比
23
+
24
+    private String qns;//小题题号
23 25
     public EPaperQsVo(){
24 26
 
25 27
     }

Loading…
Cancel
Save