Browse Source

完善小题分析

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

+ 9
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/reportclass/ERclassQuestion.java View File

36
     //试题排序
36
     //试题排序
37
     private Integer qorder;
37
     private Integer qorder;
38
 
38
 
39
+    //分值
40
+    private Double score;
41
+
42
+    //难易度
43
+    private Integer complexity;
44
+
45
+    //题型名称
46
+    private String qtypename;
47
+
39
     //班级得分
48
     //班级得分
40
     private Double classscore;
49
     private Double classscore;
41
 
50
 

+ 18
- 12
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

14
 import com.xhkjedu.utils.N_Utils;
14
 import com.xhkjedu.utils.N_Utils;
15
 import com.xhkjedu.vo.ResultVo;
15
 import com.xhkjedu.vo.ResultVo;
16
 import lombok.extern.slf4j.Slf4j;
16
 import lombok.extern.slf4j.Slf4j;
17
-import org.springframework.beans.BeanUtils;
18
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
20
 import org.springframework.transaction.annotation.Transactional;
19
 import org.springframework.transaction.annotation.Transactional;
266
                         mq.setComplexity(qobj.getMcomplexity());
265
                         mq.setComplexity(qobj.getMcomplexity());
267
                         mq.setQorder(qobj.getQorder());
266
                         mq.setQorder(qobj.getQorder());
268
                         mq.setScore(score);
267
                         mq.setScore(score);
