Browse Source

高频错题和作业报告

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

+ 4
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java View File

109
             //知识点
109
             //知识点
110
             setQuestionPoint(ct);
110
             setQuestionPoint(ct);
111
 
111
 
112
+            Integer ctype = Integer.parseInt(ct.get("ctype").toString());
113
+            if(!N_Utils.isObjectiveQuestion(ctype)){
114
+                ct.put("answer","[]");
115
+            }
112
             ct.remove("answerjson");
116
             ct.remove("answerjson");
113
             ct.remove("ctype");
117
             ct.remove("ctype");
114
-            ct.remove("answer");
115
             ct.remove("pointjson");
118
             ct.remove("pointjson");
116
         }
119
         }
117
         return gpctList;
120
         return gpctList;

+ 1
- 1
sexam/src/main/resources/mapper/report/ERclassMapper.xml View File

78
     <!--班级报告-单科概况-高频错题-->
78
     <!--班级报告-单科概况-高频错题-->
79
     <select id="listGpCt" resultType="java.util.Map">
79
     <select id="listGpCt" resultType="java.util.Map">
80
         select erq.eptqid,erq.qn,erq.classsrate,erq.gradesrate,erq.answerjson,erq.erroroption
80
         select erq.eptqid,erq.qn,erq.classsrate,erq.gradesrate,erq.answerjson,erq.erroroption
81
-        ,epq.eptname,epq.ctype,epqq.answer,epa.pointjson
81
+        ,epq.eptname,epqq.answer,epqq.ctype,epa.pointjson
82
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.epid = epqq.epid and erq.qorder=epqq.qorder
82
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.epid = epqq.epid and erq.qorder=epqq.qorder
83
         left join e_paper_qtype epq on epqq.eptid = epq.eptid
83
         left join e_paper_qtype epq on epqq.eptid = epq.eptid
84
         left join e_paper_analyze epa on erq.epid = epa.epid
84
         left join e_paper_analyze epa on erq.epid = epa.epid

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

84
         return new ResultVo(0,"获取已提交学生列表成功",list);
84
         return new ResultVo(0,"获取已提交学生列表成功",list);
85
     }
85
     }
86
 
86
 
87
+    //
87
     @PostMapping("/student_scantron")
88
     @PostMapping("/student_scantron")
88
     public ResultVo studentScantron(@RequestBody PStudentVo paper) {
89
     public ResultVo studentScantron(@RequestBody PStudentVo paper) {
89
         Integer psid = paper.getPsid();
90
         Integer psid = paper.getPsid();
102
         return new ResultVo(0,"获取学生答题卡单题详情成功",question);
103
         return new ResultVo(0,"获取学生答题卡单题详情成功",question);
103
     }
104
     }
104
 
105
 
106
+    //作业统计单题统计
105
     @PostMapping("/question_detail")
107
     @PostMapping("/question_detail")
