Browse Source

作业完善

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

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

13
 import com.xhkjedu.sstudy.vo.paper.PaperCAnalyzeVo;
13
 import com.xhkjedu.sstudy.vo.paper.PaperCAnalyzeVo;
14
 import com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo;
14
 import com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo;
15
 import com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo;
15
 import com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo;
16
+import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
16
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
17
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
17
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
18
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
18
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPointScoreVo;
19
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPointScoreVo;
218
 
219
 
219
     //作业统计--按学生--年级下所有学生作业情况
220
     //作业统计--按学生--年级下所有学生作业情况
220
     List<AStudentPaperVo> listPaperAllClassStu(@Param("paper") AnalyzeSearchVo paper);
221
     List<AStudentPaperVo> listPaperAllClassStu(@Param("paper") AnalyzeSearchVo paper);
222
+
223
+    //作业母题列表
224
+    List<PaperStudentQuestionVo> listQuestionByQuestionIds(@Param("questionids") List<String> questionids);
221
 }
225
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/paper/TPaperQtypeQuestion.java View File

38
     //学校id
38
     //学校id
39
     private Integer schoolid;
39
     private Integer schoolid;
40
 
40
 
41
+    private String qn;//显示题号
42
+
41
     @Transient
43
     @Transient
42
     //处理题型1单选题2多选题3主观题4判断对错5判断✔6判断TF7完形填空8阅读理解
44
     //处理题型1单选题2多选题3主观题4判断对错5判断✔6判断TF7完形填空8阅读理解
43
     private Integer ctype;
45
     private Integer ctype;

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/paperstudent/TPaperStudentQuestion.java View File

82
 
82
 
83
     private Integer converted;//是否转换0未转换1已转换2转换失败
83
     private Integer converted;//是否转换0未转换1已转换2转换失败
84
 
84
 
85
+    private String qn;//显示题号
86
+
85
     @Transient
87
     @Transient
86
     //试题题型id
88
     //试题题型id
87
     private String qtypeid;
89
     private String qtypeid;

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

9
 import com.xhkjedu.sstudy.model.paper.TPaperAnalyze;
9
 import com.xhkjedu.sstudy.model.paper.TPaperAnalyze;
10
 import com.xhkjedu.sstudy.model.paper.TPaperFile;
10
 import com.xhkjedu.sstudy.model.paper.TPaperFile;
11
 import com.xhkjedu.sstudy.model.paperstudent.TPaperGroup;
11
 import com.xhkjedu.sstudy.model.paperstudent.TPaperGroup;
12
+import com.xhkjedu.sstudy.utils.StudyUtil;
12
 import com.xhkjedu.sstudy.vo.gradeclass.CStudentVo;
13
 import com.xhkjedu.sstudy.vo.gradeclass.CStudentVo;
13
 import com.xhkjedu.sstudy.vo.paper.*;
14
 import com.xhkjedu.sstudy.vo.paper.*;
14
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
15
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
163
     public StudentPaperVo getPeopleDetailAnalyze(Integer psid) {
164
     public StudentPaperVo getPeopleDetailAnalyze(Integer psid) {
164
         StudentPaperVo paper = paperAnalyzeMapper.getStudentPaperAnalyze(psid);
165
         StudentPaperVo paper = paperAnalyzeMapper.getStudentPaperAnalyze(psid);
165
         List<StudentPaperTypeVo> types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
166
         List<StudentPaperTypeVo> types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
167
+        StudyUtil.setPaperQuestion(types, paperAnalyzeMapper);
166
         paper.setTypes(types);
168
         paper.setTypes(types);
167
         return paper;
169
         return paper;
168
     }
170
     }

+ 4
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

362
                     ptq.setCreateid(createid);
362
                     ptq.setCreateid(createid);
363
                     ptq.setCreatetime(N_Utils.getSecondTimestamp());
363
                     ptq.setCreatetime(N_Utils.getSecondTimestamp());
364
                     ptq.setSchoolid(schoolid);
364
                     ptq.setSchoolid(schoolid);
365
+                    ptq.setQn(ptq.getPtqorder().toString());
365
                     ptqs.add(ptq);
