Ver código fonte

Merge remote-tracking branch 'origin/ywx' into wn_j

tags/正式版本
王宁 2 anos atrás
pai
commit
cd9b6d01e4

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java Ver arquivo

@@ -178,6 +178,7 @@ public class EBaseController {
178 178
         String examname = exam.getExamname();
179 179
         Integer schoolid = exam.getSchoolid();
180 180
         if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
181
+        if (exam.getAnswered() == 0) return new ResultVo(1, "还有考试试卷未设置正确答案");
181 182
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
182 183
 
183 184
         List<UserVo> students = eBaseService.listStuByExamId(examid);//获取考生

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/exam/EBaseVo.java Ver arquivo

@@ -34,6 +34,9 @@ public class EBaseVo {
34 34
     //试卷未设置完成数量
35 35
     private Integer wwcnum;
36 36
 
37
+    //是否设置正确答案0未设置1已设置
38
+    private Integer answered;
39
+
37 40
     //考试开始时间
38 41
     private Integer begintime;
39 42
 }

+ 2
- 1
sexam/src/main/resources/mapper/exam/EBaseMapper.xml Ver arquivo

@@ -62,9 +62,10 @@
62 62
     <!--根据考试id获取考试状态-->
63 63
     <select id="getExamStateById" resultType="com.xhkjedu.sexam.vo.exam.EBaseVo">
64 64
         select eb.examid,eb.examname,eb.gradeid,eb.examstate,eb.schoolid
65
-        ,count(case when es.esstate!=1 then es.esid else null end)wwcnum
65
+        ,count(case when es.esstate!=1 then es.esid else null end)wwcnum,min(ep.answered)answered
66 66
         ,min(ifnull(UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime)),0))begintime
67 67
         from e_base eb left join e_subject es on eb.examid = es.examid
68
+        left join e_paper ep on es.esid = ep.esid
68 69
         where eb.examid=#{examid}
69 70
     </select>
70 71
     <!--考试设置状态-->

Carregando…
Cancelar
Salvar