Browse Source

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

tags/正式版本
王宁 2 years ago
parent
commit
d7be892200

+ 9
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

73
             Integer examid = model.getId();
73
             Integer examid = model.getId();
74
 
74
 
75
             ResultVo vo = saveExam(model, examid);//保存考试基本信息
75
             ResultVo vo = saveExam(model, examid);//保存考试基本信息
76
-            if (vo != null) return vo;
76
+            if (vo != null) throw new Exception(vo.getMsg());
77
 
77
 
78
             return new ResultVo(0, "保存成功", examid);
78
             return new ResultVo(0, "保存成功", examid);
79
         } catch (Exception e) {
79
         } catch (Exception e) {
80
             log.error("发起考试失败", e.getMessage());
80
             log.error("发起考试失败", e.getMessage());
81
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
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
     private ResultVo saveExam(EBase model, Integer examid) {
87
     private ResultVo saveExam(EBase model, Integer examid) {
88
         List<Integer> classids = model.getClassids();
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
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
93
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
92
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
94
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
93
         if (stuNum < students.size()) return new ResultVo(1, "有重复学生");
95
         if (stuNum < students.size()) return new ResultVo(1, "有重复学生");
303
     public ResultVo delStu(Integer ecsid) {
305
     public ResultVo delStu(Integer ecsid) {
304
         EClassStudent student = eClassStudentMapper.selectByPrimaryKey(ecsid);
306
         EClassStudent student = eClassStudentMapper.selectByPrimaryKey(ecsid);
305
         EBaseVo exam = eBaseMapper.getExamStateById(student.getExamid());
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
         int timestamp = N_Utils.getSecondTimestamp() + 30 * 60;
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
         eClassStudentMapper.deleteByPrimaryKey(ecsid);
312
         eClassStudentMapper.deleteByPrimaryKey(ecsid);
310
         eClassMapper.updateClassNumByCsId(student.getExamid(), student.getClassid());
313
         eClassMapper.updateClassNumByCsId(student.getExamid(), student.getClassid());
311
         return new ResultVo(0, "移除考试学生成功");
314
         return new ResultVo(0, "移除考试学生成功");

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

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

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

141
                 q.setMqanswer(mt.getQanswer());
141
                 q.setMqanswer(mt.getQanswer());
142
                 q.setMqanalyze(mt.getQanalyze());
142
                 q.setMqanalyze(mt.getQanalyze());
143
                 q.setMqtypename(mt.getQtypename());
143
                 q.setMqtypename(mt.getQtypename());
144
+                q.setMhashear(mt.getHashear());
145
+                q.setMhearfile(mt.getHearfile());
144
             }
146
             }
145
         }
147
         }
146
         return list;
148
         return list;

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

97
     private String mqanswer;//母题答案
97
     private String mqanswer;//母题答案
98
     private String mqanalyze;//母题解析
98
     private String mqanalyze;//母题解析
99
     private String mqtypename;//母题题型名称
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 View File

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

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

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

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

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.converted,psq.useranswertext,psq.useranswertxt,psq.checked,psq.qscore,psq.stuscore,psq.qorder,u.username studentname,psq.psid
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
         ,(CASE WHEN psq.checked=1 AND psq.stuscore=psq.qscore THEN 1 ELSE 2 END)corrected
9
         ,(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
10
         ,(CASE WHEN q.ctype IN(16,17) THEN JSON_LENGTH(q.qoption) ELSE 0 END)qoptioncount
11
         ,(CASE WHEN q.questionpid IS NULL THEN ''
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
         FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
14
         FROM t_question fq WHERE fq.questionid=q.questionpid) END)mqstem
14
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
15
         FROM t_paper_student_question psq LEFT JOIN t_question q ON psq.questionid=q.questionid
15
         LEFT JOIN t_user u ON psq.studentid=u.userid
16
         LEFT JOIN t_user u ON psq.studentid=u.userid

+ 1
- 1
sstudy/src/main/resources/mapper/question/QuestionMapper.xml View File

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

Loading…
Cancel
Save