366
                     ptqs.add(ptq);
366
                 } else {
367
                 } else {
368
+                    Integer sorder = 1;
367
                     for (Map sq : sonqlist) {
369
                     for (Map sq : sonqlist) {
368
                         TPaperQtypeQuestion ptq = new TPaperQtypeQuestion();
370
                         TPaperQtypeQuestion ptq = new TPaperQtypeQuestion();
369
                         ptq.setPtid(qtype.getId());
371
                         ptq.setPtid(qtype.getId());
374
                         ptq.setCreateid(createid);
376
                         ptq.setCreateid(createid);
375
                         ptq.setCreatetime(N_Utils.getSecondTimestamp());
377
                         ptq.setCreatetime(N_Utils.getSecondTimestamp());
376
                         ptq.setSchoolid(schoolid);
378
                         ptq.setSchoolid(schoolid);
379
+                        ptq.setQn(qorder+"."+sorder);
380
+                        sorder++;
377
                         ptqs.add(ptq);
381
                         ptqs.add(ptq);
378
                     }
382
                     }
379
                 }
383
                 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java View File

110
                     sq.setQscore(psq.getQscore());
110
                     sq.setQscore(psq.getQscore());
111
                     sq.setQorder(psq.getQorder());
111
                     sq.setQorder(psq.getQorder());
112
                     sq.setSchoolid(psq.getSchoolid());
112
                     sq.setSchoolid(psq.getSchoolid());
113
+                    sq.setQn(psq.getQn());
113
                     savelist.add(sq);
114
                     savelist.add(sq);
114
                 }
115
                 }
115
             }
116
             }
143
                 q.setMqtypename(mt.getQtypename());
144
                 q.setMqtypename(mt.getQtypename());
144
                 q.setMhashear(mt.getHashear());
145
                 q.setMhashear(mt.getHashear());
145
                 q.setMhearfile(mt.getHearfile());
146
                 q.setMhearfile(mt.getHearfile());
147
+                q.setMqlevel(mt.getQlevel());
146
             }
148
             }
147
         }
149
         }
148
         return list;
150
         return list;

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentWebService.java View File

19
 import com.xhkjedu.sstudy.service.question.QuestionClassService;
19
 import com.xhkjedu.sstudy.service.question.QuestionClassService;
20
 import com.xhkjedu.sstudy.utils.ArithUtil;
20
 import com.xhkjedu.sstudy.utils.ArithUtil;
21
 import com.xhkjedu.sstudy.utils.ConvertUtil;
21
 import com.xhkjedu.sstudy.utils.ConvertUtil;
22
+import com.xhkjedu.sstudy.utils.StudyUtil;
22
 import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
23
 import com.xhkjedu.sstudy.vo.paperstudent.PaperSearchVo;
23
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
24
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo;
24
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentWebVo;
25
 import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentWebVo;
125
                 paperStudentMapper.updateState(null,null,psid,1);//更改开始状态
126
                 paperStudentMapper.updateState(null,null,psid,1);//更改开始状态
126
                 types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
127
                 types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
127
             }
128
             }
129
+            StudyUtil.setPaperQuestion(types, paperAnalyzeMapper);
128
             paper.setTypes(types);
130
             paper.setTypes(types);