268
+                        mq.setQtypename(qobj.getMqtypename());
269
                         if(k == 0){
269
                         if(k == 0){
270
                             mq.setMctype(111);
270
                             mq.setMctype(111);
271
                         }else{
271
                         }else{
293
 
293
 
294
             //试题题型分析数据
294
             //试题题型分析数据
295
             double storerate = N_Utils.getDoubleDivideAndMulitiply(qt.getEptscore(), ePaper.getPscore());
295
             double storerate = N_Utils.getDoubleDivideAndMulitiply(qt.getEptscore(), ePaper.getPscore());
296
-            Map tmap = new HashMap();
297
-            tmap.put("qtname",qt.getEptname());
296
+            Map tmap = new TreeMap();
298
             tmap.put("qtid",qt.getEptid());
297
             tmap.put("qtid",qt.getEptid());
298
+            tmap.put("qtname",qt.getEptname());
299
             tmap.put("num",qt.getEptnum());
299
             tmap.put("num",qt.getEptnum());
300
             tmap.put("score",qt.getEptscore());
300
             tmap.put("score",qt.getEptscore());
301
             tmap.put("srate",storerate);
301
             tmap.put("srate",storerate);
325
         zgq.setScore(N_Utils.getDoubleReduce(ePaper.getPscore(),ktscore));
325
         zgq.setScore(N_Utils.getDoubleReduce(ePaper.getPscore(),ktscore));
326
         zgq.setSrate(N_Utils.getDoubleReduce(100.0,ktsrate));
326
         zgq.setSrate(N_Utils.getDoubleReduce(100.0,ktsrate));
327
         ranglist.add(zgq);
327
         ranglist.add(zgq);
328
-        Map ztmap = new HashMap<>();
328
+        Map ztmap = new TreeMap<>();
329
         ztmap.put("pnum", ePaper.getPnum());
329
         ztmap.put("pnum", ePaper.getPnum());
330
         ztmap.put("pscore",ePaper.getPscore());
330
         ztmap.put("pscore",ePaper.getPscore());
331
         ztmap.put("ranglist",ranglist);
331
         ztmap.put("ranglist",ranglist);
338
                 List<QuestionOrderVo> pgblist = entry.getValue();
338
                 List<QuestionOrderVo> pgblist = entry.getValue();
339
                 Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
339
                 Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
340
                 Double srate = N_Utils.getDoubleDivideAndMulitiply(score,ePaper.getPscore());
340
                 Double srate = N_Utils.getDoubleDivideAndMulitiply(score,ePaper.getPscore());
341
-                Map prate = new HashMap();
341
+                Map prate = new TreeMap();
342
                 prate.put("level",Integer.parseInt(entry.getKey()));
342
                 prate.put("level",Integer.parseInt(entry.getKey()));
343
                 prate.put("score",score);
343
                 prate.put("score",score);
344
                 prate.put("srate",srate);
344
                 prate.put("srate",srate);
357
                 //获取知识点的总分
357
                 //获取知识点的总分
358
                 Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
358
                 Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
359
                 Double srate = N_Utils.getDoubleDivideAndMulitiply(score,ePaper.getPscore());
359
                 Double srate = N_Utils.getDoubleDivideAndMulitiply(score,ePaper.getPscore());
360
-                Map prate = new HashMap();
360
+                Map prate = new TreeMap();
361
                 prate.put("pointid",entry.getKey());
361
                 prate.put("pointid",entry.getKey());
362
                 prate.put("pointname",pgblist.get(0).getName());
362
                 prate.put("pointname",pgblist.get(0).getName());
363
                 prate.put("score",score);
363
                 prate.put("score",score);
518
         QuestionOrderVo qtype = new QuestionOrderVo();
518
         QuestionOrderVo qtype = new QuestionOrderVo();
519
         qtype.setId(dq.getQtypeid());
519
         qtype.setId(dq.getQtypeid());
520
         qtype.setName(dq.getQtypename());
520
         qtype.setName(dq.getQtypename());
521
+        qtype.setComplexity(dq.getComplexity());
521
         qtype.setOrder(dq.getQorder());
522
         qtype.setOrder(dq.getQorder());
522
         qtype.setScore(dq.getScore());
523
         qtype.setScore(dq.getScore());
523
         qtype.setQlevel(dq.getQlevel());
524
         qtype.setQlevel(dq.getQlevel());
584
         double kscorerate = N_Utils.getDoubleReduce(100.0,zscorerate);
585
         double kscorerate = N_Utils.getDoubleReduce(100.0,zscorerate);
585
 
586
 
586
         List<Map> ranglist = new ArrayList<>();
587
         List<Map> ranglist = new ArrayList<>();
587
-        Map zgmap = new HashMap();
588
+        Map zgmap = new TreeMap();
588
         zgmap.put("qtname","主观题");
589
         zgmap.put("qtname","主观题");
589
         zgmap.put("score",zscore);
590
         zgmap.put("score",zscore);
590
         zgmap.put("num",znum);
591
         zgmap.put("num",znum);
591
         zgmap.put("srate",zscorerate);
592
         zgmap.put("srate",zscorerate);
592
         zgmap.put("nrate",znumrate);
593
         zgmap.put("nrate",znumrate);
593
         ranglist.add(zgmap);
594
         ranglist.add(zgmap);
594
-        Map kgmap = new HashMap();
595
+        Map kgmap = new TreeMap();
595
         kgmap.put("qtname","客观题");
596
         kgmap.put("qtname","客观题");
596
         kgmap.put("score",kscore);
597
         kgmap.put("score",kscore);
597
         kgmap.put("num",knum);
598
         kgmap.put("num",knum);
599
         kgmap.put("nrate",knumrate);
600
         kgmap.put("nrate",knumrate);
600
         ranglist.add(kgmap);
601
         ranglist.add(kgmap);
601
 
602
 
602
-        Map ztmap = new HashMap<>();
603
+        Map ztmap = new TreeMap<>();
603
         ztmap.put("pnum", ePaper.getPnum());
604
         ztmap.put("pnum", ePaper.getPnum());
604
         ztmap.put("pscore",ePaper.getPscore());
605
         ztmap.put("pscore",ePaper.getPscore());
605
         ztmap.put("ranglist",ranglist);
606
         ztmap.put("ranglist",ranglist);
618
             List<Integer> orderlist = new ArrayList<>();
619
             List<Integer> orderlist = new ArrayList<>();
619
             List<Integer> eptqidlist = new ArrayList<>();
620
             List<Integer> eptqidlist = new ArrayList<>();
620
             List<String> qnlist = new ArrayList<>();
621
             List<String> qnlist = new ArrayList<>();
621
-
622
+            List<Double> scorelist = new ArrayList<>();
623
+            List<String> qnamelist = new ArrayList<>();
622
             for(EPaperQtype t : aq){
624
             for(EPaperQtype t : aq){
623
                 List<EPaperQtypeQuestion> qlist = t.getQuestions();
625
                 List<EPaperQtypeQuestion> qlist = t.getQuestions();
624
                 for(EPaperQtypeQuestion q : qlist){
626
                 for(EPaperQtypeQuestion q : qlist){
625
                     orderlist.add(q.getQorder());
627
                     orderlist.add(q.getQorder());
626
                     eptqidlist.add(q.getId());
628
                     eptqidlist.add(q.getId());
627
                     qnlist.add(q.getQn());
629
                     qnlist.add(q.getQn());
630
+                    scorelist.add(q.getScore());
631
+                    qnamelist.add(q.getQtypename());
628
                 }
632
                 }
629
             }
633
             }
630
 
634
 
631
-            Map anmap = new HashMap();//题型对应试题的id和基础信息
635
+            Map anmap = new TreeMap();//题型对应试题的id和基础信息
632
             anmap.put("orders",orderlist);
636
             anmap.put("orders",orderlist);
633
             anmap.put("eptqids",eptqidlist);
637
             anmap.put("eptqids",eptqidlist);
634
             anmap.put("qns",qnlist);
638
             anmap.put("qns",qnlist);
639
+            anmap.put("scores",scorelist);
640
+            anmap.put("qtypenames",qnamelist);
635
 
641
 
636
-            Map tmap = new HashMap();
642
+            Map tmap = new TreeMap();
637
             tmap.put("qtname",entry.getKey());
643
             tmap.put("qtname",entry.getKey());
638
             tmap.put("qtid",aq.get(0).getEptid());
644
             tmap.put("qtid",aq.get(0).getEptid());
639
             tmap.put("num",num);
645
             tmap.put("num",num);

+ 14
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

31
 import org.springframework.transaction.annotation.Transactional;
31
 import org.springframework.transaction.annotation.Transactional;
32
 
32
 
33
 import javax.annotation.Resource;
33
 import javax.annotation.Resource;
34
+import java.math.BigDecimal;
34
 import java.util.*;
35
 import java.util.*;
35
 import java.util.stream.Collectors;
36
 import java.util.stream.Collectors;
36
 
37
 
1749
             List<Integer> eptqids = (List<Integer>) ques.get("eptqids");//试卷中题型下试题id
1750
             List<Integer> eptqids = (List<Integer>) ques.get("eptqids");//试卷中题型下试题id
1750
             List<String> qns = (List<String>) ques.get("qns");//试卷中试题题号
1751
             List<String> qns = (List<String>) ques.get("qns");//试卷中试题题号
1751
             List<Integer> orders = (List<Integer>) ques.get("orders");//试卷中试题题号
1752
             List<Integer> orders = (List<Integer>) ques.get("orders");//试卷中试题题号
1753
+            List<String> qtypenames = (List<String>) ques.get("qtypenames");
1754
+            List<Object> scoresObj = (List<Object>) ques.get("scores");
1755
+            List<Double> scores  = scoresObj.stream().map((d) -> {
1756
+                return Double.valueOf(d + "");
1757
+            }).collect(Collectors.toList());
1752
 
1758
 
1753
             Double tgstuscore = 0.0;//题型下学生得分
1759
             Double tgstuscore = 0.0;//题型下学生得分
1754
             Double tgscore = 0.0;//题型下试题总分
1760
             Double tgscore = 0.0;//题型下试题总分
1789
                     ercq.setEptqid(eptqid);
1795
                     ercq.setEptqid(eptqid);
1790
                     ercq.setQn(qns.get(q));
1796
                     ercq.setQn(qns.get(q));
1791
                     ercq.setQorder(orders.get(q));
1797
                     ercq.setQorder(orders.get(q));
1798
+                    ercq.setScore(scores.get(q));
1799
+                    ercq.setQtypename(qtypenames.get(q));
1792
                     ercq.setClassscore(qcstuscore);
1800
                     ercq.setClassscore(qcstuscore);
1793
                     ercq.setClassmaxscore(qcmaxstu.getStuscore());
1801
                     ercq.setClassmaxscore(qcmaxstu.getStuscore());
1794
                     ercq.setClassavgscore(qcavgscore);
1802
                     ercq.setClassavgscore(qcavgscore);
1904
                 String order = quesmap.get("order").toString();//试题母题题号
1912
                 String order = quesmap.get("order").toString();//试题母题题号
1905
                 String questionid = quesmap.get("questionid").toString();
1913
                 String questionid = quesmap.get("questionid").toString();
1906
                 List<String> qnslist = (List<String>) quesmap.get("qns");
1914
                 List<String> qnslist = (List<String>) quesmap.get("qns");
1915
+                String quesname = quesmap.get("name").toString();
1916
+                Integer complexity = Integer.parseInt(quesmap.get("complexity").toString());
1917
+                Double quesscore = Double.parseDouble(quesmap.get("score").toString());
1907
                 qns = qns + order + ",";
1918
                 qns = qns + order + ",";
1908
 
1919
 
1909
                 //获取集合中对应子题集合的数据
1920
                 //获取集合中对应子题集合的数据
1999
                     ercq.setEpid(examPaperClassVo.getEpid());
2010
                     ercq.setEpid(examPaperClassVo.getEpid());
2000
                     ercq.setEptqid(eptqid);
2011
                     ercq.setEptqid(eptqid);
2001
                     ercq.setQuestionid(questionid);
2012
                     ercq.setQuestionid(questionid);
2013
+                    ercq.setQtypename(quesname);
2014
+                    ercq.setComplexity(complexity);
2015
+                    ercq.setScore(quesscore);
2002
                     ercq.setQn(String.join(",", qnslist));
2016
                     ercq.setQn(String.join(",", qnslist));
2003
                     ercq.setQorder(Integer.parseInt(order));
2017
                     ercq.setQorder(Integer.parseInt(order));
2004
                     ercq.setClassscore(qcstuscore);
2018
                     ercq.setClassscore(qcstuscore);

+ 16
- 9
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

156
      * @Date 2022/8/25 16:54
156
      * @Date 2022/8/25 16:54
157
      **/
157
      **/
158
     public List<Map> listSubjectQuestions(Integer examid, Integer studentid, String subjectid) {
158
     public List<Map> listSubjectQuestions(Integer examid, Integer studentid, String subjectid) {
159
-        List<Map> list = eRstudentMapper.listSubjectQuestions(examid, studentid, subjectid);
160
-        Double paperscore = list.stream().mapToDouble(s -> Double.parseDouble(s.get("qscore").toString())).sum();
161
-        for (Map m : list) {
162
-            Double stuscore = Double.parseDouble(m.get("stuscore").toString());
163
-            Double qscore = Double.parseDouble(m.get("qscore").toString());
164
-            Double stusrate = N_Utils.getDoubleDivideAndMulitiply(stuscore, qscore);
165
-            m.put("stusrate", stusrate);
166
-            Double srate = N_Utils.getDoubleDivideAndMulitiply(qscore, paperscore);
167
-            m.put("srate", srate);
159
+        Map map = ePaperMapper.getPaperByExamidAndSubjectid(examid, subjectid);
160
+        Integer ptype = Integer.parseInt(map.get("ptype").toString());
161
+        List<Map> list = new ArrayList<>();
162
+        if(ptype == 1){
163
+
164
+        }else{
165
+            list = eRstudentMapper.listSubjectQuestions(examid, studentid, subjectid);
166
+            Double paperscore = list.stream().mapToDouble(s -> Double.parseDouble(s.get("qscore").toString())).sum();
167
+            for (Map m : list) {
168
+                Double stuscore = Double.parseDouble(m.get("stuscore").toString());
169
+                Double qscore = Double.parseDouble(m.get("qscore").toString());
170
+                Double stusrate = N_Utils.getDoubleDivideAndMulitiply(stuscore, qscore);
171
+                m.put("stusrate", stusrate);
172
+                Double srate = N_Utils.getDoubleDivideAndMulitiply(qscore, paperscore);
173
+                m.put("srate", srate);
174
+            }
168
         }
175
         }
169
         return list;
176
         return list;
170
     }
177
     }

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

14
 
14
 
15
     private String name;
15
     private String name;
16
 
16
 
17
+    private Integer complexity;
18
+
17
     //试题类型1单题2母题
19
     //试题类型1单题2母题
18
     private Integer qlevel;
20
     private Integer qlevel;
19
 
21
 

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

18
 
18
 
19
     @Test
19
     @Test
20
     void contextLoads() {
20
     void contextLoads() {
21
-//        eReportGenerateService.saveClassQuestions(2);
21
+        eReportGenerateService.saveClassQuestions(2);
22
 //        EPaper epaper = new EPaper();
22
 //        EPaper epaper = new EPaper();
23
 //        epaper.setEpid(6);
23
 //        epaper.setEpid(6);
24
 //        epaper.setPnum(12);
24
 //        epaper.setPnum(12);

Loading…
Cancel
Save