소스 검색

高频错题和作业报告

tags/正式版本
王宁 2 년 전
부모
커밋
cef4eb4b06

+ 4
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java 파일 보기

@@ -109,9 +109,12 @@ public class EReportClassService {
109 109
             //知识点
110 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 116
             ct.remove("answerjson");
113 117
             ct.remove("ctype");
114
-            ct.remove("answer");
115 118
             ct.remove("pointjson");
116 119
         }
117 120
         return gpctList;

+ 1
- 1
sexam/src/main/resources/mapper/report/ERclassMapper.xml 파일 보기

@@ -78,7 +78,7 @@
78 78
     <!--班级报告-单科概况-高频错题-->
79 79
     <select id="listGpCt" resultType="java.util.Map">
80 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 82
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.epid = epqq.epid and erq.qorder=epqq.qorder
83 83
         left join e_paper_qtype epq on epqq.eptid = epq.eptid
84 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 파일 보기

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

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperTeaAppMapper.java 파일 보기

@@ -88,7 +88,7 @@ public interface PaperTeaAppMapper extends TkMapper<TPaper> {
88 88
      * @Author ywx
89 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 94
     List<PaperTeacherAppVo> listWbz(@Param("paper") PaperSearchVo paperSearch);

+ 39
- 10
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperTeaAppService.java 파일 보기

@@ -4,11 +4,7 @@ import com.xhkjedu.sstudy.mapper.paper.PaperMapper;
4 4
 import com.xhkjedu.sstudy.mapper.paper.PaperTeaAppMapper;
5 5
 import com.xhkjedu.sstudy.model.paper.TPaper;
6 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 8
 import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
13 9
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
14 10
 import com.xhkjedu.sstudy.vo.paperstudent.StudentVo;
@@ -17,10 +13,7 @@ import lombok.extern.slf4j.Slf4j;
17 13
 import org.springframework.stereotype.Service;
18 14
 
19 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 17
 import java.util.stream.Collectors;
25 18
 
26 19
 /**
@@ -174,7 +167,43 @@ public class PaperTeaAppService {
174 167
      * @return com.xhkjedu.vo.teacherapp.PQuestionVo
175 168
      **/
176 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 207
         Double qscore = q.getQscore();
179 208
         List<PStudentVo> students = q.getStudents();
180 209
         double stuscore = students.stream().collect(Collectors.summingDouble(PStudentVo::getScorerate));

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PQuestionVo.java 파일 보기

@@ -15,6 +15,9 @@ public class PQuestionVo {
15 15
     //题型名称
16 16
     private String qtypename;
17 17
 
18
+    //母题题型名称
19
+    private String mqtypename;
20
+
18 21
     //试题分值
19 22
     private Double qscore;
20 23
 

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PStudentVo.java 파일 보기

@@ -18,6 +18,8 @@ public class PStudentVo {
18 18
     //作业学生id
19 19
     private Integer psid;
20 20
 
21
+    private Integer studentid;
22
+
21 23
     //学生姓名
22 24
     private String studentname;
23 25
 

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paper/PaperTeacherReportVo.java 파일 보기

@@ -10,6 +10,9 @@ public class PaperTeacherReportVo {
10 10
     //试题序号
11 11
     private Integer qorder;
12 12
 
13
+    //题号
14
+    private String qn;
15
+
13 16
     //正确率
14 17
     private double correctrate;
15 18
 

+ 38
- 2
sstudy/src/main/resources/mapper/paper/PaperTeaAppMapper.xml 파일 보기

@@ -120,13 +120,14 @@
120 120
         <result property="userscore" column="userscore"></result>
121 121
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.paper.PaperTeacherReportVo">
122 122
             <result property="qorder" column="qorder"></result>
123
+            <result property="qn" column="qn"></result>
123 124
             <result property="correctrate" column="correctrate"></result>
124 125
             <result property="ctype" column="ctype"></result>
125 126
         </collection>
126 127
     </resultMap>
127 128
     <select id="getStudentScantron" resultMap="scantronResult">
128 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 131
         ,(select count(*)+1 from t_paper_student ps1
131 132
         where ps1.paperid=ps.paperid and ps1.userscore>ps.userscore)rank,ps.paperscore,ps.userscore
132 133
         from t_paper_student ps left join t_paper p on ps.paperid = p.paperid
@@ -157,7 +158,9 @@
157 158
         <result property="qscore" column="qscore"></result>
158 159
         <result property="avgtime" column="avgtime"></result>
159 160
         <result property="mintime" column="mintime"></result>
161
+        <result property="mqtypename" column="mqtypename"></result>
160 162
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paper.PStudentVo">
163
+            <result property="studentid" column="studentid"></result>
161 164
             <result property="studentname" column="studentname"></result>
162 165
             <result property="stoptime" column="answertime"></result>
163 166
             <result property="costtime" column="costtime"></result>
@@ -167,9 +170,11 @@
167 170
     </resultMap>
168 171
     <!--20220421修改获取提交作业的学生未基准-->
169 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 174
         <if test="question.qctype==1 or question.qctype==3">
175
+            ,mq.qtypename mqtypename
172 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 178
         </if>
174 179
         <if test="question.qctype==2">
175 180
             from t_paper_student_scantron q left join t_paper_scantron tq on q.pscaid=tq.pscaid
@@ -179,6 +184,37 @@
179 184
         where q.paperid=#{question.paperid} and q.qorder=#{question.qorder} and q.classid=#{question.classid} and ps.psstate>0
180 185
         order by q.stuscore desc,convert(u.username using gbk)
181 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 219
     <select id="getPaperstudentNum" resultType="java.lang.Integer">
184 220
         select count(*) from t_paper_student where paperid=#{paperid} and classid=#{classid}

Loading…
취소
저장