|
@@ -6,6 +6,7 @@ import com.xhkjedu.sexam.mapper.exam.EClassMapper;
|
6
|
6
|
import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
|
7
|
7
|
import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
|
8
|
8
|
import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
|
|
9
|
+import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
|
9
|
10
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
|
10
|
11
|
import com.xhkjedu.sexam.mapper.system.UserMapper;
|
11
|
12
|
import com.xhkjedu.sexam.model.exam.EBase;
|
|
@@ -14,7 +15,9 @@ import com.xhkjedu.sexam.model.exam.EClass;
|
14
|
15
|
import com.xhkjedu.sexam.model.exam.EClassStudent;
|
15
|
16
|
import com.xhkjedu.sexam.model.exam.ESubject;
|
16
|
17
|
import com.xhkjedu.sexam.model.paper.EPaper;
|
|
18
|
+import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
|
17
|
19
|
import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
|
|
20
|
+import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
|
18
|
21
|
import com.xhkjedu.sexam.vo.exam.EBaseVo;
|
19
|
22
|
import com.xhkjedu.sexam.vo.system.UserVo;
|
20
|
23
|
import com.xhkjedu.utils.N_Utils;
|
|
@@ -49,6 +52,8 @@ public class EBaseService {
|
49
|
52
|
private EPaperStudentMapper ePaperStudentMapper;
|
50
|
53
|
@Resource
|
51
|
54
|
private EBaseMacMapper eBaseMacMapper;
|
|
55
|
+ @Resource
|
|
56
|
+ private EPaperQtypeMapper ePaperQtypeMapper;
|
52
|
57
|
|
53
|
58
|
/**
|
54
|
59
|
* 发起考试
|
|
@@ -173,7 +178,7 @@ public class EBaseService {
|
173
|
178
|
|
174
|
179
|
//发布考试
|
175
|
180
|
@Transactional(rollbackFor = Exception.class)
|
176
|
|
- public void updateExamStateStart(Integer examid, String examcomm, List<UserVo> students) {
|
|
181
|
+ public void updateExamStateStart(Integer examid, String examcomm, List<UserVo> students,Integer exammode) {
|
177
|
182
|
//更改考试状态
|
178
|
183
|
eBaseMapper.postExam(examid, examcomm);
|
179
|
184
|
//发布考试,获取考试试卷题量和分值
|
|
@@ -206,6 +211,29 @@ public class EBaseService {
|
206
|
211
|
}
|
207
|
212
|
}
|
208
|
213
|
ePaperStudentMapper.insertList(studentList);//保存考试学生信息
|
|
214
|
+
|
|
215
|
+ if(exammode == 2){
|
|
216
|
+ //代表线下考试,生成学生和试题的关联关系
|
|
217
|
+ List<EPaperStudentQuestion> stuqlist = new ArrayList<>();
|
|
218
|
+ for (EPaper paper : papers) {
|
|
219
|
+ Integer epid = paper.getEpid();
|
|
220
|
+ //获取试卷中所有试题
|
|
221
|
+ List<EPaperQtypeQuestion> queslist = ePaperQtypeMapper.listQuestionsByEpid(epid);
|
|
222
|
+ for (EPaperStudent ps : studentList) {
|
|
223
|
+ for(EPaperQtypeQuestion q : queslist){
|
|
224
|
+ EPaperStudentQuestion epsq = new EPaperStudentQuestion();
|
|
225
|
+ epsq.setClassid(ps.getClassid());
|
|
226
|
+ epsq.setStudentid(ps.getStudentid());
|
|
227
|
+ epsq.setEpid(ps.getEpid());
|
|
228
|
+ epsq.setEpsid(ps.getId());
|
|
229
|
+ epsq.setEptqid(q.getEptqid());
|
|
230
|
+
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+ }
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+ }
|
209
|
237
|
}
|
210
|
238
|
|
211
|
239
|
//结束考试
|