106
     public ResultVo questionDetail(@RequestBody TQuestionClass question) {
108
     public ResultVo questionDetail(@RequestBody TQuestionClass question) {
107
         Long paperid = question.getPaperid();
109
         Long paperid = question.getPaperid();

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

88
      * @Author ywx
88
      * @Author ywx
89
      * @Date 2020/10/15 11:11
89
      * @Date 2020/10/15 11:11
90
      **/
90
      **/
91
-    PQuestionVo getQuestionDetail(@Param("question") TQuestionClass question);
91
+    List<PQuestionVo> getQuestionDetail(@Param("question") TQuestionClass question);
92
 
92
 
93
     //未布置作业列表
93
     //未布置作业列表
94
     List<PaperTeacherAppVo> listWbz(@Param("paper") PaperSearchVo paperSearch);
94
     List<PaperTeacherAppVo> listWbz(@Param("paper") PaperSearchVo paperSearch);

+ 39
- 10
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperTeaAppService.java View File

4
 import com.xhkjedu.sstudy.mapper.paper.PaperTeaAppMapper;
4
 import com.xhkjedu.sstudy.mapper.paper.PaperTeaAppMapper;
5
 import com.xhkjedu.sstudy.model.paper.TPaper;
5
 import com.xhkjedu.sstudy.model.paper.TPaper;
6
 import com.xhkjedu.sstudy.model.question.TQuestionClass;
6
 import com.xhkjedu.sstudy.model.question.TQuestionClass;
7
-import com.xhkjedu.sstudy.vo.paper.PClassVo;
8
-import com.xhkjedu.sstudy.vo.paper.PQuestionVo;
9
-import com.xhkjedu.sstudy.vo.paper.PStudentVo;
10
-import com.xhkjedu.sstudy.vo.paper.PaperTeacherAppVo;
11
-import com.xhkjedu.sstudy.vo.paper.PaperTeacherReportVo;
7
+import com.xhkjedu.sstudy.vo.paper.*;
12
 import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
8
 import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
13
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
9
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
14
 import com.xhkjedu.sstudy.vo.paperstudent.StudentVo;
10
 import com.xhkjedu.sstudy.vo.paperstudent.StudentVo;
17
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
18
 
14
 
19
 import javax.annotation.Resource;
15
 import javax.annotation.Resource;
20
-import java.util.HashMap;
21
-import java.util.IntSummaryStatistics;
22
-import java.util.List;
23
-import java.util.Map;
16
+import java.util.*;
24
 import java.util.stream.Collectors;
17
 import java.util.stream.Collectors;
25
 
18
 
26
 /**
19
 /**
174
      * @return com.xhkjedu.vo.teacherapp.PQuestionVo
167
      * @return com.xhkjedu.vo.teacherapp.PQuestionVo
175
      **/
168
      **/
176
     public PQuestionVo getQuestionDetail(TQuestionClass question) {
169
     public PQuestionVo getQuestionDetail(TQuestionClass question) {
177
-        PQuestionVo q = paperTeaAppMapper.getQuestionDetail(question);
170
+        List<PQuestionVo> qlist = paperTeaAppMapper.getQuestionDetail(question);
171
+        PQuestionVo q = new PQuestionVo();
172
+        if(qlist.size() == 1){
173
+            q = qlist.get(0);
174
+        }else{
175
+            //说明该题是复合题
176
+            List<PStudentVo> mstulist = new ArrayList<>();
177
+            double mqscore  = 0;
178
+            String qtypename = "";
179
+            for(int i=0;i<qlist.size();i++ ){
180
+                PQuestionVo sqvo = qlist.get(i);
181
+                mqscore = N_Utils.getDoubleSum(mqscore,sqvo.getQscore());
182
+                List<PStudentVo> sstulist = sqvo.getStudents();
183
+                if(i==0){
184
+                    qtypename = sqvo.getMqtypename();
185
+                    mstulist.addAll(sstulist);
186
+                }else{
187
+                    for(PStudentVo pstuvo : sstulist){
188
+                        PStudentVo mstuvo = mstulist.stream().filter(s -> s.getStudentid().equals(pstuvo.getStudentid())).findFirst().orElse(null);
189
+                        if(mstuvo == null){
190
+                            //说明还没有改学生
191
+                            mstulist.add(pstuvo);
192
+                        }else{
193
+                            double sstuscore = N_Utils.getDoubleSum(mstuvo.getScorerate(),pstuvo.getScorerate());
194
+                            mstuvo.setScorerate(sstuscore);
195
+                            if(pstuvo.getPschecked() == 1){
196
+                                mstuvo.setPschecked(1);
197
+                            }
198
+                        }
199
+                    }
200
+                }
201
+            }
202
+            q.setQtypename(qtypename);
203
+            q.setStudents(mstulist);
204
+            q.setQscore(mqscore);
205
+        }
206
+
178
         Double qscore = q.getQscore();
207
         Double qscore = q.getQscore();
179
         List<PStudentVo> students = q.getStudents();
208
         List<PStudentVo> students = q.getStudents();
180
         double stuscore = students.stream().collect(Collectors.summingDouble(PStudentVo::getScorerate));
209
         double stuscore = students.stream().collect(Collectors.summingDouble(PStudentVo::getScorerate));

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PQuestionVo.java View File

15
     //题型名称
15
     //题型名称
16
     private String qtypename;
16
     private String qtypename;
17
 
17
 
18
+    //母题题型名称
19
+    private String mqtypename;
20
+
18
     //试题分值
21
     //试题分值
19
     private Double qscore;
22
     private Double qscore;
20
 
23
 

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

18
     //作业学生id
18
     //作业学生id
19
     private Integer psid;
19
     private Integer psid;
20
 
20
 
21
+    private Integer studentid;
22
+
21
     //学生姓名
23
     //学生姓名
22
     private String studentname;
24
     private String studentname;
23
 
25
 

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperTeacherReportVo.java View File

10
     //试题序号
10
     //试题序号
11
     private Integer qorder;
11
     private Integer qorder;
12
 
12
 
13
+    //题号
14
+    private String qn;
15
+
13
     //正确率
16
     //正确率
14
     private double correctrate;
17
     private double correctrate;
15
 
18
 

+ 38
- 2
sstudy/src/main/resources/mapper/paper/PaperTeaAppMapper.xml View File

120
         <result property="userscore" column="userscore"></result>
120
         <result property="userscore" column="userscore"></result>
121
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.paper.PaperTeacherReportVo">
121
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.paper.PaperTeacherReportVo">
122
             <result property="qorder" column="qorder"></result>
122
             <result property="qorder" column="qorder"></result>
123
+            <result property="qn" column="qn"></result>
123
             <result property="correctrate" column="correctrate"></result>
124
             <result property="correctrate" column="correctrate"></result>
124
             <result property="ctype" column="ctype"></result>
125
             <result property="ctype" column="ctype"></result>
125
         </collection>
126
         </collection>
126
     </resultMap>
127
     </resultMap>
127
     <select id="getStudentScantron" resultMap="scantronResult">
128
     <select id="getStudentScantron" resultMap="scantronResult">
128
         select p.papername,ps.papernum,truncate(ps.userscore*100/ps.paperscore,2)scorerate,#{paper.papertype} papertype
129
         select p.papername,ps.papernum,truncate(ps.userscore*100/ps.paperscore,2)scorerate,#{paper.papertype} papertype
129
-        ,ps.psid,ps.stoptime,ps.costtime,q.qorder,truncate(q.stuscore*100/q.qscore,2)correctrate,tq.ctype
130
+        ,ps.psid,ps.stoptime,ps.costtime,q.qorder,q.qn,truncate(q.stuscore*100/q.qscore,2)correctrate,tq.ctype
130
         ,(select count(*)+1 from t_paper_student ps1
131
         ,(select count(*)+1 from t_paper_student ps1
131
         where ps1.paperid=ps.paperid and ps1.userscore>ps.userscore)rank,ps.paperscore,ps.userscore
132
         where ps1.paperid=ps.paperid and ps1.userscore>ps.userscore)rank,ps.paperscore,ps.userscore
132
         from t_paper_student ps left join t_paper p on ps.paperid = p.paperid
133
         from t_paper_student ps left join t_paper p on ps.paperid = p.paperid
157
         <result property="qscore" column="qscore"></result>
158
         <result property="qscore" column="qscore"></result>
158
         <result property="avgtime" column="avgtime"></result>
159
         <result property="avgtime" column="avgtime"></result>
159
         <result property="mintime" column="mintime"></result>
160
         <result property="mintime" column="mintime"></result>
161
+        <result property="mqtypename" column="mqtypename"></result>
160
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paper.PStudentVo">
162
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paper.PStudentVo">
163
+            <result property="studentid" column="studentid"></result>
161
             <result property="studentname" column="studentname"></result>
164
             <result property="studentname" column="studentname"></result>
162
             <result property="stoptime" column="answertime"></result>
165
             <result property="stoptime" column="answertime"></result>
163
             <result property="costtime" column="costtime"></result>
166
             <result property="costtime" column="costtime"></result>
167
     </resultMap>
170
     </resultMap>
168
     <!--20220421修改获取提交作业的学生未基准-->
171
     <!--20220421修改获取提交作业的学生未基准-->
169
     <select id="getQuestionDetail" resultMap="questionDetailResult">
172
     <select id="getQuestionDetail" resultMap="questionDetailResult">
170
-        select tq.qtypename,q.qscore,q.answertime,q.costtime,q.stuscore,q.answered,u.username studentname
173
+        select tq.qtypename,q.qscore,q.answertime,q.costtime,q.stuscore,q.answered,q.studentid,u.username studentname
171
         <if test="question.qctype==1 or question.qctype==3">
174
         <if test="question.qctype==1 or question.qctype==3">
175
+            ,mq.qtypename mqtypename
172
             from t_paper_student_question q left join t_question tq on q.questionid=tq.questionid
176
             from t_paper_student_question q left join t_question tq on q.questionid=tq.questionid
177
+            left join t_question mq on tq.questionpid=mq.questionid
173
         </if>
178
         </if>
174
         <if test="question.qctype==2">
179
         <if test="question.qctype==2">
175
             from t_paper_student_scantron q left join t_paper_scantron tq on q.pscaid=tq.pscaid
180
             from t_paper_student_scantron q left join t_paper_scantron tq on q.pscaid=tq.pscaid
179
         where q.paperid=#{question.paperid} and q.qorder=#{question.qorder} and q.classid=#{question.classid} and ps.psstate>0
184
         where q.paperid=#{question.paperid} and q.qorder=#{question.qorder} and q.classid=#{question.classid} and ps.psstate>0
180
         order by q.stuscore desc,convert(u.username using gbk)
185
         order by q.stuscore desc,convert(u.username using gbk)
181
     </select>
186
     </select>
187
+
188
+    <!--<resultMap id="questionDetailResult" type="java.util.Map">
189
+        <result property="qtypename" column="qtypename"></result>
190
+        <result property="qscore" column="qscore"></result>
191
+        <result property="mqtypename" column="mqtypename"></result>
192
+        <collection property="students" ofType="java.util.Map" javaType="java.util.List">
193
+            <result property="studentid" column="studentid"></result>
194
+            <result property="studentname" column="studentname"></result>
195
+            <result property="stoptime" column="answertime"></result>
196
+            <result property="costtime" column="costtime"></result>
197
+            <result property="scorerate" column="stuscore"></result>
198
+            <result property="pschecked" column="answered"></result>
199
+        </collection>
200
+    </resultMap>
201
+    &lt;!&ndash;20220421修改获取提交作业的学生未基准&ndash;&gt;
202
+    <select id="getQuestionDetail" resultMap="questionDetailResult">
203
+        select tq.qtypename,q.qscore,q.studentid,q.answertime,q.costtime,q.stuscore,q.answered,u.username studentname
204
+        <if test="question.qctype==1 or question.qctype==3">
205
+            ,mq.qtypename mqtypename
206
+            from t_paper_student_question q left join t_question tq on q.questionid=tq.questionid
207
+            left join t_question mq on tq.questionid=mq.questionid
208
+        </if>
209
+        <if test="question.qctype==2">
210
+            from t_paper_student_scantron q left join t_paper_scantron tq on q.pscaid=tq.pscaid
211
+        </if>
212
+        left join t_user u on q.studentid=u.userid
213
+        left join t_paper_student ps on q.paperid=ps.paperid and q.studentid=ps.studentid
214
+        where q.paperid=#{question.paperid} and q.qorder=#{question.qorder} and q.classid=#{question.classid} and ps.psstate>0
215
+        order by q.stuscore desc,convert(u.username using gbk)
216
+    </select>-->
217
+
182
     <!--作业发布的人数-->
218
     <!--作业发布的人数-->
183
     <select id="getPaperstudentNum" resultType="java.lang.Integer">
219
     <select id="getPaperstudentNum" resultType="java.lang.Integer">
184
         select count(*) from t_paper_student where paperid=#{paperid} and classid=#{classid}
220
         select count(*) from t_paper_student where paperid=#{paperid} and classid=#{classid}

Loading…
Cancel
Save