Browse Source

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

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

+ 8
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

70
             return new ResultVo(1,"不能进行操作");
70
             return new ResultVo(1,"不能进行操作");
71
         }
71
         }
72
 
72
 
73
+        List<EPaperQtype> qtypelist = paper.getQtypelist();
74
+        List<EPaperQtypeQuestion> questions = new ArrayList<>();
75
+        qtypelist.forEach(t -> {
76
+            questions.addAll(t.getQuestions());
77
+        });
78
+        long count = questions.stream().map(q -> q.getQn()).distinct().count();
79
+        if (count < questions.size()) return new ResultVo(1, "题号不能重复");
80
+
73
         //说明已经有改考试对应的试卷,删除试卷中试题,试卷分析
81
         //说明已经有改考试对应的试卷,删除试卷中试题,试卷分析
74
         ePaperQtypeMapper.deleteByEpid(espVo.getEpid());
82
         ePaperQtypeMapper.deleteByEpid(espVo.getEpid());
75
         ePaperAnalyzeMapper.deleteByEpid(espVo.getEpid());
83
         ePaperAnalyzeMapper.deleteByEpid(espVo.getEpid());
76
         ePaperFileMapper.deleteByEpid(espVo.getEpid());
84
         ePaperFileMapper.deleteByEpid(espVo.getEpid());
77
 
85
 
78
-        List<EPaperQtype> qtypelist = paper.getQtypelist();
79
         List<EPaperQtypeQuestion> queslist = new ArrayList<>();//存放试题
86
         List<EPaperQtypeQuestion> queslist = new ArrayList<>();//存放试题
80
         paper.setEpid(espVo.getEpid());
87
         paper.setEpid(espVo.getEpid());
81
         setEPaperBaseDetail(paper,qtypelist);
88
         setEPaperBaseDetail(paper,qtypelist);

+ 6
- 6
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml View File

6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
8
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
8
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
9
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(pc.classid)classids
9
+        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
10
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
10
         ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
11
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
11
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
13
         left join e_paper_correctclass pc on p.epid = pc.epid
13
         left join e_paper_correctclass pc on p.epid = pc.epid
14
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
14
         left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
15
-        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15)
15
+        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
16
         union
16
         union
17
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
17
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
18
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
18
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
20
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
20
         ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
22
         left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
23
-        where pq.teacherid=#{teacherid})a left join e_subject es on a.esid = es.esid
23
+        where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
24
         left join e_base eb on es.examid = eb.examid
24
         left join e_base eb on es.examid = eb.examid
25
         where a.tjnum!=a.pynum group by a.epid
25
         where a.tjnum!=a.pynum group by a.epid
26
     </select>
26
     </select>
28
     <select id="listMarked" resultType="java.util.Map">
28
     <select id="listMarked" resultType="java.util.Map">
29
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
29
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
30
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
30
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
31
-        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(pc.classid)classids
31
+        ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(distinct pc.classid)classids
32
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
32
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
33
         left join e_paper_correctclass pc on p.epid = pc.epid
33
         left join e_paper_correctclass pc on p.epid = pc.epid
34
-        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15)
34
+        where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15) group by p.epid
35
         union
35
         union
36
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
36
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
37
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
37
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
38
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
38
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
39
-        where pq.teacherid=#{teacherid})a left join e_subject es on a.esid = es.esid
39
+        where pq.teacherid=#{teacherid} group by p.epid)a left join e_subject es on a.esid = es.esid
40
         left join e_base eb on es.examid = eb.examid
40
         left join e_base eb on es.examid = eb.examid
41
         left join e_paper_student ps on a.epid=ps.epid
41
         left join e_paper_student ps on a.epid=ps.epid
42
         group by a.epid
42
         group by a.epid

Loading…
Cancel
Save