|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
4
|
4
|
import com.xhkjedu.exception.MissingParametersException;
|
5
|
5
|
import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
|
6
|
6
|
import com.xhkjedu.smarking.mapper.paper.*;
|
|
7
|
+import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherMapper;
|
7
|
8
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentMapper;
|
8
|
9
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
|
9
|
10
|
import com.xhkjedu.smarking.mapper.system.SchoolMapper;
|
|
@@ -54,6 +55,12 @@ public class MsPaperQtypeService {
|
54
|
55
|
private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
|
55
|
56
|
@Resource
|
56
|
57
|
private MsPaperStudentMapper msPaperStudentMapper;
|
|
58
|
+ @Resource
|
|
59
|
+ private MsPaperCheckTeacherMapper msPaperCheckTeacherMapper;
|
|
60
|
+ @Resource
|
|
61
|
+ private MsPaperBlockMapper msPaperBlockMapper;
|
|
62
|
+ @Resource
|
|
63
|
+ private MsTemplateMapper msTemplateMapper;
|
57
|
64
|
private final ConvertUtil convertUtil;
|
58
|
65
|
|
59
|
66
|
public MsPaperQtypeService(ConvertUtil convertUtil) {
|
|
@@ -75,16 +82,18 @@ public class MsPaperQtypeService {
|
75
|
82
|
PExamSubjectVo exam = msPaperMapper.getExamSubjectForPaper(mpid);
|
76
|
83
|
//线下考试,发布成绩(生成报告)之前可以修改试卷结构
|
77
|
84
|
if(exam.getExammode() < 3 && exam.getExamstate() > 2){
|
78
|
|
- throw new MissingParametersException("考试已结束禁止操作");
|
|
85
|
+ throw new MissingParametersException("考试统分禁止操作");
|
79
|
86
|
}
|
80
|
87
|
|
81
|
|
- if(exam.getExammode() == 3 && exam.getExamstate() > 0){
|
82
|
|
- throw new MissingParametersException("考试已开始禁止操作");
|
|
88
|
+ if(exam.getExammode() == 3 && exam.getPstate() == 2){
|
|
89
|
+ throw new MissingParametersException("试卷已提交禁止操作");
|
83
|
90
|
}
|
84
|
91
|
|
85
|
92
|
//先删除原有题型、分析
|
86
|
93
|
msPaperQtypeMapper.deleteByMpId(mpid);
|
87
|
94
|
msPaperAnalyzeMapper.deleteByMpId(mpid);
|
|
95
|
+
|
|
96
|
+
|
88
|
97
|
//根据考试类型(线上和线下),是否删除文件
|
89
|
98
|
if(paper.getPtype() == 2){
|
90
|
99
|
msPaperFileMapper.deleteByMpid(mpid);
|
|
@@ -117,10 +126,14 @@ public class MsPaperQtypeService {
|
117
|
126
|
userBasketMapper.deleteByUseridAndSubjectid(paper.getCreateid(),exam.getSubjectid());
|
118
|
127
|
}
|
119
|
128
|
|
|
129
|
+ msPaperCheckTeacherMapper.deleteByMpid(mpid);//删除批阅教师
|
120
|
130
|
if(exam.getExammode() < 3){
|
121
|
|
- //如果是线下考试更改了试卷结构,则清空后续所有操作
|
|
131
|
+ //如果是线下考试更改了试卷结构,则清空题块、试卷模板
|
122
|
132
|
msPaperMapper.deleteTemplageBlockByMpid(mpid);
|
123
|
133
|
msPaperStudentMapper.deletePaperStuByMpid(mpid);
|
|
134
|
+ msSubjectMapper.updatePaperFollowup(mpid);
|
|
135
|
+ }else{
|
|
136
|
+ msSubjectMapper.updateCheckSetByMpId(mpid,0);
|
124
|
137
|
}
|
125
|
138
|
|
126
|
139
|
if(N_Utils.isListNotEmpty(imgs) && imgs.size()>1){
|
|
@@ -195,7 +208,7 @@ public class MsPaperQtypeService {
|
195
|
208
|
}
|
196
|
209
|
|
197
|
210
|
//保存试卷分析--题库
|
198
|
|
- public void savePaperAnalyzeForQuestion(MsPaper paper){
|
|
211
|
+ private void savePaperAnalyzeForQuestion(MsPaper paper){
|
199
|
212
|
Integer mpid = paper.getMpid();
|
200
|
213
|
//保存之前先清除之前的试卷分析
|
201
|
214
|
msPaperAnalyzeMapper.deleteByMpId(paper.getMpid());
|
|
@@ -1150,6 +1163,7 @@ public class MsPaperQtypeService {
|
1150
|
1163
|
questionMap.put("loseoption",questionVo.getLoseoption());
|
1151
|
1164
|
questionMap.put("scoreset",questionVo.getScoreset());
|
1152
|
1165
|
questionMap.put("complexity",questionVo.getComplexity());
|
|
1166
|
+ questionMap.put("optionnum",questionVo.getOptionnum());
|
1153
|
1167
|
questionMap.put("points",questionVo.getPoints());
|
1154
|
1168
|
questionsList.add(questionMap);
|
1155
|
1169
|
}
|
|
@@ -1160,6 +1174,7 @@ public class MsPaperQtypeService {
|
1160
|
1174
|
typeMap.put("mptorder",qtypeVo.getMptorder());
|
1161
|
1175
|
typeMap.put("mptnum",qtypeVo.getMptnum());
|
1162
|
1176
|
typeMap.put("mptscore",qtypeVo.getMptscore());
|
|
1177
|
+ typeMap.put("ctype",qtypeVo.getCtype());
|
1163
|
1178
|
typeMap.put("questions",questionsList);
|
1164
|
1179
|
qtypes.add(typeMap);
|
1165
|
1180
|
}
|