浏览代码

完善试题模板、试卷详情

ywx
王宁 2 周前
父节点
当前提交
9536167f1d

+ 0
- 6
smarking/pom.xml 查看文件

@@ -32,12 +32,6 @@
32 32
             <version>3.17</version>
33 33
         </dependency>
34 34
 
35
-        <dependency>
36
-            <groupId>commons-beanutils</groupId>
37
-            <artifactId>commons-beanutils</artifactId>
38
-            <version>1.9.4</version>
39
-        </dependency>
40
-
41 35
     </dependencies>
42 36
     <dependencyManagement>
43 37
         <dependencies>

+ 1
- 2
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsTemplateController.java 查看文件

@@ -50,8 +50,7 @@ public class MsTemplateController {
50 50
     @PostMapping("/save")
51 51
     public ResultVo save(@RequestBody MsTemplate msTemplate) {
52 52
         N_Utils.validation(new Object[]{msTemplate.getMpid(),"试卷id",1});
53
-        MsTemplate mt = msTemplateService.save(msTemplate);
54
-        return new ResultVo(0, "保存成功",mt);
53
+        return new ResultVo(0, "保存成功",msTemplateService.save(msTemplate));
55 54
     }
56 55
 
57 56
     /*

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsTemplate.java 查看文件

@@ -21,7 +21,7 @@ public class MsTemplate extends BaseBean {
21 21
     private Integer mtid;
22 22
     //试卷ID
23 23
     private Integer mpid;
24
-    //模板尺寸1A3 2A4
24
+    //模板尺寸1A4 2A3
25 25
     private Integer tsize;
26 26
     //正面图片
27 27
     private String tfront;

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestion.java 查看文件

@@ -5,6 +5,7 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8 9
 
9 10
 /**
10 11
  * @Description 阅卷报告-班级试题小题分析表
@@ -89,4 +90,7 @@ public class MsrClassQuestion extends BaseBean {
89 90
     private String mfids;
90 91
     //满分人数占比
91 92
     private Double mfrate;
93
+
94
+    @Transient
95
+    private String classname;
92 96
 }

+ 53
- 11
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java 查看文件

@@ -1115,23 +1115,13 @@ public class MsPaperQtypeService {
1115 1115
         if (ptype == 1) {
1116 1116
             // 题库
1117 1117
             qtypelist = msPaperQtypeMapper.listPaperQtypeQuestions(mpid);
1118
-            for (MsPaperQtypeVo qtype : qtypelist) {
1119
-                List<MsPaperQtypeQuestionVo> questions = qtype.getQuestions();
1120
-                for (MsPaperQtypeQuestionVo question : questions) {
1121
-                    if(N_Utils.isNotEmpty(question.getAnswer())){
1122
-                        //如果试卷已有答案,把试卷中设置的答案返回
1123
-                        question.setQanswer(question.getAnswer());
1124
-                    }
1125
-
1126
-                }
1127
-            }
1118
+            setPaperQuestionQtypeQuesitonTk(qtypelist);
1128 1119
             paper.put("qtypes", qtypelist);
1129 1120
         } else {
1130 1121
             // 附件
1131 1122
             qtypelist = msPaperQtypeMapper.listPaperQtypeQuesitonsForFj(mpid);
1132 1123
             List<Map<String, Object>> qtypes = new ArrayList<>();
1133 1124
             setPaperQuestionQtypeQuesitonFj(qtypelist, qtypes);
1134
-
1135 1125
             paper.put("qtypes", qtypes);
1136 1126
 
1137 1127
             // 试卷文件
@@ -1146,6 +1136,58 @@ public class MsPaperQtypeService {
1146 1136
         return paper;
1147 1137
     }
1148 1138
 
1139
+
1140
+    private void setPaperQuestionQtypeQuesitonTk(List<MsPaperQtypeVo> typelist){
1141
+        for(MsPaperQtypeVo qt : typelist){
1142
+            List<MsPaperQtypeQuestionVo> qlist = qt.getQuestions();
1143
+            List<MsPaperQtypeQuestionVo> rtnqlist = new ArrayList<>();//保存处理后的试题
1144
+            String qpid = "";//母题id
1145
+            List<MsPaperQtypeQuestionVo> sonqlist = new ArrayList<>();
1146
+            for(MsPaperQtypeQuestionVo q : qlist){
1147
+                //试题类型1单题2母题3子题
1148
+                if(q.getQlevel() == 3){
1149
+                    if(!q.getQuestionpid().equals(qpid)){
1150
+                        sonqlist = qlist.stream().filter(o -> q.getQlevel()==3 && q.getQuestionpid().equals(o.getQuestionpid())).collect(Collectors.toList());
1151
+                        MsPaperQtypeQuestionVo mq = new MsPaperQtypeQuestionVo();
1152
+                        mq.setQuestionid(q.getQuestionpid());
1153
+                        mq.setCtype(q.getMctype());
1154
+                        mq.setQtypeid(q.getMqtypeid());
1155
+                        mq.setQtypename(q.getMqtypename());
1156
+                        mq.setQstem(q.getMqstem());
1157
+                        mq.setComplexity(q.getMcomplexity());
1158
+                        mq.setQanalyze(q.getMqanalyze());
1159
+                        mq.setQanswer(q.getMqanswer());
1160
+                        mq.setQorder(q.getQorder());
1161
+                        mq.setQlevel(q.getMqlevel());
1162
+                        mq.setHashear(q.getMhashear());
1163
+                        mq.setHearfile(q.getMhearfile());
1164
+                        Double mscore = sonqlist.stream().collect(Collectors.summingDouble(MsPaperQtypeQuestionVo:: getQscore));
1165
+                        mq.setQscore(mscore);
1166
+
1167
+                        for(MsPaperQtypeQuestionVo sonQ : sonqlist){
1168
+                            if(N_Utils.isNotEmpty(sonQ.getAnswer())){
1169
+                                //如果试卷已有答案,把试卷中设置的答案返回
1170
+                                sonQ.setQanswer(sonQ.getAnswer());
1171
+                            }
1172
+                        }
1173
+
1174
+                        mq.setSonques(sonqlist);
1175
+                        mq.setPoints(sonqlist.get(0).getPoints());
1176
+                        rtnqlist.add(mq);
1177
+                    }
1178
+                    qpid = q.getQuestionpid();
1179
+                }else{
1180
+                    if(N_Utils.isNotEmpty(q.getAnswer())){
1181
+                        //如果试卷已有答案,把试卷中设置的答案返回
1182
+                        q.setQanswer(q.getAnswer());
1183
+                    }
1184
+                    rtnqlist.add(q);
1185
+                }
1186
+            }
1187
+            qt.setQuestions(rtnqlist);
1188
+        }
1189
+    }
1190
+
1149 1191
     // 试卷详情-附件-设置返回值
1150 1192
     private void setPaperQuestionQtypeQuesitonFj(List<MsPaperQtypeVo> qtypelist, List<Map<String, Object>> qtypes) {
1151 1193
         for (MsPaperQtypeVo qtypeVo : qtypelist) {

+ 6
- 12
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsTemplateService.java 查看文件

@@ -83,7 +83,7 @@ public class MsTemplateService {
83 83
      * @return void
84 84
      **/
85 85
     @Transactional(rollbackFor = Exception.class)
86
-    public MsTemplate save(MsTemplate msTemplate){
86
+    public Integer save(MsTemplate msTemplate){
87 87
         msTemplate.setCreatetime(N_Utils.getSecondTimestamp());
88 88
         msTemplate.setCurrstep(1);
89 89
         msTemplate.setTstate(0);
@@ -107,7 +107,7 @@ public class MsTemplateService {
107 107
 
108 108
         //更新科目模板状态
109 109
         msSubjectMapper.updatePtstateByMpid(msTemplate.getMpid(),1);
110
-        return msTemplate;
110
+        return mtid;
111 111
     }
112 112
 
113 113
     /*
@@ -179,7 +179,7 @@ public class MsTemplateService {
179 179
             //包含的试题信息
180 180
             List<MsPaperQtypeQuestion> selQuestions = questions.stream().filter(q -> tbqns.contains(q.getQn())).collect(Collectors.toList());
181 181
             if(selQuestions.isEmpty() || selQuestions.size() != tbquestions.size()){
182
-                throw new RuntimeException("试题信息和试卷不匹配");
182
+                throw new MissingParametersException("试题信息和试卷不匹配");
183 183
             }
184 184
 
185 185
             Double tbqScores = selQuestions.stream().mapToDouble(MsPaperQtypeQuestion::getQscore).sum();//题块下试题总分值
@@ -210,7 +210,7 @@ public class MsTemplateService {
210 210
             for(MsTemplateBlockQuestion tbquestion : tbquestions) {
211 211
                 MsPaperQtypeQuestion q = selQuestions.stream().filter(q1 -> q1.getQn().equals(tbquestion.getQn())).findFirst().orElse(null);
212 212
 
213
-                if(q == null) throw new RuntimeException("试题信息和试卷不匹配");
213
+                if(q == null) throw new MissingParametersException("试题信息和试卷不匹配");
214 214
 
215 215
                 tbquestion.setMtbid(mtbid);
216 216
                 tbquestion.setMptqid(q.getMptqid());
@@ -396,14 +396,8 @@ public class MsTemplateService {
396 396
         MsTemplate msTemplate = msTemplateMapper.selectByPrimaryKey(mtid);
397 397
         int mpid = msTemplate.getMpid();
398 398
         msTemplateMapper.deleteByPrimaryKey(mtid);
399
-        //获取试卷中所有模板题块框选状态
400
-        int tbnum = msTemplateMapper.getUnSelTemplateCount(mpid);
401
-        if(tbnum == 0){
402
-            //更改科目题块框选状态已完成
403
-            msSubjectMapper.updatePbstateByMpid(mpid,2);
404
-            //保存学生试卷试题信息
405
-            savePaperStudentBlock(mpid);
406
-        }
399
+        //更改科目题块框选状态未设置
400
+        msSubjectMapper.updatePbstateByMpid(mpid,0);
407 401
     }
408 402
 
409 403
     /*

+ 6
- 7
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGeneratePointService.java 查看文件

@@ -24,7 +24,7 @@ import com.xhkjedu.smarking.vo.report.reportsubject.PointLevelVo;
24 24
 import com.xhkjedu.smarking.vo.report.reportsubject.PointParams;
25 25
 import com.xhkjedu.smarking.vo.report.reportsubject.PointVo;
26 26
 import com.xhkjedu.utils.N_Utils;
27
-import org.apache.commons.beanutils.BeanUtils;
27
+import org.springframework.beans.BeanUtils;
28 28
 import org.springframework.stereotype.Service;
29 29
 
30 30
 import javax.annotation.Resource;
@@ -239,9 +239,9 @@ public class ReportGeneratePointService {
239 239
         classPoint.setFullscore(subjectPoint.getFullscore());
240 240
         classPoint.setMaxscore(pointStuScores.stream().mapToDouble(PointStudentVo::getStuscore).max().orElse(0.0));
241 241
         classPoint.setMinscore(pointStuScores.stream().mapToDouble(PointStudentVo::getStuscore).min().orElse(0.0));
242
-        classPoint.setScorerate(MarkingUtil.calculateRate(sumScore, subjectPoint.getFullscore() * stuNum));
242
+        classPoint.setScorerate(MarkingUtil.div(sumScore, subjectPoint.getFullscore() * stuNum));
243 243
         classPoint.setAvgscore(MarkingUtil.div(sumScore, stuNum));
244
-        classPoint.setAvgrate(MarkingUtil.calculateRate(classPoint.getAvgscore(), subjectPoint.getFullscore()));
244
+        classPoint.setAvgrate(MarkingUtil.div(classPoint.getAvgscore(), subjectPoint.getFullscore()));
245 245
         classPoint.setBzc(MarkingUtil.bzc(stuScores));
246 246
         classPoint.setCyxs(MarkingUtil.div(classPoint.getBzc(), classPoint.getAvgscore()));
247 247
         classPoint.setQfd(MarkingUtil.qfd(stuScores));
@@ -298,8 +298,7 @@ public class ReportGeneratePointService {
298 298
                 // 获取平均分
299 299
                 double avgScore = MarkingUtil.div(sumScore, stuNum);
300 300
                 // 获取平均得分率
301
-                double avgScoreRate = MarkingUtil.calculateRate(avgScore, pointParams.getFullscore());
302
-                sps.setAvgrate(avgScoreRate);
301
+                sps.setAvgrate(MarkingUtil.div(avgScore, pointParams.getFullscore()));
303 302
                 sps.setAvgscore(avgScore);
304 303
             }else{
305 304
                 sps.setAvgrate(0.0);
@@ -571,7 +570,7 @@ public class ReportGeneratePointService {
571 570
             double schoolSumScore = pointStuScores.stream().mapToDouble(PointStudentVo::getStuscore).sum();
572 571
             int stunum = pointStuScores.size();
573 572
             double schoolAvgScore = MarkingUtil.div(schoolSumScore, stunum);
574
-            double schoolScoreRate = MarkingUtil.calculateRate(schoolSumScore, pqvo.getScore() * stunum);
573
+            double schoolScoreRate = MarkingUtil.div(schoolSumScore, pqvo.getScore() * stunum);
575 574
             //处理学生得分情况
576 575
             for(PointStudentVo pstuvo : pointStuScores){
577 576
                 MsrStudentPoint stuPoint = new MsrStudentPoint();
@@ -582,7 +581,7 @@ public class ReportGeneratePointService {
582 581
                 stuPoint.setPointname(pqvo.getPointname());
583 582
                 stuPoint.setFullscore(pqvo.getScore());
584 583
                 stuPoint.setStuscore(pstuvo.getStuscore());
585
-                stuPoint.setSturate(MarkingUtil.calculateRate(pstuvo.getStuscore(), pqvo.getScore()));
584
+                stuPoint.setSturate(MarkingUtil.div(pstuvo.getStuscore(), pqvo.getScore()));
586 585
                 stuPoint.setSchoolavg(schoolAvgScore);
587 586
                 stuPoint.setSchoolrate(schoolScoreRate);
588 587
                 stuPoint.setQns(qnStr.toString());

+ 9
- 9
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java 查看文件

@@ -163,7 +163,7 @@ public class ReportGenerateQuestionService {
163 163
             Double maxScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).max().orElse(0.0);// 最高分
164 164
             Double minScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).min().orElse(0.0);// 最低分
165 165
             Double avgScore = MarkingUtil.calculateAverage(stuScores);// 平均分
166
-            Double avgScoreRate = MarkingUtil.calculateRate(avgScore, sumQScore);// 平均得分率
166
+            Double avgScoreRate = MarkingUtil.div(avgScore, sumQScore);// 平均得分率
167 167
 
168 168
             MsrClassQuestion schoolQ = new MsrClassQuestion();
169 169
             schoolQ.setClassid(0);// 全体班级
@@ -251,9 +251,9 @@ public class ReportGenerateQuestionService {
251 251
             maxScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).max().orElse(0.0);// 最高分
252 252
             minScore = stuQuestions.stream().mapToDouble(MsPaperStudentQuestion::getStuscore).min().orElse(0.0);// 最低分
253 253
             avgScore = MarkingUtil.calculateAverage(stuScores);// 平均分
254
-            avgScoreRate = MarkingUtil.calculateRate(avgScore, sumQScore);// 平均得分率
254
+            avgScoreRate = MarkingUtil.div(avgScore, sumQScore);// 平均得分率
255 255
         }
256
-        Double stuScoreRate = MarkingUtil.calculateRate(sumStuScore, sumQScore);// 学生得分率
256
+        Double stuScoreRate = MarkingUtil.div(sumStuScore, sumQScore);// 学生得分率
257 257
         MsrClassQuestion classQ = new MsrClassQuestion();
258 258
         classQ.setExamid(schoolQ.getExamid());
259 259
         classQ.setSubjectid(schoolQ.getSubjectid());
@@ -275,7 +275,7 @@ public class ReportGenerateQuestionService {
275 275
         classQ.setSchoolavgrate(schoolQ.getSchoolavgrate());
276 276
 
277 277
         classQ.setScorerate(stuScoreRate);
278
-        classQ.setScoreratec(MarkingUtil.sub(MarkingUtil.calculateRate(maxScore, qScore), MarkingUtil.calculateRate(minScore, qScore)));// 得分率差=最高得分率-最低得分率
278
+        classQ.setScoreratec(MarkingUtil.sub(MarkingUtil.div(maxScore, qScore), MarkingUtil.div(minScore, qScore)));// 得分率差=最高得分率-最低得分率
279 279
         classQ.setNd(MarkingUtil.div(avgScore, qScore));// 难度
280 280
         String[] ndStr = questionNdAndQfd(params, 1, classQ.getNd());
281 281
         classQ.setNdms(ndStr[0]);// 难度描述
@@ -428,8 +428,8 @@ public class ReportGenerateQuestionService {
428 428
                 double avgScore = MarkingUtil.div(sumScore, groupStuQuestions.size());
429 429
                 sqr.setStunum(groupStuQuestions.size());
430 430
                 sqr.setStuids(groupStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
431
-                sqr.setScorerate(MarkingUtil.calculateRate(sumScore, groupStuQuestions.size() * fullScore));
432
-                sqr.setAvgrate(MarkingUtil.calculateRate(avgScore, fullScore));
431
+                sqr.setScorerate(MarkingUtil.div(sumScore, groupStuQuestions.size() * fullScore));
432
+                sqr.setAvgrate(MarkingUtil.div(avgScore, fullScore));
433 433
             } else {
434 434
                 groupStuids = null;
435 435
                 sqr.setStunum(0);
@@ -462,8 +462,8 @@ public class ReportGenerateQuestionService {
462 462
                         double sectionStuAvgScore = MarkingUtil.div(sectionStuSumScore, sectionStuQuestions.size());
463 463
                         sqrg.setStunum(sectionStuQuestions.size());
464 464
                         sqrg.setStuids(sectionStuQuestions.stream().map(q -> q.getStudentid().toString()).collect(Collectors.joining(",")));
465
-                        sqrg.setScorerate(MarkingUtil.calculateRate(sectionStuSumScore, sectionStuQuestions.size() * fullScore));
466
-                        sqrg.setAvgrate(MarkingUtil.calculateRate(sectionStuAvgScore, fullScore));
465
+                        sqrg.setScorerate(MarkingUtil.div(sectionStuSumScore, sectionStuQuestions.size() * fullScore));
466
+                        sqrg.setAvgrate(MarkingUtil.div(sectionStuAvgScore, fullScore));
467 467
                     }else{
468 468
                         sqrg.setStunum(0);
469 469
                         sqrg.setScorerate(0.0);
@@ -580,7 +580,7 @@ public class ReportGenerateQuestionService {
580 580
                 // 获取平均分
581 581
                 double avgScore = MarkingUtil.div(sumScore, stuNum);
582 582
                 // 获取平均得分率
583
-                double avgScoreRate = MarkingUtil.calculateRate(avgScore, fullScore);
583
+                double avgScoreRate = MarkingUtil.div(avgScore, fullScore);
584 584
                 sqs.setAvgscore(avgScore);
585 585
                 sqs.setAvgrate(avgScoreRate);
586 586
             }else{

+ 38
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java 查看文件

@@ -6,6 +6,7 @@ import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectGradeMapper
6 6
 import com.xhkjedu.smarking.mapper.report.reportother.MsrReportparamMapper;
7 7
 import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectMapper;
8 8
 import com.xhkjedu.smarking.model.exam.MsClass;
9
+import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
9 10
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
10 11
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
11 12
 import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
@@ -110,8 +111,43 @@ public class MsrClassQuestionService {
110 111
         return msrClassQuestionMapper.listQuestionSummaryForObjsub(params);
111 112
     }
112 113
 
113
-    public void listQuestionForXh(ExamReportParams params){
114
-
114
+    //学科报告-各班学科试题分析-得分率
115
+    public void listQuestionForXhScoreRate(ExamReportParams params){
116
+        params.setSelclass(3);
117
+        params.setClassids("0," + params.getClassids());//拼上全体
118
+        //获取选定班级的试题分析
119
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
120
+        //获取所有题号
121
+        List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
122
+        //把试题按班级分组
123
+        Map<Integer,List<MsrClassQuestion>> classMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
124
+        List<Map<String,Object>> classList = new ArrayList<>();//班级试题
125
+        for(Map.Entry<Integer,List<MsrClassQuestion>> entry : classMap.entrySet()){
126
+            Map<String,Object> clMap = new HashMap<>();
127
+            clMap.put("classid",entry.getKey());
128
+            clMap.put("classname",entry.getValue().get(0).getClassname());
129
+            clMap.put("questions",entry.getValue());
130
+            classList.add(clMap);
131
+        }
115 132
     }
133
+    //学科报告-各班学科试题分析-试题难度和区分度
134
+    public void listQuestionForXhNdAndQfd(ExamReportParams params){
135
+        params.setSelclass(4);
136
+        //获取选定班级的试题分析
137
+        List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
138
+        //获取所有题号
139
+        List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
140
+        //把试题按班级分组
141
+        Map<Integer,List<MsrClassQuestion>> classMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
142
+        List<Map<String,Object>> classList = new ArrayList<>();//班级试题
143
+        for(Map.Entry<Integer,List<MsrClassQuestion>> entry : classMap.entrySet()){
144
+            Map<String,Object> clMap = new HashMap<>();
145
+            clMap.put("classid",entry.getKey());
146
+            clMap.put("classname",entry.getValue().get(0).getClassname());
147
+            clMap.put("questions",entry.getValue());
148
+            classList.add(clMap);
149
+        }
150
+    }
151
+
116 152
 
117 153
 }

+ 2
- 1
smarking/src/main/resources/mapper/paper/MsPaperQtypeMapper.xml 查看文件

@@ -15,6 +15,7 @@
15 15
         <result column="mptname" property="mptname" />
16 16
         <result column="mptnum" property="mptnum" />
17 17
         <result column="mptorder" property="mptorder" />
18
+        <result column="mptctype" property="ctype" />
18 19
         <result column="mptscore" property="mptscore" />
19 20
         <collection property="questions" ofType="com.xhkjedu.smarking.vo.paper.MsPaperQtypeQuestionVo" javaType="java.util.List">
20 21
             <result column="mptqid" property="mptqid" />
@@ -61,7 +62,7 @@
61 62
     </resultMap>
62 63
     <!--试题详情-->
63 64
     <select id="listPaperQtypeQuestions" resultMap="qtypesQuestion">
64
-        select t.mptid,t.mpid,t.mptqn,t.mptname,t.mptnum,t.mptorder,t.mptscore,tq.mptqid,tq.questionid,tq.questionpid,tq.qanswer as answer,tq.qscore,tq.qn,
65
+        select t.mptid,t.mpid,t.mptqn,t.mptname,t.mptnum,t.mptorder,t.ctype as mptctype ,t.mptscore,tq.mptqid,tq.questionid,tq.questionpid,tq.qanswer as answer,tq.qscore,tq.qn,
65 66
         tq.qorder,tq.loseoption,tq.scoreset,COALESCE(tq.complexity, q.complexity) as complexity,q.qtypeid,q.qtypename,q.ctype qctype,
66 67
         q.qstem,q.qstemtxt,q.qoption,q.qanswer,q.qanalyze,q.hashear,q.hearfile,q.qlevel,q.sorder,
67 68
         fq.snum,fq.qstem as mqstem,fq.complexity as mcomplexity,fq.qtypeid mqtypeid,fq.qtypename mqtypename,fq.ctype mctype,

+ 7
- 3
smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml 查看文件

@@ -93,11 +93,15 @@
93 93
     <!--学科报告-各班学科试题分析-->
94 94
     <select id="listQuestionForXh" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion">
95 95
         select q.mptqid,q.classid,q.qn,q.qtype,
96
-        q.classavgrate,q.schoolavgrate,q.scorerate,q.scoreratec,q.qfd,q.qfdms,c.classname
96
+        q.classavgrate,q.schoolavgrate,q.scorerate,q.scoreratec,q.nd,q.ndms,q.qfd,q.qfdms,c.classname
97 97
         from msr_class_question q left join ms_class c on q.examid=c.examid
98 98
         and q.subjectid=c.subjectid and q.classid=c.classid
99
-        where q.examid=#{param.examid} and q.subjectid=#{param.subjectid} and q.classid in
100
-        <foreach collection="param.classids" item="item" open="(" separator="," close=")">#{item}</foreach>
99
+        where q.examid=#{param.examid} and q.subjectid=#{param.subjectid}
100
+        <if test="param.selclass == 3">
101
+            and q.classid in
102
+            <foreach collection="param.classids" item="item" open="(" separator="," close=")">#{item}</foreach>
103
+        </if>
104
+        <if test="param.selclass == 4"> and q.classid = #{param.classid}</if>
101 105
         order by q.mptqid
102 106
     </select>
103 107
 

正在加载...
取消
保存