Bläddra i källkod

作业完善

tags/正式版本
雍文秀 2 år sedan
förälder
incheckning
df3feb7ce0

+ 4
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperAnalyzeMapper.java Visa fil

@@ -13,6 +13,7 @@ import com.xhkjedu.sstudy.vo.paper.PaperAnalyzeVo;
13 13
 import com.xhkjedu.sstudy.vo.paper.PaperCAnalyzeVo;
14 14
 import com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo;
15 15
 import com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo;
16
+import com.xhkjedu.sstudy.vo.paperstudent.PaperStudentQuestionVo;
16 17
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
17 18
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
18 19
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPointScoreVo;
@@ -218,4 +219,7 @@ public interface PaperAnalyzeMapper extends TkMapper<TPaperAnalyze> {
218 219
 
219 220
     //作业统计--按学生--年级下所有学生作业情况
220 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 Visa fil

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

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/paperstudent/TPaperStudentQuestion.java Visa fil

@@ -82,6 +82,8 @@ public class TPaperStudentQuestion extends BaseBean {
82 82
 
83 83
     private Integer converted;//是否转换0未转换1已转换2转换失败
84 84
 
85
+    private String qn;//显示题号
86
+
85 87
     @Transient
86 88
     //试题题型id
87 89
     private String qtypeid;

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperAnalyzeService.java Visa fil

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

+ 4
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java Visa fil

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

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java Visa fil

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

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentWebService.java Visa fil

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

+ 45
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/utils/StudyUtil.java Visa fil

@@ -1,6 +1,10 @@
1 1
 package com.xhkjedu.sstudy.utils;
2 2
 
3 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 8
 import lombok.extern.slf4j.Slf4j;
5 9
 import org.springframework.http.HttpEntity;
6 10
 import org.springframework.http.HttpHeaders;
@@ -11,9 +15,11 @@ import org.springframework.web.client.RestClientException;
11 15
 import org.springframework.web.client.RestTemplate;
12 16
 
13 17
 import java.util.ArrayList;
18
+import java.util.LinkedHashMap;
14 19
 import java.util.List;
15 20
 import java.util.Map;
16 21
 import java.util.concurrent.ConcurrentHashMap;
22
+import java.util.stream.Collectors;
17 23
 
18 24
 import static com.xhkjedu.utils.N_Utils.getSecondTimestamp;
19 25
 
@@ -65,4 +71,43 @@ public class StudyUtil {
65 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 Visa fil

@@ -2,6 +2,8 @@ package com.xhkjedu.sstudy.vo.paperstudent;
2 2
 
3 3
 import lombok.Data;
4 4
 
5
+import java.util.List;
6
+
5 7
 @Data
6 8
 public class PaperStudentQuestionVo {
7 9
     //试卷学生id
@@ -104,4 +106,10 @@ public class PaperStudentQuestionVo {
104 106
     private String mhearfile;//母题听力题文件地址
105 107
     private Integer hashear;//是否是听力题0不是1是
106 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 Visa fil

@@ -126,4 +126,5 @@ public class QuestionVo {
126 126
     //子题
127 127
     private List<Map> sonqlist;
128 128
 
129
+    private String qn;//显示题号
129 130
 }

+ 18
- 4
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml Visa fil

@@ -53,8 +53,8 @@
53 53
         ,(select u2.username from t_user u2 where u2.userid=ps.checkid)checkname
54 54
         from(select ps.psid,ps.studentid,ps.checkid,ps.userscore,ps.stoptime answertime,ps.costtime,ps.psstate,ps.pschecked
55 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 58
         from t_paper_student ps left join
59 59
         <if test="paper.papertype==1 or paper.papertype==3">
60 60
             t_paper_student_question psq on ps.psid=psq.psid left join t_question q on psq.questionid=q.questionid
@@ -198,14 +198,20 @@
198 198
             <result property="checkcomm" column="checkcomm"></result>
199 199
             <result property="hashear" column="hashear"></result>
200 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 205
         </collection>
202 206
     </resultMap>
203 207
     <!--作业统计 按人详情 题型列表-->
204 208
     <select id="listPeopleDetailAnalyze" resultMap="typeQuestion">
205 209
         SELECT t.qtypename,t.ptorder,t.ptscore,t.ptnum
206 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 215
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
210 216
         LEFT JOIN t_paper_qtype_question tq ON psq.questionid=tq.questionid AND psq.paperid=tq.paperid
211 217
         LEFT JOIN t_paper_qtype t ON tq.ptid=t.ptid
@@ -479,4 +485,12 @@
479 485
         </if>
480 486
         order by ps.studentid,ps.paperid asc
481 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 496
 </mapper>

+ 2
- 1
sstudy/src/main/resources/mapper/paper/PaperMapper.xml Visa fil

@@ -20,11 +20,12 @@
20 20
             <result property="qanalyze" column="qanalyze"></result>
21 21
             <result property="hashear" column="hashear"></result>
22 22
             <result property="hearfile" column="hearfile"></result>
23
+            <result property="qn" column="qn"></result>
23 24
         </collection>
24 25
     </resultMap>
25 26
     <!--获取作业题型列表-->
26 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 29
         ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
29 30
         ,q.hashear,q.hearfile
30 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 Visa fil

@@ -31,7 +31,7 @@
31 31
     <!--获取试卷中主观题数量-->
32 32
     <select id="getQuestionCountCtype" resultType="java.lang.Integer">
33 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 35
     </select>
36 36
 
37 37
     <!--据试卷id获取试卷中所有试题(试题和分值)-->

+ 1
- 1
sstudy/src/main/resources/mapper/paper/PaperScantronMapper.xml Visa fil

@@ -19,7 +19,7 @@
19 19
 
20 20
     <!--获取试卷中主观题数量-->
21 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 23
     </select>
24 24
 
25 25
 </mapper>

+ 2
- 2
sstudy/src/main/resources/mapper/paperstudent/PaperStudedntScantronMapper.xml Visa fil

@@ -20,7 +20,7 @@
20 20
         psc.qtypeid,psc.qtypename,psc.ctype,psc.psanswer,u.username studentname
21 21
         FROM t_paper_student_scantron pss LEFT JOIN t_user u ON pss.studentid=u.userid
22 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 24
         order by pss.qorder
25 25
     </select>
26 26
 
@@ -203,7 +203,7 @@
203 203
         from t_paper_student_scantron pss left join t_paper_scantron ps on pss.pscaid = ps.pscaid
204 204
         left join t_user u on pss.studentid = u.userid
205 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 207
         order by pss.checked,pss.pssid
208 208
     </select>
209 209
     <!--获取学生作业未批改试题数量-->

+ 14
- 10
sstudy/src/main/resources/mapper/paperstudent/PaperStudentQuestionMapper.xml Visa fil

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

+ 2
- 2
sstudy/src/main/resources/mapper/question/QuestionClassMapper.xml Visa fil

@@ -192,7 +192,7 @@
192 192
         select ps.psanswer qanswer,qc.qscore,qc.qctype,qc.avgscore,qc.errorrate,qc.paperid,qc.classid,qc.questionid
193 193
         ,pss.useranswer section,count(pss.pssid)stunum,pss.stuscore,group_concat(u.username order by convert(u.username using gbk) separator '  ')stuname
194 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 196
         left join t_question_class qc on a.qcid=qc.qcid
197 197
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
198 198
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)
@@ -237,7 +237,7 @@
237 237
         ,pss.stuscore,u.username stuname
238 238
         ,(select count(*) from t_classroom_paper_student ps where ps.paperid=qc.paperid and ps.classid=qc.classid)wtjnum
239 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 241
         left join t_question_class qc on a.qcid=qc.qcid
242 242
         left join t_classroom_paper_scantron ps on qc.questionid=ps.pscaid
243 243
         left join t_classroom_paper_student_scantron pss on ps.pscaid=pss.pscaid and (pss.answered=1 or pss.checked=1)

Laddar…
Avbryt
Spara