129
         }catch (Exception e){
131
         }catch (Exception e){
130
             log.error("开始做作业失败:"+e.getMessage());
132
             log.error("开始做作业失败:"+e.getMessage());
481
     public StudentPaperVo listPaperStudent(Integer psid) {
483
     public StudentPaperVo listPaperStudent(Integer psid) {
482
         StudentPaperVo paper = paperAnalyzeMapper.getStudentPaperAnalyzeWeb(psid);
484
         StudentPaperVo paper = paperAnalyzeMapper.getStudentPaperAnalyzeWeb(psid);
483
         List<StudentPaperTypeVo> types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
485
         List<StudentPaperTypeVo> types = paperAnalyzeMapper.listPeopleDetailAnalyze(psid);
486
+        StudyUtil.setPaperQuestion(types, paperAnalyzeMapper);
484
         paper.setTypes(types);
487
         paper.setTypes(types);
485
         List<StudentPointScoreVo> points = paperAnalyzeMapper.listPointScoreByPsId(psid);
488
         List<StudentPointScoreVo> points = paperAnalyzeMapper.listPointScoreByPsId(psid);
486
         paper.setPoints(points);
489
         paper.setPoints(points);

+ 45
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/utils/StudyUtil.java View File

1
 package com.xhkjedu.sstudy.utils;
1
 package com.xhkjedu.sstudy.utils;
2
 
2
 
3
 import com.xhkjedu.sstudy.config.ConfigKey;
3
 import com.xhkjedu.sstudy.config.ConfigKey;
4
+import com.xhkjedu.sstudy.mapper.paper.PaperAnalyzeMapper;
5
+import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
6
+import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
7
+import com.xhkjedu.utils.N_Utils;
4
 import lombok.extern.slf4j.Slf4j;
8
 import lombok.extern.slf4j.Slf4j;
5
 import org.springframework.http.HttpEntity;
9
 import org.springframework.http.HttpEntity;
6
 import org.springframework.http.HttpHeaders;
10
 import org.springframework.http.HttpHeaders;
11
 import org.springframework.web.client.RestTemplate;
15
 import org.springframework.web.client.RestTemplate;
12
 
16
 
13
 import java.util.ArrayList;
17
 import java.util.ArrayList;
18
+import java.util.LinkedHashMap;
14
 import java.util.List;
19
 import java.util.List;
15
 import java.util.Map;
20
 import java.util.Map;
16
 import java.util.concurrent.ConcurrentHashMap;
21
 import java.util.concurrent.ConcurrentHashMap;
22
+import java.util.stream.Collectors;
17
 
23
 
18
 import static com.xhkjedu.utils.N_Utils.getSecondTimestamp;
24
 import static com.xhkjedu.utils.N_Utils.getSecondTimestamp;
19
 
25
 
65
             return null;
71
             return null;
66
         }
72
         }
67
     }
73
     }
74
+
75
+    //处理母子题
76
+    public static List<StudentPaperTypeVo> setPaperQuestion(List<StudentPaperTypeVo> types, PaperAnalyzeMapper paperAnalyzeMapper){
77
+        List<PaperStudentQuestionVo> qlist = new ArrayList<>();
78
+        types.forEach(t -> {
79
+            qlist.addAll(t.getQuestions());
80
+        });
81
+        List<String> questionpids = qlist.stream().filter(q -> q.getQlevel() == 3)
82
+                .map(q -> q.getQuestionpid()).distinct().collect(Collectors.toList());
83
+        List<PaperStudentQuestionVo> mquestions = new ArrayList<>();
84
+        if (N_Utils.isListNotEmpty(questionpids)) {
85
+            mquestions = paperAnalyzeMapper.listQuestionByQuestionIds(questionpids);
86
+        }
87
+        for (StudentPaperTypeVo t : types) {
88
+            List<PaperStudentQuestionVo> questionList = new ArrayList<>();
89
+            List<PaperStudentQuestionVo> questions = t.getQuestions();
90
+            LinkedHashMap<String, List<PaperStudentQuestionVo>> collect = questions.stream()
91
+                    .collect(Collectors.groupingBy(q -> q.getQuestionpid(), LinkedHashMap::new, Collectors.toList()));
92
+            for (Map.Entry<String, List<PaperStudentQuestionVo>> entry : collect.entrySet()) {
93
+                String questionpid = entry.getKey();
94
+                List<PaperStudentQuestionVo> list = entry.getValue();
95
+                PaperStudentQuestionVo tq = list.get(0);
96
+                PaperStudentQuestionVo q;
97
+                if(tq.getQlevel()==3){//子题
98
+                    q = mquestions.stream().filter(mq -> mq.getQuestionid().equals(questionpid)).findFirst().orElse(null);
99
+                    double score = list.stream().mapToDouble(PaperStudentQuestionVo::getQscore).sum();
100
+                    List<PaperStudentQuestionVo> sonques = list.stream().filter(l -> l.getQuestionpid().equals(questionpid)).collect(Collectors.toList());
101
+                    q.setQscore(score);
102
+                    q.setQorder(tq.getQorder());
103
+                    q.setSonques(sonques);
104
+                }else {
105
+                    q=tq;
106
+                }
107
+                questionList.add(q);
108
+            }
109
+            t.setQuestions(questionList);
110
+        }
111
+        return types;
112
+    }
68
 }
