Parcourir la source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 il y a 2 ans
Parent
révision
d7be892200

+ 9
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java Voir le fichier

@@ -73,21 +73,23 @@ public class EBaseService {
73 73
             Integer examid = model.getId();
74 74
 
75 75
             ResultVo vo = saveExam(model, examid);//保存考试基本信息
76
-            if (vo != null) return vo;
76
+            if (vo != null) throw new Exception(vo.getMsg());
77 77
 
78 78
             return new ResultVo(0, "保存成功", examid);
79 79
         } catch (Exception e) {
80 80
             log.error("发起考试失败", e.getMessage());
81 81
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
82
-            return new ResultVo(1, "保存失败");
82
+            return new ResultVo(1, e.getMessage());
83 83
         }
84 84
     }
85 85
 
86 86
     //保存考试基本信息
87 87
     private ResultVo saveExam(EBase model, Integer examid) {
88 88
         List<Integer> classids = model.getClassids();
89
-        Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
90
-        if (num != 0) return new ResultVo(1, "有学生没有考号");
89
+        if(model.getExammode() == 2) {//线下考试必须有考号
90
+            Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
91
+            if (num != 0) return new ResultVo(1, "有学生没有考号");
92
+        }
91 93
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
92 94
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
93 95
         if (stuNum < students.size()) return new ResultVo(1, "有重复学生");
@@ -303,9 +305,10 @@ public class EBaseService {
303 305
     public ResultVo delStu(Integer ecsid) {
304 306
         EClassStudent student = eClassStudentMapper.selectByPrimaryKey(ecsid);
305 307
         EBaseVo exam = eBaseMapper.getExamStateById(student.getExamid());
306
-        if (2 == exam.getExamstate()) return new ResultVo(1, "考试已结束禁止操作");
308
+        if (0 != exam.getExamstate()) return new ResultVo(1, "考试已发布禁止操作");
307 309
         int timestamp = N_Utils.getSecondTimestamp() + 30 * 60;
308
-        if (exam.getBegintime().compareTo(timestamp) != 1) return new ResultVo(1, "开考前30分钟禁止移除学生");
310
+        Integer begintime = exam.getBegintime();
311
+        if (begintime != 0 && begintime.compareTo(timestamp) != 1) return new ResultVo(1, "开考前30分钟禁止移除学生");
309 312
         eClassStudentMapper.deleteByPrimaryKey(ecsid);
310 313
         eClassMapper.updateClassNumByCsId(student.getExamid(), student.getClassid());
311 314
         return new ResultVo(0, "移除考试学生成功");

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java Voir le fichier

@@ -334,6 +334,9 @@ public class PaperService {
334 334
         //处理答题卡--题型--试题
335 335
         List<TPaperQtypeQuestion> ptqs = new ArrayList<>();
336 336
         for (TPaperQtype qtype : qtypes) {
337
+            if("tlt".equals(qtype.getQtypeid())){
338
+                qtype.setQtypeid(null);
339
+            }
337 340
             List<QuestionVo> questions = qtype.getQuestions();//题型下试题
338 341
             qtype.setCreateid(createid);
339 342
             qtype.setCreatetime(N_Utils.getSecondTimestamp());

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java Voir le fichier

@@ -141,6 +141,8 @@ public class PaperStudentService {
141 141
                 q.setMqanswer(mt.getQanswer());
142 142
                 q.setMqanalyze(mt.getQanalyze());
143 143
                 q.setMqtypename(mt.getQtypename());
144
+                q.setMhashear(mt.getHashear());
145
+                q.setMhearfile(mt.getHearfile());
144 146
             }
145 147
         }
146 148
         return list;

+ 4
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/paperstudent/PaperStudentQuestionVo.java Voir le fichier

@@ -97,4 +97,8 @@ public class PaperStudentQuestionVo {
97 97
     private String mqanswer;//母题答案
98 98
     private String mqanalyze;//母题解析
99 99
     private String mqtypename;//母题题型名称
100
+    private Integer mhashear;//母题是否是听力题0不是1是
101
+    private String mhearfile;//母题听力题文件地址
102
+    private Integer hashear;//是否是听力题0不是1是
103
+    private String hearfile;//听力题文件地址
100 104
 }

+ 3
- 1
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml Voir le fichier

@@ -195,6 +195,8 @@
195 195
             <result property="complexity" column="complexity"></result>
196 196
             <result property="pointname" column="pointname"></result>
197 197
             <result property="checkcomm" column="checkcomm"></result>
198
+            <result property="hashear" column="hashear"></result>
199
+            <result property="hearfile" column="hearfile"></result>
198 200
         </collection>
199 201
     </resultMap>
200 202
     <!--作业统计 按人详情 题型列表-->
@@ -202,7 +204,7 @@
202 204
         SELECT t.qtypename,t.ptorder,t.ptscore,t.ptnum
203 205
         ,psq.psqid,psq.paperid,psq.studentid,psq.answered,psq.answertime,psq.costtime,psq.device,psq.checkcomm
204 206
         ,psq.useranswer,psq.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,psq.psid
205
-        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity
207
+        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.hashear,q.hearfile
206 208
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
207 209
         LEFT JOIN t_paper_qtype_question tq ON psq.questionid=tq.questionid AND psq.paperid=tq.paperid
208 210
         LEFT JOIN t_paper_qtype t ON tq.ptid=t.ptid

+ 4
- 1
sstudy/src/main/resources/mapper/paper/PaperMapper.xml Voir le fichier

@@ -18,12 +18,15 @@
18 18
             <result property="qoption" column="qoption"></result>
19 19
             <result property="qanswer" column="qanswer"></result>
20 20
             <result property="qanalyze" column="qanalyze"></result>
21
+            <result property="hashear" column="hashear"></result>
22
+            <result property="hearfile" column="hearfile"></result>
21 23
         </collection>
22 24
     </resultMap>
23 25
     <!--获取作业题型列表-->
24 26
     <select id="listPaperType" resultMap="typeResult">
25 27
         select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder
26 28
         ,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
27 30
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
28 31
         left join t_question q on ptq.questionid = q.questionid
29 32
         where pt.paperid=#{paperid} order by pt.ptorder,ptq.ptqid
@@ -272,7 +275,7 @@
272 275
     </select>
273 276
     <!--作业母题列表-->
274 277
     <select id="listQuestionByQuestionIds" resultType="com.xhkjedu.sstudy.vo.question.QuestionVo">
275
-        select questionid,ctype,qstem,qoption,qanswer,qanalyze
278
+        select questionid,ctype,qstem,qoption,qanswer,qanalyze,q.hashear,q.hearfile
276 279
         from t_question q where questionid in
277 280
         <foreach collection="questionids" item="questionid" open="(" separator="," close=")">
278 281
             #{questionid}

+ 3
- 2
sstudy/src/main/resources/mapper/paperstudent/PaperStudentQuestionMapper.xml Voir le fichier

@@ -5,11 +5,12 @@
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 7
         ,psq.useranswer,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
8
+        ,q.questionid,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype,q.complexity,q.qtypename,q.hashear,q.hearfile
9 9
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
10 10
         ,(CASE WHEN q.ctype IN(16,17) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
11 11
         ,(CASE WHEN q.questionpid IS NULL THEN ''
12
-        ELSE (SELECT json_object('qstem',fq.qstem,'qoption',fq.qoption,'qanswer',fq.qanswer,'qanalyze',fq.qanalyze,'qtypename',fq.qtypename)
12
+        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)
13 14
         FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
14 15
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
15 16
         LEFT JOIN t_user u ON psq.studentid=u.userid

+ 1
- 1
sstudy/src/main/resources/mapper/question/QuestionMapper.xml Voir le fichier

@@ -287,7 +287,7 @@
287 287
 
288 288
     <select id="listSonQuestionForSelect" resultType="java.util.Map">
289 289
         select q.questionid,q.score,q.complexity,q.qstem,q.qoption,q.qanswer,q.qanalyze
290
-        ,q.qtypeid,q.qtypename,q.ctype,q.qlevel,q.sorder
290
+        ,q.qtypeid,q.qtypename,q.ctype,q.qlevel,q.sorder,q.hashear,q.hearfile
291 291
         from t_question q where q.qlevel=3 and q.questionpid=#{questionid} order by q.sorder
292 292
     </select>
293 293
     <!--修改试题状态-->

Chargement…
Annuler
Enregistrer