Browse Source

作业按题统计

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

+ 2
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperAnalyzeController.java View File

84
     }
84
     }
85
 
85
 
86
     @PostMapping("/question_detail")
86
     @PostMapping("/question_detail")
87
-    public ResultVo questionDetailAnalyze(@RequestBody TPaperStudentQuestion paper){
87
+    public ResultVo questionDetailAnalyze(@RequestBody AnalyzeQuestionVo paper){
88
         Integer paperid = paper.getPaperid();
88
         Integer paperid = paper.getPaperid();
89
         String questionid = paper.getQuestionid();
89
         String questionid = paper.getQuestionid();
90
         Integer classid=paper.getClassid();
90
         Integer classid=paper.getClassid();
91
         N_Utils.validation(new Object[]{paperid,"作业id",1,questionid,"试题id",2,classid,"班级id",1});
91
         N_Utils.validation(new Object[]{paperid,"作业id",1,questionid,"试题id",2,classid,"班级id",1});
92
-        QuestionAnalyzeVo analyze = paperAnalyzeService.getQuestionDetailAnalyze(paperid, questionid,classid);
92
+        QuestionAnalyzeVo analyze = paperAnalyzeService.getQuestionDetailAnalyze(paper);
93
         return new ResultVo(0,"获取作业统计--按题详情成功",analyze);
93
         return new ResultVo(0,"获取作业统计--按题详情成功",analyze);
94
     }
94
     }
95
 
95
 

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperAnalyzeMapper.java View File

97
      * @Date 2020/6/24 15:37
97
      * @Date 2020/6/24 15:37
98
      * @return com.xhkjedu.vo.paper.QuestionAnalyzeVo
98
      * @return com.xhkjedu.vo.paper.QuestionAnalyzeVo
99
      **/
99
      **/
100
-    QuestionAnalyzeVo getQuestionDetailAnalyze(Integer paperid, String questionid, Integer classid);
100
+    QuestionAnalyzeVo getQuestionDetailAnalyze(@Param("question") AnalyzeQuestionVo question);
101
 
101
 
102
     //作业统计--按题详情--学生列表
102
     //作业统计--按题详情--学生列表
103
     List<AnalyzeStudentVo> listQuestionStu(Integer paperid, String questionid, Integer classid, Integer od);
103
     List<AnalyzeStudentVo> listQuestionStu(Integer paperid, String questionid, Integer classid, Integer od);

+ 13
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperAnalyzeService.java View File

3
 import com.xhkjedu.sstudy.mapper.gradeclass.ClassMapper;
3
 import com.xhkjedu.sstudy.mapper.gradeclass.ClassMapper;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
5
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
5
 import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
6
+import com.xhkjedu.sstudy.mapper.question.QuestionMapper;
6
 import com.xhkjedu.sstudy.mapper.subjectbook.SubjectMapper;
7
 import com.xhkjedu.sstudy.mapper.subjectbook.SubjectMapper;
7
 import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
8
 import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
8
 import com.xhkjedu.sstudy.model.paper.TPaper;
9
 import com.xhkjedu.sstudy.model.paper.TPaper;
40
     private SchoolMapper schoolMapper;
41
     private SchoolMapper schoolMapper;
41
     @Resource
42
     @Resource
42
     private SubjectMapper subjectMapper;
43
     private SubjectMapper subjectMapper;
44
+    @Resource
45
+    private QuestionMapper questionMapper;
43
 
46
 
44
     /**
47
     /**
45
      * 作业分析
48
      * 作业分析
133
      * @Date 2020/6/24 15:37
136
      * @Date 2020/6/24 15:37
134
      * @return com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo
137
      * @return com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo
135
      **/
138
      **/
136
-    public QuestionAnalyzeVo getQuestionDetailAnalyze(Integer paperid, String questionid,Integer classid) {
137
-        return paperAnalyzeMapper.getQuestionDetailAnalyze(paperid, questionid,classid);
139
+    public QuestionAnalyzeVo getQuestionDetailAnalyze(AnalyzeQuestionVo question) {
140
+        QuestionAnalyzeVo analyze = paperAnalyzeMapper.getQuestionDetailAnalyze(question);
141
+        String questionpid = question.getQuestionpid();
142
+        String questionid = question.getQuestionid();
143
+        if(N_Utils.isEmpty(questionpid)) question.setQuestionpid(questionid);
144
+        if (!questionpid.equals(questionid)) {
145
+            List<Map> sonqlist = questionMapper.listSonQuestionsForDetail(questionpid);
146
+            analyze.setSonqlist(sonqlist);
147
+        }
148
+        return analyze;
138
     }
149
     }
139
 
150
 
