Browse Source

试卷模板、进度总览完善 学科试题报告

wn
王宁 4 days ago
parent
commit
fa87268033

+ 14
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsTemplateController.java View File

@@ -123,5 +123,19 @@ public class MsTemplateController {
123 123
         return new ResultVo(0, "查询成功",rtnObjs);
124 124
     }
125 125
 
126
+    /*
127
+     * @Description 主观题框选-题块模板
128
+     * @Date 2024/12/27 16:54:30
129
+     * @Author WN
130
+     * @Param [msTemplate]
131
+     * @Return com.xhkjedu.vo.ResultVo
132
+     **/
133
+    @PostMapping("/block_temp")
134
+    public ResultVo listBlockTemplates(@RequestBody MsTemplate msTemplate) {
135
+        N_Utils.validation(new Object[]{msTemplate.getMpid(),"试卷id",1,msTemplate.getMtid(),"模板id",1});
136
+        List<Map<String,Object>> rtnObjs = msTemplateService.listBlockTemplates(msTemplate.getMpid(),msTemplate.getMtid());
137
+        return new ResultVo(0, "查询成功",rtnObjs);
138
+    }
139
+
126 140
 
127 141
 }

+ 23
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/XkReportController.java View File

@@ -1,8 +1,16 @@
1 1
 package com.xhkjedu.smarking.controller.report;
2 2
 
3
+import com.xhkjedu.smarking.service.report.report.MsrClassQuestionService;
4
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5
+import com.xhkjedu.utils.N_Utils;
6
+import com.xhkjedu.vo.ResultVo;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
3 9
 import org.springframework.web.bind.annotation.RequestMapping;
4 10
 import org.springframework.web.bind.annotation.RestController;
5 11
 
12
+import javax.annotation.Resource;
13
+
6 14
 /**
7 15
  * @Description:学科报告
8 16
  * @Author: WN
@@ -11,4 +19,19 @@ import org.springframework.web.bind.annotation.RestController;
11 19
 @RestController
12 20
 @RequestMapping("/rxk")
13 21
 public class XkReportController {
22
+    @Resource
23
+    private MsrClassQuestionService msrClassQuestionService;
24
+
25
+    /*
26
+     * @Description 各班学科试题分析-得分率
27
+     * @Date 2024/12/27 15:42:52
28
+     * @Author WN
29
+     * @Param [params]
30
+     * @Return com.xhkjedu.vo.ResultVo
31
+     **/
32
+    @PostMapping("/xkst_dfl")
33
+    public ResultVo listQuestionForXhXhstDfl(@RequestBody ExamReportParams params){
34
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2,params.getClassids(),"班级id",2});
35
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForXhXhstDfl(params));
36
+    }
14 37
 }

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsTemplateBlockMapper.java View File