113
 }

+ 8
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paperstudent/PaperStudentQuestionVo.java View File

2
 
2
 
3
 import lombok.Data;
3
 import lombok.Data;
4
 
4
 
5
+import java.util.List;
6
+
5
 @Data
7
 @Data
6
 public class PaperStudentQuestionVo {
8
 public class PaperStudentQuestionVo {
7
     //试卷学生id
9
     //试卷学生id
104
     private String mhearfile;//母题听力题文件地址
106
     private String mhearfile;//母题听力题文件地址
105
     private Integer hashear;//是否是听力题0不是1是
107
     private Integer hashear;//是否是听力题0不是1是
106
     private String hearfile;//听力题文件地址
108
     private String hearfile;//听力题文件地址
109
+    private Integer qlevel;//试题级别1单题2母题
110
+    private Integer mqlevel;//母题试题级别1单题2母题
111
+    private Integer sorder;//子题排序
112
+    private String questionpid;//母题id
113
+    private String qn;//显示题号
114
+    private List<PaperStudentQuestionVo> sonques;//子题集合
107
 }
115
 }

+ 1
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/question/QuestionVo.java View File

126
     //子题
126
     //子题
127
     private List<Map> sonqlist;
127
     private List<Map> sonqlist;
128
 
128
 
129
+    private String qn;//显示题号
129
 }
130
 }

+ 18
- 4
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml View File

53
         ,(select u2.username from t_user u2 where u2.userid=ps.checkid)checkname
53
         ,(select u2.username from t_user u2 where u2.userid=ps.checkid)checkname