140
     //作业统计--按题详情--学生列表
151
     //作业统计--按题详情--学生列表

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/AnalyzeQuestionVo.java View File

53
 
53
 
54
     //学生人数
54
     //学生人数
55
     private Integer stunum;
55
     private Integer stunum;
56
+    private String questionpid;//复合题对应母题id
57
+    private String qns;//显示题号
56
 }
58
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/QuestionAnalyzeVo.java View File

4
 import lombok.Data;
4
 import lombok.Data;
5
 
5
 
6
 import java.util.List;
6
 import java.util.List;
7
+import java.util.Map;
7
 
8
 
8
 @Data
9
 @Data
9
 public class QuestionAnalyzeVo {
10
 public class QuestionAnalyzeVo {
36
 
37
 
37
     //知识点名称
38
     //知识点名称
38
     private String pointname;
39
     private String pointname;
40
+    private List<Map> sonqlist;//子题
39
 }
41
 }

+ 7
- 5
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml View File

84
     </select>
84
     </select>
85
     <!--作业统计按题-->
85
     <!--作业统计按题-->
86
     <select id="getQuestionAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeQuestionVo">
86
     <select id="getQuestionAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeQuestionVo">
87
-        select ptq.paperid,ptq.questionid,ptq.ptqorder,q.qtypename,ptq.ptqscore totalscore,q.qanswer,truncate(avg(psq.stuscore),2)avgscore
87
+        select ptq.paperid,ptq.questionid,ptq.ptqorder,ptq.questionpid
88
+        ,group_concat(distinct concat(ptq.qn,'_',ptq.questionid))qns
89
+        ,ptq.mqtypename qtypename,ptq.mscore totalscore,truncate(avg(psq.stuscore),2)avgscore
88
         ,truncate(avg(psq.costtime),2)avgtime,min(psq.costtime)mintime,count(ps.psid)stunum
90
         ,truncate(avg(psq.costtime),2)avgtime,min(psq.costtime)mintime,count(ps.psid)stunum
89
         ,truncate(sum(case when psq.answered=1 then 1 else 0 end)*100/count(ps.psid),2)commitrate
91
         ,truncate(sum(case when psq.answered=1 then 1 else 0 end)*100/count(ps.psid),2)commitrate
90
         ,truncate(SUM(IFNULL(psq.stuscore,0))*100/(ptq.ptqscore*count(ps.psid)),2)scorerate
92
         ,truncate(SUM(IFNULL(psq.stuscore,0))*100/(ptq.ptqscore*count(ps.psid)),2)scorerate
95
         <if test="papertype==3">
97
         <if test="papertype==3">
96
             and locate(concat('"',ptq.questionid,'"'),ps.questionids)>0
98
             and locate(concat('"',ptq.questionid,'"'),ps.questionids)>0
97
         </if>
99
         </if>
98
-        group by ptq.questionid order by ptq.ptqorder
100
+        group by ptq.ptqorder order by ptq.ptqorder
99
     </select>
101
     </select>
100
     <!--答题卡作业统计按题-->
102
     <!--答题卡作业统计按题-->
101
     <select id="getSQuestionAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeQuestionVo">
103
     <select id="getSQuestionAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeQuestionVo">
116
 
118
 
117
     <select id="getQuestionDetailAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo">
119
     <select id="getQuestionDetailAnalyze" resultType="com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo">
118
         select q.qtypename,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype
120
         select q.qtypename,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype
119
-        ,(select ptq.ptqscore from t_paper_qtype_question ptq
120
-        where ptq.paperid=#{paperid} and ptq.questionid=#{questionid}) score
121
+        ,(select ptq.mscore from t_paper_qtype_question ptq
122
+        where ptq.paperid=#{question.paperid} and ptq.questionpid=#{question.questionpid} limit 1) score
121
         ,(select group_concat(p.pointname separator '  ') from t_question_point qp
123
         ,(select group_concat(p.pointname separator '  ') from t_question_point qp
122
         left join t_point p on qp.pointid=p.pointid where qp.questionid=q.questionid)pointname
124
         left join t_point p on qp.pointid=p.pointid where qp.questionid=q.questionid)pointname
123
-        from t_question q where q.questionid=#{questionid}
125
+        from t_question q where q.questionid=#{question.questionpid}
124
     </select>
126
     </select>
125
     <!--作业统计-按题详情-学生列表-->
127
     <!--作业统计-按题详情-学生列表-->
126
     <select id="listQuestionStu" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeStudentVo">
128
     <select id="listQuestionStu" resultType="com.xhkjedu.sstudy.vo.paper.AnalyzeStudentVo">

Loading…
Cancel
Save