Browse Source

发布考试完善

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

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

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

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/exam/EBaseVo.java View File

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

+ 2
- 1
sexam/src/main/resources/mapper/exam/EBaseMapper.xml View File

62
     <!--根据考试id获取考试状态-->
62
     <!--根据考试id获取考试状态-->
63
     <select id="getExamStateById" resultType="com.xhkjedu.sexam.vo.exam.EBaseVo">
63
     <select id="getExamStateById" resultType="com.xhkjedu.sexam.vo.exam.EBaseVo">
64
         select eb.examid,eb.examname,eb.gradeid,eb.examstate,eb.schoolid
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
         ,min(ifnull(UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime)),0))begintime
66
         ,min(ifnull(UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime)),0))begintime
67
         from e_base eb left join e_subject es on eb.examid = es.examid
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
         where eb.examid=#{examid}
69
         where eb.examid=#{examid}
69
     </select>
70
     </select>
70
     <!--考试设置状态-->
71
     <!--考试设置状态-->

Loading…
Cancel
Save