@@ -22,4 +22,7 @@ public interface MsTemplateBlockMapper extends TkMapper<MsTemplateBlock> {
22 22
 
23 23
     //获取模版主观题题块信息
24 24
     List<Map<String,Object>> listSubjectiveBlockQuestions(@Param("mtid")Integer mtid);
25
+
26
+    //主观题框选题块获取
27
+    List<Map<String,Object>> listBlockTemplates(@Param("mpid")Integer mpid,@Param("mtid")Integer mtid);
25 28
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java View File

@@ -17,6 +17,8 @@ public interface MsrReportparamMapper extends TkMapper<MsrReportparam> {
17 17
     List<MsrReportparam> listReportparamByRpbelong(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode);
18 18
     //获取指定科目参数
19 19
     MsrReportparam getReportparamByRpbelongSubject(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode, @Param("subjectid") String subjectid);
20
+    //获取含有类型的对应类型参数
21
+    MsrReportparam getReportparamByRpbelongSubjectType(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode, @Param("subjectid") String subjectid, @Param("rptype") Integer rptype);
20 22
 
21 23
     //批量删除
22 24
     int deleteBatchReportparam(@Param("list") List<Integer> list);

+ 45
- 14
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsTemplateService.java View File

@@ -1,6 +1,7 @@
1 1
 package com.xhkjedu.smarking.service.paper;
2 2
 
3 3
 import com.xhkjedu.exception.MissingParametersException;
4
+import com.xhkjedu.exception.ServiceException;
4 5
 import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
5 6
 import com.xhkjedu.smarking.mapper.paper.*;
6 7
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
@@ -120,17 +121,24 @@ public class MsTemplateService {
120 121
     @Transactional(rollbackFor = Exception.class)
121 122
     public MsTemplate updateTemplate(MsTemplate msTemplate){
122 123
 
124
+        //根据模板ID获取模板信息
125
+        MsTemplate oldTemplate = msTemplateMapper.selectByPrimaryKey(msTemplate.getMtid());
126
+        if(!msTemplate.getCurrstep().equals(oldTemplate.getCurrstep())) throw new ServiceException("请按顺序操作");
127
+
123 128
         //定位区选择
124 129
         if(msTemplate.getCurrstep() == 3){
125
-
126 130
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
127 131
             String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/marking/paper/";
128
-            //定位区正面图片
129
-            String dwtfront = MarkingUtil.uploadBase64Img(msTemplate.getDwtfront(),1, savefloder);
130
-            msTemplate.setDwtfront(dwtfront);
131
-            //定位区反面图片
132
-            String dwtback = MarkingUtil.uploadBase64Img(msTemplate.getDwtback(),1, savefloder);
133
-            msTemplate.setDwtback(dwtback);
132
+            if(N_Utils.isNotEmpty(msTemplate.getDwtfront())){
133
+                //定位区正面图片
134
+                String dwtfront = MarkingUtil.uploadBase64Img(msTemplate.getDwtfront(),1, savefloder);
135
+                msTemplate.setDwtfront(dwtfront);
136
+            }
137
+            if(N_Utils.isNotEmpty(msTemplate.getDwtback())){
138
+                //定位区反面图片
139
+                String dwtback = MarkingUtil.uploadBase64Img(msTemplate.getDwtback(),1, savefloder);
140
+                msTemplate.setDwtback(dwtback);
141
+            }
134 142
         }
135 143
 
136 144
         //其中currstep保存时会加1,代表保存后的步骤
@@ -163,23 +171,32 @@ public class MsTemplateService {
163 171
         //保存之前先清除已保存的信息试卷客观题题块、模板题块
164 172
         msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),1);
165 173
         msPaperBlockMapper.deleteObjByMpidAndBlocktype(mpid,1);
174
+        //获取试卷中所有试题信息
175
+        List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsByMpid(mpid);
176
+        List<MsPaperQtypeQuestion> objQuestions = questions.stream().filter(q -> q.getQtype() == 1).collect(Collectors.toList());//客观题试题信息
177
+        if(objQuestions.isEmpty()){
178
+            return;
179
+        }
180
+
181
+        if(tblocks.isEmpty()){
182
+            throw new ServiceException("未设置客观题");
183
+        }
166 184
 
167 185
         //客观题题块试题信息
168 186
         List<MsPaperBlockQuestion> savePbquestions = new ArrayList<>();
169 187
         //客观题模块试题信息
170 188
         List<MsTemplateBlockQuestion> saveTbquestions = new ArrayList<>();
171
-        //获取试卷中所有试题信息
172
-        List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsByMpid(mpid);
189
+
173 190
         int i = 1;
174 191
         for(MsTemplateBlock tblock : tblocks){
175 192
             //获取客观题单题
176 193
             List<MsTemplateBlockQuestion> tbquestions = tblock.getTbquestions();
177 194
             //获取客观题题号
178 195
             List<String> tbqns = tbquestions.stream().map(MsTemplateBlockQuestion::getQn).collect(Collectors.toList());
179
-            //包含的试题信息
180
-            List<MsPaperQtypeQuestion> selQuestions = questions.stream().filter(q -> tbqns.contains(q.getQn())).collect(Collectors.toList());
181
-            if(selQuestions.isEmpty() || selQuestions.size() != tbquestions.size()){
182
-                throw new MissingParametersException("试题信息和试卷不匹配");
196
+            //包含的客观题试题信息
197
+            List<MsPaperQtypeQuestion> selQuestions = objQuestions.stream().filter(q -> tbqns.contains(q.getQn())).collect(Collectors.toList());
198
+            if(selQuestions.isEmpty()){
199
+                throw new ServiceException("试题信息和试卷不匹配");
183 200
             }
184 201
 
185 202
             Double tbqScores = selQuestions.stream().mapToDouble(MsPaperQtypeQuestion::getQscore).sum();//题块下试题总分值
@@ -210,7 +227,7 @@ public class MsTemplateService {
210 227
             for(MsTemplateBlockQuestion tbquestion : tbquestions) {
211 228
                 MsPaperQtypeQuestion q = selQuestions.stream().filter(q1 -> q1.getQn().equals(tbquestion.getQn())).findFirst().orElse(null);
212 229
 
213
-                if(q == null) throw new MissingParametersException("试题信息和试卷不匹配");
230
+                if(q == null) throw new ServiceException("试题信息和试卷不匹配");
214 231
 
215 232
                 tbquestion.setMtbid(mtbid);
216 233
                 tbquestion.setMptqid(q.getMptqid());
@@ -230,6 +247,9 @@ public class MsTemplateService {
230 247
             }
231 248
         }
232 249
 
250
+        if(saveTbquestions.isEmpty()) throw new ServiceException("未设置客观题");
251
+        if(objQuestions.size() != saveTbquestions.size()) throw new ServiceException("试题信息和试卷不匹配");
252
+
233 253
         msPaperBlockQuestionMapper.insertList(savePbquestions);
234 254
         msTemplateBlockQuestionMapper.insertList(saveTbquestions);
235 255
     }
@@ -423,4 +443,15 @@ public class MsTemplateService {
423 443
     public List<Map<String,Object>> listTemplateBlocksByMtidAndType(Integer mtid){
424 444
         return msTemplateBlockMapper.listSubjectiveBlockQuestions(mtid);
425 445
     }
446
+
447
+    /*
448
+     * @Description 主观题框选题块获取
449
+     * @Date 2024/12/27 16:51:38
450
+     * @Author WN
451
+     * @Param [mpid, mtid]
452
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
453
+     **/
454
+    public List<Map<String,Object>> listBlockTemplates(Integer mpid, Integer mtid){
455
+        return msTemplateBlockMapper.listBlockTemplates(mpid, mtid);
456
+    }
426 457
 }

+ 117
- 11
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java View File

@@ -1,5 +1,6 @@
1 1
 package com.xhkjedu.smarking.service.report.report;
2 2
 
3
+import com.alibaba.fastjson.JSON;
3 4
 import com.xhkjedu.smarking.mapper.exam.MsClassMapper;
4 5
 import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQuestionMapper;
5 6
 import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectGradeMapper;
@@ -10,13 +11,12 @@ import com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion;
10 11
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
11 12
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
12 13
 import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
14
+import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
15
+import com.xhkjedu.utils.N_Utils;
13 16
 import org.springframework.stereotype.Service;
14 17
 
15 18
 import javax.annotation.Resource;
16
-import java.util.ArrayList;
17
-import java.util.HashMap;
18
-import java.util.List;
19
-import java.util.Map;
19
+import java.util.*;
20 20
 import java.util.stream.Collectors;
21 21
 
22 22
 /**
@@ -112,29 +112,135 @@ public class MsrClassQuestionService {
112 112
     }
113 113
 
114 114
     //学科报告-各班学科试题分析-得分率
115
-    public void listQuestionForXhScoreRate(ExamReportParams params){
115
+    public Map<String,Object> listQuestionForXhXhstDfl(ExamReportParams params){
116 116
         params.setSelclass(3);
117 117
         params.setClassids("0," + params.getClassids());//拼上全体
118 118
         //获取选定班级的试题分析
119 119
         List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
120
+        //获取全体试题情况
121
+        List<MsrClassQuestion> schoolQuestions = questions.stream().filter(m -> m.getClassid() == 0).collect(Collectors.toList());
122
+        List<MsrClassQuestion> classQuestions = questions.stream().filter(m -> m.getClassid() != 0).collect(Collectors.toList());
120 123
         //获取所有题号
121
-        List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
124
+        List<String> qns = new ArrayList<>();
125
+        //获取全体得分率数据
126
+        List<Map<String,Object>> schoolScoreRate = new ArrayList<>();
127
+        Map<Integer,Object> mptqidScore = new LinkedHashMap<>();//全体各题得分率
128
+        for(MsrClassQuestion q : schoolQuestions){
129
+            Map<String,Object> qMap = new HashMap<>();
130
+            qMap.put("qn",q.getQn());
131
+            qMap.put("mptqid",q.getMptqid());
132
+            qMap.put("qorder",q.getQorder());
133
+            qMap.put("scorerate",q.getScorerate());
134
+            schoolScoreRate.add(qMap);
135
+            mptqidScore.put(q.getMptqid(),q.getScorerate());
136
+            qns.add(q.getQn());
137
+        }
138
+
122 139
         //把试题按班级分组
123
-        Map<Integer,List<MsrClassQuestion>> classMap = questions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
124
-        List<Map<String,Object>> classList = new ArrayList<>();//班级试题
140
+        Map<Integer,List<MsrClassQuestion>> classMap = classQuestions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
141
+        List<Map<String,Object>> classList = new ArrayList<>();//班级试题得分率差
125 142
         for(Map.Entry<Integer,List<MsrClassQuestion>> entry : classMap.entrySet()){
143
+            List<MsrClassQuestion> classQueList = entry.getValue();
144
+            List<Map<String,Object>> queList = new ArrayList<>();
145
+            for(MsrClassQuestion q : classQueList) {
146
+                Map<String, Object> qMap = new HashMap<>();
147
+                qMap.put("qn", q.getQn());
148
+                qMap.put("mptqid", q.getMptqid());
149
+                qMap.put("qorder", q.getQorder());
150
+                qMap.put("scorerate", q.getScorerate());
151
+                qMap.put("scoreratec", q.getScoreratec());
152
+                qMap.put("schoolscorerate", mptqidScore.get(q.getMptqid()));
153
+                queList.add(qMap);
154
+            }
155
+
126 156
             Map<String,Object> clMap = new HashMap<>();
127 157
             clMap.put("classid",entry.getKey());
128
-            clMap.put("classname",entry.getValue().get(0).getClassname());
129
-            clMap.put("questions",entry.getValue());
158
+            clMap.put("classname",classQueList.get(0).getClassname());
159
+            clMap.put("questions",queList.stream().sorted(Comparator.comparing(m -> (Integer) m.get("qorder"))).collect(Collectors.toList()));
130 160
             classList.add(clMap);
131 161
         }
162
+
163
+        //分析诊断-得分率高于全体得分率的班级和试题
164
+        List<MsrClassQuestion> highQuestions = new ArrayList<>();//高于全体得分率的试题情况
165
+        for(MsrClassQuestion q : schoolQuestions){
166
+            List<MsrClassQuestion> hightClass = questions.stream().filter(m -> m.getMptqid().equals(q.getMptqid()) && m.getClassid() != 0 && m.getScorerate() > q.getScorerate()).collect(Collectors.toList());
167
+            if(!hightClass.isEmpty()){
168
+                highQuestions.addAll(hightClass);
169
+            }
170
+        }
171
+        //高分按班级分组,哪个班级试题数量多,则属于高班和试题(统计高于年级平均值的试题数量,看哪个班级最多)
172
+        Map<Integer,List<MsrClassQuestion>> highClassMap = highQuestions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getClassid));
173
+        int maxNum = 0;
174
+        List<MsrClassQuestion> maxClassQuestions = new ArrayList<>();
175
+        for(Map.Entry<Integer,List<MsrClassQuestion>> entry : highClassMap.entrySet()){
176
+            if(entry.getValue().size() > maxNum){
177
+                maxNum = entry.getValue().size();
178
+                maxClassQuestions.addAll(entry.getValue());
179
+            }
180
+        }
181
+        Map<String,Object> highMap = new HashMap<>();//高得分率分析
182
+        if(!maxClassQuestions.isEmpty()){
183
+            highMap.put("classname",maxClassQuestions.get(0).getClassname());
184
+            highMap.put("qnstr",maxClassQuestions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.joining(",")));
185
+        }
186
+        //列出各个难度的试题中,得分率低于60%的试题,用全体试题的得分率进行难度分组
187
+        Map<String,List<MsrClassQuestion>> ndMap = schoolQuestions.stream().collect(Collectors.groupingBy(MsrClassQuestion::getNdms));
188
+        //获取所有试题难度分组参数
189
+        MsrReportparam ndParam = msrReportparamMapper.getReportparamByRpbelongSubjectType(params.getExamid(),"quesummary","all",params.getSubjectid(),1);
190
+        List<SzJsonVo> jsonList = JSON.parseArray(ndParam.getSzjson(), SzJsonVo.class);
191
+        List<Map<String,Object>> ndList = new ArrayList<>();
192
+        for(SzJsonVo szvo : jsonList){
193
+            Map<String,Object> zsndMap = new HashMap<>();
194
+            zsndMap.put("djkey",szvo.getDjkey());
195
+            String qnStr = "";
196
+            if(ndMap.containsKey(szvo.getDjkey())){
197
+                List<MsrClassQuestion> ndQues = ndMap.get(szvo.getDjkey());
198
+                //获取得分率低于60%的试题
199
+                List<MsrClassQuestion> lowQuestions = ndQues.stream().filter(m -> m.getScorerate() < 0.6).collect(Collectors.toList());
200
+                if(!lowQuestions.isEmpty()){
201
+                    qnStr = lowQuestions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.joining(","));
202
+                }
203
+            }
204
+            if(N_Utils.isEmpty(qnStr)){
205
+                qnStr = "无";
206
+            }
207
+            zsndMap.put("qnstr",qnStr);
208
+
209
+            ndList.add(zsndMap);
210
+        }
211
+        //计算各个难度的试题得分率
212
+        for(Map<String,Object> nd : ndList) {
213
+            List<MsrClassQuestion> ndQuestions = schoolQuestions.stream().filter(m -> m.getNdms().equals(nd.get("ndms"))).collect(Collectors.toList());
214
+        }
215
+
216
+        Map<String,Object> rtnMap = new LinkedHashMap<>();
217
+        rtnMap.put("qns",qns);
218
+        rtnMap.put("schoolQues",schoolScoreRate);
219
+        rtnMap.put("classQues",classList);
220
+        rtnMap.put("highMap",highMap);
221
+        rtnMap.put("ndList",ndList);
222
+        return rtnMap;
132 223
     }
133 224
     //学科报告-各班学科试题分析-试题难度和区分度
134
-    public void listQuestionForXhNdAndQfd(ExamReportParams params){
225
+    public void listQuestionForXhXhstNdAndQfd(ExamReportParams params){
135 226
         params.setSelclass(4);
136 227
         //获取选定班级的试题分析
137 228
         List<MsrClassQuestion> questions = msrClassQuestionMapper.listQuestionForXh(params);
229
+        //表现较好的题目和表现不足的题目,根据得分率差进行排序
230
+        List<MsrClassQuestion> goodAndBadQues = questions.stream().sorted(Comparator.comparing(MsrClassQuestion::getScoreratec).reversed()).collect(Collectors.toList());
231
+        List<MsrClassQuestion> firstN;
232
+        List<MsrClassQuestion> lastN;
233
+        int n = 5;
234
+        if(goodAndBadQues.size() < n){
235
+            n = goodAndBadQues.size()/2;
236
+        }
237
+        // 获取前N个元素
238
+        firstN = goodAndBadQues.stream().limit(n).collect(Collectors.toList());
239
+        // 获取后N个元素
240
+        lastN = goodAndBadQues.stream().skip(goodAndBadQues.size() - n).collect(Collectors.toList());
241
+
242
+        
243
+
138 244
         //获取所有题号
139 245
         List<String> qns = questions.stream().map(MsrClassQuestion::getQn).distinct().collect(Collectors.toList());
140 246
         //把试题按班级分组

+ 3
- 2
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -134,7 +134,7 @@
134 134
     <!--单科设置信息-->
135 135
     <select id="getSet" resultType="java.util.Map">
136 136
         <if test="exammode!=3">
137
-            select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,s.pbstate,s.checkset,s.checkstate,s.invigilatestate,3 as correcttype
137
+            select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.mpid,3 as correcttype
138 138
             ,count(distinct ps.mpsid) as stunum
139 139
             ,count(distinct if(ps.batchid is not null,ps.mpsid,null)) as scannum
140 140
             ,count(distinct pb.mblockid) as blocknum
@@ -144,6 +144,7 @@
144 144
             ,count(distinct if(psb.arbitratestate in(1,2),psb.mpsbid,null)) as arbitratenum
145 145
             ,count(distinct if(psb.hasproblem in(1,2),psb.mpsbid,null)) as problemnum
146 146
             from ms_subject s left join ms_paper_student ps on s.msid = ps.msid
147
+            left join ms_paper p on p.msid = s.msid
147 148
             left join ms_paper_block pb on pb.mpid = ps.mpid
148 149
             left join ms_template t on t.mpid=ps.mpid
149 150
             left join ms_template_block tb on tb.mtid=t.mtid
@@ -152,7 +153,7 @@
152 153
             where s.examid=#{examid} and s.subjectid=#{subjectid}
153 154
         </if>
154 155
         <if test="exammode==3">
155
-            select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.correcttype
156
+            select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.pstate,s.ptstate,s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.mpid,p.correcttype
156 157
             ,count(distinct if(pc.dispenseway!=0,pc.mblockid,null)) as ysznum
157 158
             ,if(p.correcttype=1,(select count(*) from ms_class c where c.examid=s.examid and c.subjectid=s.subjectid)
158 159
             ,count(distinct if(pb.qtype=2,pb.mptqid,null)))-count(distinct if(pc.dispenseway!=0,pc.mblockid,null)) as wsznum

+ 1
- 1
smarking/src/main/resources/mapper/paper/MsPaperMapper.xml View File

@@ -124,7 +124,7 @@
124 124
     </select>
125 125
     <!--根据试卷ID获取科目名称和考试名称-->
126 126
     <select id="getSubjectAndExamByMpid" resultType="java.util.Map">
127
-        select distinct s.msid,s.subjectname,e.examid,e.examname
127
+        select distinct s.msid,s.subjectname,e.examid,e.examname,e.exammode
128 128
         from ms_subject s left join ms_exam e on s.examid=e.examid
129 129
         left join ms_paper p on s.msid=p.msid
130 130
         where p.mpid=#{mpid}

+ 24
- 0
smarking/src/main/resources/mapper/paper/MsTemplateBlockMapper.xml View File

@@ -46,4 +46,28 @@
46 46
         select b.mtbid,b.mblockid,b.blockname,b.mttype,b.direct,b.localcoor,b.pagenum,b.extendcoor,b.scorecoor,
47 47
         b.mtborder from ms_template_block b where b.mtid=#{mtid} and b.mttype=2 order by b.mtborder
48 48
     </select>
49
+
50
+    <resultMap id="blockTemplate" type="java.util.Map">
51
+        <result column="mblockid" property="mblockid" />
52
+        <result column="blockname" property="blockname" />
53
+        <result column="blockorder" property="blockorder" />
54
+        <result column="bqnum" property="bqnum" />
55
+        <result column="bqscore" property="bqscore" />
56
+        <result column="localcoor" property="localcoor" />
57
+        <result column="pagenum" property="pagenum" />
58
+        <result column="extendcoor" property="extendcoor" />
59
+        <result column="scorecoor" property="scorecoor" />
60
+        <collection property="questions" ofType="java.util.Map" javaType="java.util.ArrayList">
61
+            <result column="mbqid" property="mbqid" />
62
+            <result column="bqn" property="bqn" />
63
+        </collection>
64
+    </resultMap>
65
+    <!--主观题框选题块获取-->
66
+    <select id="listBlockTemplates" resultMap="blockTemplate">
67
+        select DISTINCT b.mblockid,b.blockname,b.blockorder,b.bqnum,b.bqscore,
68
+                        tb.localcoor,tb.pagenum,tb.extendcoor,tb.scorecoor,bq.mbqid,bq.bqn
69
+        from ms_paper_block b inner join ms_template_block tb on b.mblockid=tb.mblockid
70
+        left join ms_paper_block_question bq on b.mblockid=bq.mblockid
71
+        where b.mpid=#{mpid} and tb.mtid=#{mtid} and b.blocktype=2 order by b.blockorder,bq.bqorder
72
+    </select>
49 73
 </mapper>

+ 19
- 16
smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml View File

@@ -11,24 +11,27 @@
11 11
 
12 12
     <!--设置试卷模板信息-->
13 13
     <update id="updateTemplateForCurrstep">
14
-        update ms_template set currstep=(#{t.currstep} + 1)
15
-        <if test="t.currstep == 1">
16
-            ,blankindex=#{t.blankindex}
17
-        </if>
18
-        <if test="t.currstep == 2">
19
-            ,anglefront=#{t.anglefront},angleback=#{t.angleback}
20
-        </if>
21
-        <if test="t.currstep == 3">
22
-            ,coorfront=#{t.coorfront},coorback=#{t.coorback},dwtfront=#{t.dwtfront},dwtback=#{t.dwtback}
23
-        </if>
24
-        <if test="t.currstep == 4">
25
-            ,examnocoor=#{t.examnocoor},cardcoor=#{t.cardcoor}
26
-        </if>
27
-        <if test="t.currstep == 6">
28
-            ,misscoor=#{t.misscoor}
14
+        update ms_template
15
+        <if test="t.currstep &lt; 7">
16
+            set currstep=(#{t.currstep} + 1)
17
+            <if test="t.currstep == 1">
18
+                ,blankindex=#{t.blankindex}
19
+            </if>
20
+            <if test="t.currstep == 2">
21
+                ,anglefront=#{t.anglefront},angleback=#{t.angleback}
22
+            </if>
23
+            <if test="t.currstep == 3">
24
+                ,coorfront=#{t.coorfront},coorback=#{t.coorback},dwtfront=#{t.dwtfront},dwtback=#{t.dwtback}
25
+            </if>
26
+            <if test="t.currstep == 4">
27
+                ,examnocoor=#{t.examnocoor},cardcoor=#{t.cardcoor}
28
+            </if>
29
+            <if test="t.currstep == 6">
30
+                ,misscoor=#{t.misscoor}
31
+            </if>
29 32
         </if>
30 33
         <if test="t.currstep == 7">
31
-            ,violatecoor=#{t.violatecoor},tstate=1
34
+            set violatecoor=#{t.violatecoor},tstate=1
32 35
         </if>
33 36
         where mtid=#{t.mtid}
34 37
     </update>

+ 5
- 0
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml View File

@@ -19,6 +19,11 @@
19 19
         select * from msr_reportparam where examid=#{examid} and rpbelong = #{rpbelong} and
20 20
                                             reportcode = #{reportcode} and subjectid = #{subjectid} limit 1
21 21
     </select>
22
+    <!--获取含有类型的对应类型参数-->
23
+    <select id="getReportparamByRpbelongSubjectType" resultType="com.xhkjedu.smarking.model.report.reportother.MsrReportparam">
24
+        select * from msr_reportparam where examid=#{examid} and rpbelong = #{rpbelong} and
25
+            reportcode = #{reportcode} and subjectid = #{subjectid} and rptype = #{rptype} limit 1
26
+    </select>
22 27
 
23 28
     <!--删除-->
24 29
     <delete id="deleteBatchReportparam">

Loading…
Cancel
Save