54
         from(select ps.psid,ps.studentid,ps.checkid,ps.userscore,ps.stoptime answertime,ps.costtime,ps.psstate,ps.pschecked
54
         from(select ps.psid,ps.studentid,ps.checkid,ps.userscore,ps.stoptime answertime,ps.costtime,ps.psstate,ps.pschecked
55
         ,ps.papernum,ps.paperscore
55
         ,ps.papernum,ps.paperscore
56
-        ,sum(case when q.ctype=3 then psq.stuscore else 0 end)zgscore
57
-        ,sum(case when q.ctype!=3 then psq.stuscore else 0 end)kgscore
56
+        ,sum(case when q.ctype in(3,13,14,15) then psq.stuscore else 0 end)zgscore
57
+        ,sum(case when q.ctype not in(3,13,14,15) then psq.stuscore else 0 end)kgscore
58
         from t_paper_student ps left join
58
         from t_paper_student ps left join
59
         <if test="paper.papertype==1 or paper.papertype==3">
59
         <if test="paper.papertype==1 or paper.papertype==3">
60
             t_paper_student_question psq on ps.psid=psq.psid left join t_question q on psq.questionid=q.questionid
60
             t_paper_student_question psq on ps.psid=psq.psid left join t_question q on psq.questionid=q.questionid
198
             <result property="checkcomm" column="checkcomm"></result>
198
             <result property="checkcomm" column="checkcomm"></result>
199
             <result property="hashear" column="hashear"></result>
199
             <result property="hashear" column="hashear"></result>
200
             <result property="hearfile" column="hearfile"></result>
200
             <result property="hearfile" column="hearfile"></result>
201
+            <result property="qlevel" column="qlevel"></result>
202
+            <result property="sorder" column="sorder"></result>
203
+            <result property="questionpid" column="questionpid"></result>
204
+            <result property="qn" column="qn"></result>
201
         </collection>
205
         </collection>
202
     </resultMap>
206
     </resultMap>
203
     <!--作业统计 按人详情 题型列表-->
207
     <!--作业统计 按人详情 题型列表-->
204
     <select id="listPeopleDetailAnalyze" resultMap="typeQuestion">
208
     <select id="listPeopleDetailAnalyze" resultMap="typeQuestion">
205
         SELECT t.qtypename,t.ptorder,t.ptscore,t.ptnum
209
         SELECT t.qtypename,t.ptorder,t.ptscore,t.ptnum
206
         ,psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
210
         ,psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
207
-        ,psq.useranswer,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,psq.psid
208
-        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.hashear,q.hearfile
211
+        ,psq.useranswer,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore
212
+        ,psq.qorder,psq.qn,psq.psid
213
+        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.hashear,q.hearfile,q.qlevel,q.sorder
214
+        ,ifnull(q.questionpid,q.questionid)questionpid
209
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
215
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
210
         LEFT JOIN t_paper_qtype_question tq ON psq.questionid=tq.questionid AND psq.paperid=tq.paperid
216
         LEFT JOIN t_paper_qtype_question tq ON psq.questionid=tq.questionid AND psq.paperid=tq.paperid
211
         LEFT JOIN t_paper_qtype t ON tq.ptid=t.ptid
217
         LEFT JOIN t_paper_qtype t ON tq.ptid=t.ptid
479
         </if>
485
         </if>
480
         order by ps.studentid,ps.paperid asc
486
         order by ps.studentid,ps.paperid asc
481
     </select>
487
     </select>
488
+    <!--作业母题列表-->
489
+    <select id="listQuestionByQuestionIds" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
490
+        select questionid,ctype,qstem,qoption,qanswer,qanalyze,q.hashear,q.hearfile,q.qlevel
491
+        from t_question q where questionid in
492
+        <foreach collection="questionids" item="questionid" open="(" separator="," close=")">
493
+            #{questionid}
494
+        </foreach>
495
+    </select>
482
 </mapper>
496
 </mapper>

+ 2
- 1
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

20
             <result property="qanalyze" column="qanalyze"></result>
20
             <result property="qanalyze" column="qanalyze"></result>
21
             <result property="hashear" column="hashear"></result>
21
             <result property="hashear" column="hashear"></result>
22
             <result property="hearfile" column="hearfile"></result>
22
             <result property="hearfile" column="hearfile"></result>
23
+            <result property="qn" column="qn"></result>
23
         </collection>
24
         </collection>
24
     </resultMap>
25
     </resultMap>
25
     <!--获取作业题型列表-->
26
     <!--获取作业题型列表-->
26
     <select id="listPaperType" resultMap="typeResult">
27
     <select id="listPaperType" resultMap="typeResult">
27
-        select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder
28
+        select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder,ptq.qn
28
         ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
29
         ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
29
         ,q.hashear,q.hearfile
30
         ,q.hashear,q.hearfile
30
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
31
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid

+ 1
- 1
sstudy/src/main/resources/mapper/paper/PaperQtypeQuestionMapper.xml View File

31
     <!--获取试卷中主观题数量-->
31
     <!--获取试卷中主观题数量-->
32
     <select id="getQuestionCountCtype" resultType="java.lang.Integer">
32
     <select id="getQuestionCountCtype" resultType="java.lang.Integer">
33
         SELECT COUNT(DISTINCT pqq.questionid) FROM t_paper_qtype_question pqq LEFT JOIN t_question q ON pqq.questionid=q.questionid
33
         SELECT COUNT(DISTINCT pqq.questionid) FROM t_paper_qtype_question pqq LEFT JOIN t_question q ON pqq.questionid=q.questionid
34
-        WHERE pqq.paperid=#{paperid} AND q.ctype=3
34
+        WHERE pqq.paperid=#{paperid} AND q.ctype in(3,13,14,15)
35
     </select>
35
     </select>
36
 
36
 
37
     <!--据试卷id获取试卷中所有试题(试题和分值)-->
37
     <!--据试卷id获取试卷中所有试题(试题和分值)-->

+ 1
- 1
sstudy/src/main/resources/mapper/paper/PaperScantronMapper.xml View File

19
 
19
 
20
     <!--获取试卷中主观题数量-->
20
     <!--获取试卷中主观题数量-->
21
     <select id="getQuestionCountCtype" resultType="java.lang.Integer">
21
     <select id="getQuestionCountCtype" resultType="java.lang.Integer">
22
-       SELECT COUNT(*) FROM t_paper_scantron WHERE paperid=#{paperid} AND ctype=3
22
+       SELECT COUNT(*) FROM t_paper_scantron WHERE paperid=#{paperid} AND ctype in(3,13,14,15)
23
     </select>
23
     </select>
24
 
24
 
25
 </mapper>
25
 </mapper>

+ 2
- 2
sstudy/src/main/resources/mapper/paperstudent/PaperStudedntScantronMapper.xml View File

20
         psc.qtypeid,psc.qtypename,psc.ctype,psc.psanswer,u.username studentname
20
         psc.qtypeid,psc.qtypename,psc.ctype,psc.psanswer,u.username studentname
21
         FROM t_paper_student_scantron pss LEFT JOIN t_user u ON pss.studentid=u.userid
21
         FROM t_paper_student_scantron pss LEFT JOIN t_user u ON pss.studentid=u.userid
22
         LEFT JOIN t_paper_scantron psc ON pss.pscaid = psc.pscaid
22
         LEFT JOIN t_paper_scantron psc ON pss.pscaid = psc.pscaid
23
-        WHERE pss.psid=#{psid} and psc.ctype=3
23
+        WHERE pss.psid=#{psid} and psc.ctype in(3,13,14,15)
24
         order by pss.qorder
24
         order by pss.qorder
25
     </select>
25
     </select>
26
 
26
 
203
         from t_paper_student_scantron pss left join t_paper_scantron ps on pss.pscaid = ps.pscaid
203
         from t_paper_student_scantron pss left join t_paper_scantron ps on pss.pscaid = ps.pscaid
204
         left join t_user u on pss.studentid = u.userid
204
         left join t_user u on pss.studentid = u.userid
205
         left join t_paper_student ps1 on pss.psid=ps1.psid
205
         left join t_paper_student ps1 on pss.psid=ps1.psid
206
-        where pss.paperid=#{paperid} and pss.classid=#{classid} and ps.ctype=3
206
+        where pss.paperid=#{paperid} and pss.classid=#{classid} and ps.ctype in(3,13,14,15)
207
         order by pss.checked,pss.pssid
207
         order by pss.checked,pss.pssid
208
     </select>
208
     </select>
209
     <!--获取学生作业未批改试题数量-->
209
     <!--获取学生作业未批改试题数量-->

+ 14
- 10
sstudy/src/main/resources/mapper/paperstudent/PaperStudentQuestionMapper.xml View File

4
     <!--获取学生作业详情-->
4
     <!--获取学生作业详情-->
5
     <select id="getPaperQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
5
     <select id="getPaperQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
6
         SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
6
         SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
7
-        ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,u.username studentname,psq.psid
8
-        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypename,q.hashear,q.hearfile
7
+        ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore
8
+        ,psq.stuscore,psq.qorder,u.username studentname,psq.psid,psq.qn
9
+        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypename,q.hashear,q.hearfile,q.qlevel,q.sorder
9
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
10
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
10
         ,(CASE WHEN q.ctype IN(16,17) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
11
         ,(CASE WHEN q.ctype IN(16,17) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
11
         ,(CASE WHEN q.questionpid IS NULL THEN ''
12
         ,(CASE WHEN q.questionpid IS NULL THEN ''
12
         ELSE (SELECT json_object('qstem',fq.qstem,'qoption',fq.qoption,'qanswer',fq.qanswer,'qanalyze',fq.qanalyze
13
         ELSE (SELECT json_object('qstem',fq.qstem,'qoption',fq.qoption,'qanswer',fq.qanswer,'qanalyze',fq.qanalyze
13
-            ,'qtypename',fq.qtypename,'hashear',fq.hashear,'hearfile',fq.hearfile)
14
+            ,'qtypename',fq.qtypename,'hashear',fq.hashear,'hearfile',fq.hearfile,'qlevel',fq.qlevel)
14
         FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
15
         FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
15
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
16
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
16
         LEFT JOIN t_user u ON psq.studentid=u.userid
17
         LEFT JOIN t_user u ON psq.studentid=u.userid
19
     <!--获取学生待批改试题列表-->
20
     <!--获取学生待批改试题列表-->
20
     <select id="listCorrectQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
21
     <select id="listCorrectQuestion" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo">
21
         SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
22
         SELECT psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
22
-        ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,u.username studentname,psq.psid
23
+        ,psq.useranswer,psq.answertype,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore
24
+        ,psq.stuscore,psq.qorder,u.username studentname,psq.psid,psq.qn
23
         ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypeid,q.qtypename
25
         ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypeid,q.qtypename
24
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
26
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
25
         ,(CASE WHEN q.ctype IN(7,8) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
27
         ,(CASE WHEN q.ctype IN(7,8) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
26
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
28
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
27
         LEFT JOIN t_user u ON psq.studentid=u.userid
29
         LEFT JOIN t_user u ON psq.studentid=u.userid
28
-        WHERE psq.psid=#{psid} and q.ctype=3
30
+        WHERE psq.psid=#{psid} and q.ctype in(3,13,14,15)
29
         ORDER BY psq.qorder
31
         ORDER BY psq.qorder
30
     </select>
32
     </select>
31
     <!--作业关联试题列表-->
33
     <!--作业关联试题列表-->
32
     <select id="listPaperQuestion" resultType="com.xhkjedu.sstudy.model.paperstudent.TPaperStudentQuestion">
34
     <select id="listPaperQuestion" resultType="com.xhkjedu.sstudy.model.paperstudent.TPaperStudentQuestion">
33
-        SELECT ps.paperid,ps.classid,ps.studentid,ptq.questionid,ptq.ptqscore AS qscore,ptq.ptqorder qorder,ps.schoolid,ps.psid
35
+        SELECT ps.paperid,ps.classid,ps.studentid,ptq.questionid,ptq.ptqscore AS qscore,ptq.ptqorder qorder
36
+        ,ps.schoolid,ps.psid,ptq.qn
34
         FROM t_paper_student ps LEFT JOIN t_paper_qtype_question ptq ON ps.paperid=ptq.paperid WHERE ps.psid=#{psid}
37
         FROM t_paper_student ps LEFT JOIN t_paper_qtype_question ptq ON ps.paperid=ptq.paperid WHERE ps.psid=#{psid}
35
     </select>
38
     </select>
36
     <!--批量保存-->
39
     <!--批量保存-->
37
     <insert id="batchSave" parameterType="java.util.List">
40
     <insert id="batchSave" parameterType="java.util.List">
38
-        INSERT INTO t_paper_student_question (paperid,classid,studentid,questionid,qscore,qorder,schoolid,psid)
41
+        INSERT INTO t_paper_student_question (paperid,classid,studentid,questionid,qscore,qorder,qn,schoolid,psid)
39
         VALUES
42
         VALUES
40
         <foreach collection ="list" item="r" index= "index" separator =",">
43
         <foreach collection ="list" item="r" index= "index" separator =",">
41
-            (#{r.paperid},#{r.classid},#{r.studentid},#{r.questionid},#{r.qscore},#{r.qorder},#{r.schoolid},#{r.psid})
44
+            (#{r.paperid},#{r.classid},#{r.studentid},#{r.questionid},#{r.qscore},#{r.qorder},#{r.qn},#{r.schoolid},#{r.psid})
42
         </foreach>
45
         </foreach>
43
     </insert>
46
     </insert>
44
     <!--获取学生未提交试题集合-->
47
     <!--获取学生未提交试题集合-->
72
     <resultMap id="questionResult" type="java.util.Map">
75
     <resultMap id="questionResult" type="java.util.Map">
73
         <result property="qscore" column="qscore"></result>
76
         <result property="qscore" column="qscore"></result>
74
         <result property="qorder" column="qorder"></result>
77
         <result property="qorder" column="qorder"></result>
78
+        <result property="qn" column="qn"></result>
75
         <result property="qstem" column="qstem"></result>
79
         <result property="qstem" column="qstem"></result>
76
         <result property="qoption" column="qoption"></result>
80
         <result property="qoption" column="qoption"></result>
77
         <result property="qanswer" column="qanswer"></result>
81
         <result property="qanswer" column="qanswer"></result>
94
         </collection>
98
         </collection>
95
     </resultMap>
99
     </resultMap>
96
     <select id="qcorrectList" resultMap="questionResult">
100
     <select id="qcorrectList" resultMap="questionResult">
97
-        select psq.qscore,psq.qorder,q.qstem,q.qoption,q.qanswer,q.qanalyze
101
+        select psq.qscore,psq.qorder,psq.qn,q.qstem,q.qoption,q.qanswer,q.qanalyze
98
         ,psq.stuscore,psq.answered,psq.checked,psq.checkcomm,psq.psid,psq.psqid
102
         ,psq.stuscore,psq.answered,psq.checked,psq.checkcomm,psq.psid,psq.psqid
99
         ,psq.device,psq.useranswer,psq.converted,psq.answertype,psq.useranswertext,psq.useranswertxt,u.username,ps.psstate
103
         ,psq.device,psq.useranswer,psq.converted,psq.answertype,psq.useranswertext,psq.useranswertxt,u.username,ps.psstate
100
         from t_paper_student_question psq left join t_question q on psq.questionid = q.questionid
104
         from t_paper_student_question psq left join t_question q on psq.questionid = q.questionid
101
         left join t_user u on psq.studentid = u.userid
105
         left join t_user u on psq.studentid = u.userid
102
         left join t_paper_student ps on psq.psid=ps.psid
106
         left join t_paper_student ps on psq.psid=ps.psid
103
-        where psq.paperid=#{paperid} and psq.classid=#{classid} and q.ctype=3
107
+        where psq.paperid=#{paperid} and psq.classid=#{classid} and q.ctype in(3,13,14,15)
104
         order by psq.checked,psq.psqid
108
         order by psq.checked,psq.psqid
105
     </select>
109
     </select>
106
     <!--获取学生作业未批改试题数量-->
110
     <!--获取学生作业未批改试题数量-->

+ 2
- 2
sstudy/src/main/resources/mapper/question/QuestionClassMapper.xml View File

192
         select ps.psanswer qanswer,qc.qscore,qc.qctype,qc.avgscore,qc.errorrate,qc.paperid,qc.classid,qc.questionid
192
         select ps.psanswer qanswer,qc.qscore,qc.qctype,qc.avgscore,qc.errorrate,qc.paperid,qc.classid,qc.questionid
193
         ,pss.useranswer section,count(pss.pssid)stunum,pss.stuscore,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
193
         ,pss.useranswer section,count(pss.pssid)stunum,pss.stuscore,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
194
         from (select max(qcid)qcid,questionid from t_question_class
194
         from (select max(qcid)qcid,questionid from t_question_class
195
-        where questionid=#{question.questionid} and classid=#{question.classid} and qctype=3)a
195
+        where questionid=#{question.questionid} and classid=#{question.classid} and qctype in(3,13,14,15))a
196
         left join t_question_class qc on a.qcid=qc.qcid
196
         left join t_question_class qc on a.qcid=qc.qcid
197
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
197
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
198
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)
198
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)
237
         ,pss.stuscore,u.username stuname
237
         ,pss.stuscore,u.username stuname
238
         ,(select count(*) from t_classroom_paper_student ps where ps.paperid=qc.paperid and ps.classid=qc.classid)wtjnum
238
         ,(select count(*) from t_classroom_paper_student ps where ps.paperid=qc.paperid and ps.classid=qc.classid)wtjnum
239
         from (select max(qcid)qcid,questionid from t_question_class
239
         from (select max(qcid)qcid,questionid from t_question_class
240
-        where questionid=#{question.questionid} and classid=#{question.classid} and qctype=3)a
240
+        where questionid=#{question.questionid} and classid=#{question.classid} and qctype in(3,13,14,15))a
241
         left join t_question_class qc on a.qcid=qc.qcid
241
         left join t_question_class qc on a.qcid=qc.qcid
242
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
242
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
243
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)
243
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)

Loading…
Cancel
Save