|
@@ -1,11 +1,19 @@
|
1
|
1
|
package com.xhkjedu.smarking.service.paper;
|
2
|
2
|
|
3
|
|
-import com.xhkjedu.smarking.mapper.paper.MsPaperQtypeMapper;
|
4
|
|
-import com.xhkjedu.smarking.model.paper.MsPaperQtype;
|
|
3
|
+import com.alibaba.fastjson.JSON;
|
|
4
|
+import com.xhkjedu.smarking.mapper.paper.*;
|
|
5
|
+import com.xhkjedu.smarking.model.paper.*;
|
|
6
|
+import com.xhkjedu.smarking.utils.ConvertUtil;
|
|
7
|
+import com.xhkjedu.smarking.vo.paper.*;
|
|
8
|
+import com.xhkjedu.utils.N_Utils;
|
|
9
|
+import com.xhkjedu.vo.ResultVo;
|
|
10
|
+import org.springframework.beans.factory.annotation.Autowired;
|
5
|
11
|
import org.springframework.stereotype.Service;
|
|
12
|
+import org.springframework.transaction.annotation.Transactional;
|
6
|
13
|
|
7
|
14
|
import javax.annotation.Resource;
|
8
|
|
-import java.util.List;
|
|
15
|
+import java.util.*;
|
|
16
|
+import java.util.stream.Collectors;
|
9
|
17
|
|
10
|
18
|
/**
|
11
|
19
|
* @Description 阅卷试卷题型表 服务实现类
|
|
@@ -16,6 +24,16 @@ import java.util.List;
|
16
|
24
|
public class MsPaperQtypeService {
|
17
|
25
|
@Resource
|
18
|
26
|
private MsPaperQtypeMapper msPaperQtypeMapper;
|
|
27
|
+ @Resource
|
|
28
|
+ private MsPaperAnalyzeMapper msPaperAnalyzeMapper;
|
|
29
|
+ @Resource
|
|
30
|
+ private MsPaperMapper msPaperMapper;
|
|
31
|
+ @Resource
|
|
32
|
+ private MsPaperQtypeQuestionMapper msPaperQtypeQuestionMapper;
|
|
33
|
+ @Resource
|
|
34
|
+ private MsPaperFileMapper msPaperFileMapper;
|
|
35
|
+ @Autowired
|
|
36
|
+ private ConvertUtil convertUtil;
|
19
|
37
|
|
20
|
38
|
/**
|
21
|
39
|
* @Description 新增
|
|
@@ -24,18 +42,718 @@ public class MsPaperQtypeService {
|
24
|
42
|
* @Date 2024-10-15
|
25
|
43
|
* @return void
|
26
|
44
|
**/
|
27
|
|
- public void add(MsPaperQtype msPaperQtype){
|
28
|
|
- msPaperQtypeMapper.insert(msPaperQtype);
|
|
45
|
+ @Transactional(rollbackFor = Exception.class)
|
|
46
|
+ public ResultVo savePaperQtype(MsPaper paper){
|
|
47
|
+
|
|
48
|
+ //先删除原有题型、分析
|
|
49
|
+ msPaperQtypeMapper.deleteByMpId(paper.getMpid());
|
|
50
|
+ msPaperAnalyzeMapper.deleteByMpId(paper.getMpid());
|
|
51
|
+ //根据考试类型(线上和线下),是否删除文件
|
|
52
|
+
|
|
53
|
+ List<MsPaperQtype> qtypeList = paper.getQtypes();
|
|
54
|
+ List<MsPaperQtypeQuestion> questionList = new ArrayList<>();
|
|
55
|
+ int timestamp = N_Utils.getSecondTimestamp();
|
|
56
|
+ paper.setCreatetime(timestamp);
|
|
57
|
+ setPaperBaseDetail(paper,qtypeList);
|
|
58
|
+ msPaperMapper.updatePaperInfo(paper);
|
|
59
|
+ //保存题型试题信息
|
|
60
|
+ savePaperQtype(paper,qtypeList,questionList);
|
|
61
|
+
|
|
62
|
+ List<String> imgs = new ArrayList<>();
|
|
63
|
+ //保存试卷分析
|
|
64
|
+ if(paper.getPtype() == 1){
|
|
65
|
+ savePaperAnalyzeForQuestion(paper);
|
|
66
|
+ }else{
|
|
67
|
+ List<MsPaperFile> pfiles = paper.getPfiles();//附件
|
|
68
|
+ if(paper.getHasfile() == 1){
|
|
69
|
+ setPaperFiles(paper,pfiles,imgs);
|
|
70
|
+ msPaperFileMapper.insertList(pfiles);
|
|
71
|
+ }
|
|
72
|
+ savePaperAnalyzeForFj(paper,qtypeList,questionList);
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+ //更加试卷状态是否需要生成分析和更改科目状态
|
|
76
|
+ // if(espVo.getExammode() == 1 && paper.getPstate()!=null && paper.getPstate() == 1){
|
|
77
|
+ // //如果提交试卷,更改科目状态
|
|
78
|
+ // eSubjectMapper.updateExamSubjectState(1,espVo.getEsid());
|
|
79
|
+ // }
|
|
80
|
+ //保存后清除试题栏中试题
|
|
81
|
+ // userBasketMapper.deleteByUseridAndSubjectid(paper.getCreateid(),espVo.getSubjectid());
|
|
82
|
+
|
|
83
|
+ if(N_Utils.isListNotEmpty(imgs) && imgs.size()>1){
|
|
84
|
+ //说明上传的附件文件为图片,并且图片为多张,调用mq合并
|
|
85
|
+ convertUtil.imgToPdf(imgs,paper.getMpid());
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ return new ResultVo(0,"保存成功",paper.getMpid());
|
29
|
89
|
}
|
30
|
90
|
|
31
|
|
- /**
|
32
|
|
- * @Description 列表
|
33
|
|
- * @Param [msPaperQtype]
|
34
|
|
- * @Author auto
|
35
|
|
- * @Date 2024-10-15
|
36
|
|
- * @return java.util.List<com.xhkjedu.smarking.model.paper.MsPaperQtype>
|
|
91
|
+ //设置试卷基本信息
|
|
92
|
+ private void setPaperBaseDetail(MsPaper paper,List<MsPaperQtype> qtypelist){
|
|
93
|
+ if(paper.getPtype() == 2 && paper.getPfiles()!=null && paper.getPfiles().size()>0){
|
|
94
|
+ paper.setHasfile(1);
|
|
95
|
+ }else {
|
|
96
|
+ paper.setHasfile(0);
|
|
97
|
+ }
|
|
98
|
+ double pscore = qtypelist.stream().collect(Collectors.summingDouble(MsPaperQtype:: getMptscore));
|
|
99
|
+ int pnum = qtypelist.stream().collect(Collectors.summingInt(MsPaperQtype:: getMptnum));
|
|
100
|
+ paper.setPnum(pnum);
|
|
101
|
+ paper.setPscore(pscore);
|
|
102
|
+ paper.setHandletime(paper.getCreatetime());
|
|
103
|
+ paper.setHandleid(paper.getCreateid());
|
|
104
|
+ if(paper.getPtype() == 1){
|
|
105
|
+ paper.setAnswered(1);//题库已设置正确答案
|
|
106
|
+ }else{
|
|
107
|
+ paper.setAnswered(0);
|
|
108
|
+ }
|
|
109
|
+
|
|
110
|
+ if(paper.getHearnum() == null){
|
|
111
|
+ paper.setHearnum(0);
|
|
112
|
+ }
|
|
113
|
+ }
|
|
114
|
+
|
|
115
|
+ //保存试卷题型试题信息
|
|
116
|
+ private void savePaperQtype(MsPaper paper,List<MsPaperQtype> qtypelist,List<MsPaperQtypeQuestion> qtqs){
|
|
117
|
+ for(MsPaperQtype qtype : qtypelist){
|
|
118
|
+ qtype.setMpid(paper.getMpid());
|
|
119
|
+ qtype.setCreateid(paper.getHandleid());
|
|
120
|
+ qtype.setCreatetime(paper.getHandletime());
|
|
121
|
+ qtype.setMptname(N_Utils.strTrim(qtype.getMptname()));
|
|
122
|
+ }
|
|
123
|
+ msPaperQtypeMapper.insertList(qtypelist);//保存题型
|
|
124
|
+ for(MsPaperQtype qtype : qtypelist){
|
|
125
|
+ List<MsPaperQtypeQuestion> questions = qtype.getQuestions();
|
|
126
|
+ qtype.setMptid(qtype.getId());
|
|
127
|
+
|
|
128
|
+ for (int i = 0; i < questions.size(); i++) {
|
|
129
|
+ MsPaperQtypeQuestion q=questions.get(i);
|
|
130
|
+ q.setMpid(paper.getMpid());
|
|
131
|
+ q.setMptid(qtype.getId());
|
|
132
|
+ if(q.getOptionnum()==null){
|
|
133
|
+ q.setOptionnum(0);
|
|
134
|
+ }
|
|
135
|
+ if(q.getLoseoption() == null){
|
|
136
|
+ q.setLoseoption(0);
|
|
137
|
+ }
|
|
138
|
+ if(q.getScoreset() == null){
|
|
139
|
+ q.setScoreset(0);
|
|
140
|
+ }
|
|
141
|
+
|
|
142
|
+ qtqs.add(q);
|
|
143
|
+ }
|
|
144
|
+ }
|
|
145
|
+ msPaperQtypeQuestionMapper.insertList(qtqs);
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ //保存试卷分析--题库
|
|
149
|
+ public void savePaperAnalyzeForQuestion(MsPaper paper){
|
|
150
|
+ //保存之前先清除之前的试卷分析
|
|
151
|
+ msPaperAnalyzeMapper.deleteByMpId(paper.getMpid());
|
|
152
|
+ //总体分析(主观题、客观题)
|
|
153
|
+ List<MsPaperQtypeVo> qtypelist = msPaperQtypeMapper.listPaperQtypeQuestions(paper.getMpid());//试卷题型试题信息
|
|
154
|
+ List<MsPaperQtypeQuestion> uplist = new ArrayList<>();//改试卷中客观题选项数量
|
|
155
|
+ List<QuestionOrderVo> pointqlist = new ArrayList<>();//用于存放知识点,以及知识点下得分
|
|
156
|
+ List<MsPaperQtypeQuestionVo> mquestions = new ArrayList<>();//存放单题和母题
|
|
157
|
+ List<QuestionOrderVo> complexitylist = new ArrayList<>();//试题难易度存放试题
|
|
158
|
+ List<QuestionPointVo> quesplist = new ArrayList<>();//单题、母题对应知识点
|
|
159
|
+
|
|
160
|
+ //处理出试卷中所有试题、知识点
|
|
161
|
+ List<Map> typelist = new ArrayList<>();//题型分析
|
|
162
|
+ for(MsPaperQtypeVo qt : qtypelist){
|
|
163
|
+ List<Integer> qorderlist = new ArrayList<>();
|
|
164
|
+ List<QuestionOrderVo> qtypeqlist = new ArrayList<>();
|
|
165
|
+ List<MsPaperQtypeQuestionVo> tqlist = qt.getQuestions();
|
|
166
|
+ int hasmt = 0;
|
|
167
|
+ for(MsPaperQtypeQuestionVo q : tqlist){
|
|
168
|
+ int ctype = q.getCtype();
|
|
169
|
+ //单题的pid设置为默认值,方便后续进行单题和母题处理
|
|
170
|
+ if(q.getQlevel()==1){
|
|
171
|
+ q.setQuestionpid("000");
|
|
172
|
+ //判断试题是否是客观题
|
|
173
|
+ if(N_Utils.isObjectiveQuestion(ctype)){
|
|
174
|
+ //判断试题是否是客观题,暂时用mctype进行标识
|
|
175
|
+ q.setMctype(111);
|
|
176
|
+ }else{
|
|
177
|
+ q.setMctype(112);
|
|
178
|
+ }
|
|
179
|
+ //设置知识点
|
|
180
|
+ mquestions.add(q);
|
|
181
|
+ //获取试题知识点
|
|
182
|
+ List<Map> qpoints = q.getPoints();
|
|
183
|
+ //处理试题知识点占分
|
|
184
|
+ setPaperQuestionPointScore(pointqlist,quesplist,qpoints,q,null,null);
|
|
185
|
+ setPaperQuestionQtypeScore(qtypeqlist,q,null,null);//处理试题题型
|
|
186
|
+ setPaperQuestionComplexityScore(complexitylist,q,null,null);//处理试题难易度
|
|
187
|
+ }
|
|
188
|
+ if(q.getQlevel() == 3){
|
|
189
|
+ hasmt ++;
|
|
190
|
+ }
|
|
191
|
+ if(!qorderlist.contains(q.getQorder())){
|
|
192
|
+ qorderlist.add(q.getQorder());
|
|
193
|
+ }
|
|
194
|
+ //为了处理客观题中选项数量
|
|
195
|
+ if(ctype == 1 || ctype ==2 || ctype==4 || ctype ==5 || ctype==6){
|
|
196
|
+ List<String> strlst = JSON.parseArray(q.getQoption(), String.class);
|
|
197
|
+ MsPaperQtypeQuestion eqq = new MsPaperQtypeQuestion();
|
|
198
|
+ eqq.setMptqid(q.getMptqid());
|
|
199
|
+ eqq.setOptionnum(strlst.size());
|
|
200
|
+ uplist.add(eqq);
|
|
201
|
+ }
|
|
202
|
+ }
|
|
203
|
+
|
|
204
|
+ if(hasmt > 0){
|
|
205
|
+ //说明该题型下有复合题,复合体进行知识点、题型下试题题号及id进行操作
|
|
206
|
+ LinkedHashMap<String,List<MsPaperQtypeQuestionVo>> quesMap = tqlist.stream().collect(Collectors.groupingBy(MsPaperQtypeQuestionVo:: getQuestionpid, LinkedHashMap::new, Collectors.toList()));
|
|
207
|
+ for(Map.Entry<String, List<MsPaperQtypeQuestionVo>> entry : quesMap.entrySet()){
|
|
208
|
+ if(!entry.getKey().equals("000")){
|
|
209
|
+ //说明该题为母题,
|
|
210
|
+ MsPaperQtypeQuestionVo mq = new MsPaperQtypeQuestionVo();
|
|
211
|
+ List<MsPaperQtypeQuestionVo> sonques = entry.getValue();
|
|
212
|
+ int k = 0;//如果k大于1说明有小题是主观题,则母题为主观题
|
|
213
|
+ double score = 0;
|
|
214
|
+ for(MsPaperQtypeQuestionVo sq : sonques){
|
|
215
|
+ if(!N_Utils.isObjectiveQuestion(sq.getCtype())){
|
|
216
|
+ k++;
|
|
217
|
+ }
|
|
218
|
+ score = N_Utils.getDoubleSum(score,sq.getScore());
|
|
219
|
+ }
|
|
220
|
+
|
|
221
|
+ MsPaperQtypeQuestionVo qobj = sonques.get(0);
|
|
222
|
+ mq.setQuestionid(qobj.getQuestionpid());
|
|
223
|
+ mq.setComplexity(qobj.getMcomplexity());
|
|
224
|
+ mq.setQorder(qobj.getQorder());
|
|
225
|
+ mq.setScore(score);
|
|
226
|
+ mq.setQtypename(qobj.getMqtypename());
|
|
227
|
+ if(k == 0){
|
|
228
|
+ mq.setMctype(111);
|
|
229
|
+ }else{
|
|
230
|
+ mq.setMctype(112);
|
|
231
|
+ }
|
|
232
|
+ mq.setQlevel(qobj.getMqlevel());
|
|
233
|
+ mq.setSonques(sonques);
|
|
234
|
+ //获取所有子题的试题题号
|
|
235
|
+ List<String> qns = sonques.stream().map(MsPaperQtypeQuestionVo::getQn).collect(Collectors.toList());
|
|
236
|
+ String[] qnstr = qns.stream().toArray(String[]::new);
|
|
237
|
+ //所有子题的试题eptqid
|
|
238
|
+ List<Integer> eptqids = sonques.stream().map(MsPaperQtypeQuestionVo::getMptqid).collect(Collectors.toList());
|
|
239
|
+ Integer[] eptqidstr = eptqids.stream().toArray(Integer[]::new);
|
|
240
|
+
|
|
241
|
+ //获取知识点
|
|
242
|
+ List<Map> qpoints = sonques.get(0).getPoints();
|
|
243
|
+ mq.setPoints(qpoints);
|
|
244
|
+ mquestions.add(mq);
|
|
245
|
+ setPaperQuestionPointScore(pointqlist,quesplist,qpoints,mq,qnstr,eptqids);
|
|
246
|
+ setPaperQuestionQtypeScore(qtypeqlist,mq,qnstr,eptqidstr);//处理试题题型
|
|
247
|
+ setPaperQuestionComplexityScore(complexitylist,mq,qnstr,eptqidstr);//处理试题难易度
|
|
248
|
+ }
|
|
249
|
+ }
|
|
250
|
+ }
|
|
251
|
+
|
|
252
|
+ //试题题型分析数据
|
|
253
|
+ double storerate = N_Utils.getDoubleDivideAndMulitiply(qt.getMptscore(), paper.getPscore());
|
|
254
|
+ Map tmap = new TreeMap();
|
|
255
|
+ tmap.put("qtid",qt.getMptid());
|
|
256
|
+ tmap.put("qtname",qt.getMptname());
|
|
257
|
+ tmap.put("num",qt.getMptnum());
|
|
258
|
+ tmap.put("score",qt.getMptscore());
|
|
259
|
+ tmap.put("srate",storerate);
|
|
260
|
+ qtypeqlist = qtypeqlist.stream().sorted(Comparator.comparing(QuestionOrderVo::getOrder)).collect(Collectors.toList());
|
|
261
|
+ tmap.put("ques",qtypeqlist);
|
|
262
|
+ typelist.add(tmap);
|
|
263
|
+ }
|
|
264
|
+
|
|
265
|
+ //进行客观题选项处理
|
|
266
|
+ if(N_Utils.isListNotEmpty(uplist)){
|
|
267
|
+ msPaperQtypeQuestionMapper.updateBatchQuestionOptionnum(uplist);
|
|
268
|
+ }
|
|
269
|
+
|
|
270
|
+ //试题总体分布进行分析
|
|
271
|
+ //客观题集合
|
|
272
|
+ List<MsPaperQtypeQuestionVo> ktlst = mquestions.stream().filter(q->q.getMctype() == 111).collect(Collectors.toList());
|
|
273
|
+ int ktnum = ktlst.size();
|
|
274
|
+ double ktscore = ktlst.stream().collect(Collectors.summingDouble(MsPaperQtypeQuestionVo:: getScore));
|
|
275
|
+ double ktnrate = N_Utils.getIntegerDivideAndMulitiply(ktnum, paper.getPnum());
|
|
276
|
+ double ktsrate = N_Utils.getDoubleDivideAndMulitiply(ktscore, paper.getPscore());
|
|
277
|
+ List<MsPaperQsVo> ranglist = new ArrayList<>();
|
|
278
|
+ ranglist.add(new MsPaperQsVo("客观题",ktscore,ktnum,ktsrate,ktnrate));
|
|
279
|
+ MsPaperQsVo zgq = new MsPaperQsVo();
|
|
280
|
+ zgq.setQtname("主观题");
|
|
281
|
+ zgq.setNum(paper.getPnum() - ktnum);
|
|
282
|
+ zgq.setNrate(N_Utils.getDoubleReduce(100.0,ktnrate));
|
|
283
|
+ zgq.setScore(N_Utils.getDoubleReduce(paper.getPscore(),ktscore));
|
|
284
|
+ zgq.setSrate(N_Utils.getDoubleReduce(100.0,ktsrate));
|
|
285
|
+ ranglist.add(zgq);
|
|
286
|
+ Map ztmap = new TreeMap<>();
|
|
287
|
+ ztmap.put("pnum", paper.getPnum());
|
|
288
|
+ ztmap.put("pscore",paper.getPscore());
|
|
289
|
+ ztmap.put("ranglist",ranglist);
|
|
290
|
+
|
|
291
|
+ //难易度
|
|
292
|
+ List<Map> clist = new ArrayList<>();
|
|
293
|
+ if(N_Utils.isListNotEmpty(complexitylist)){
|
|
294
|
+ Map<String,List<QuestionOrderVo>> complxmap = complexitylist.stream().collect(Collectors.groupingBy(QuestionOrderVo:: getId, Collectors.toList()));
|
|
295
|
+ for(Map.Entry<String, List<QuestionOrderVo>> entry : complxmap.entrySet()){
|
|
296
|
+ List<QuestionOrderVo> pgblist = entry.getValue();
|
|
297
|
+ Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
|
|
298
|
+ score = N_Utils.formatDouble(score,1);
|
|
299
|
+ Double srate = N_Utils.getDoubleDivideAndMulitiply(score,paper.getPscore());
|
|
300
|
+ Map prate = new TreeMap();
|
|
301
|
+ prate.put("level",Integer.parseInt(entry.getKey()));
|
|
302
|
+ prate.put("score",score);
|
|
303
|
+ prate.put("srate",srate);
|
|
304
|
+ prate.put("ques",pgblist.stream().sorted(Comparator.comparing(QuestionOrderVo::getOrder)).collect(Collectors.toList()));
|
|
305
|
+ clist.add(prate);
|
|
306
|
+ }
|
|
307
|
+ }
|
|
308
|
+
|
|
309
|
+ //知识点分析
|
|
310
|
+ List<Map> pointlist = new ArrayList<>();
|
|
311
|
+ if(N_Utils.isListNotEmpty(pointqlist)){
|
|
312
|
+ LinkedHashMap<String,List<QuestionOrderVo>> pointmap = pointqlist.stream().collect(Collectors.groupingBy(QuestionOrderVo::getId,LinkedHashMap::new,Collectors.toList()));
|
|
313
|
+ //根据指示进行分组,
|
|
314
|
+ for(Map.Entry<String, List<QuestionOrderVo>> entry : pointmap.entrySet()){
|
|
315
|
+ List<QuestionOrderVo> pgblist = entry.getValue();
|
|
316
|
+ //获取知识点的总分
|
|
317
|
+ Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
|
|
318
|
+ score = N_Utils.formatDouble(score,1);
|
|
319
|
+ Double srate = N_Utils.getDoubleDivideAndMulitiply(score,paper.getPscore());
|
|
320
|
+ Map prate = new LinkedHashMap();
|
|
321
|
+ prate.put("pointid",entry.getKey());
|
|
322
|
+ prate.put("pointname",pgblist.get(0).getName());
|
|
323
|
+ prate.put("score",score);
|
|
324
|
+ prate.put("srate",srate);
|
|
325
|
+ prate.put("ques",pgblist.stream().sorted(Comparator.comparing(QuestionOrderVo::getOrder)).collect(Collectors.toList()));
|
|
326
|
+ pointlist.add(prate);
|
|
327
|
+ }
|
|
328
|
+ }
|
|
329
|
+
|
|
330
|
+ MsPaperAnalyze epa = new MsPaperAnalyze();
|
|
331
|
+ epa.setMpid(paper.getMpid());
|
|
332
|
+ epa.setAlljson(JSON.toJSONString(ztmap));//总体分析
|
|
333
|
+ epa.setQnumjson(JSON.toJSONString(typelist));//试题栏题型分析
|
|
334
|
+ epa.setComplexityjson(JSON.toJSONString(clist));//难易度分析
|
|
335
|
+ epa.setPointjson(JSON.toJSONString(pointlist));//知识点分析
|
|
336
|
+ epa.setQuespointjson(JSON.toJSONString(quesplist));
|
|
337
|
+ msPaperAnalyzeMapper.insertUseGeneratedKeys(epa);
|
|
338
|
+ }
|
|
339
|
+
|
|
340
|
+ //设置知识点
|
|
341
|
+ private void setPaperQuestionPointScore(List<QuestionOrderVo> pointqlist,List<QuestionPointVo> quesplist,List<Map> qpoints,MsPaperQtypeQuestionVo dq,String[] qnstr,List<Integer> mptqids){
|
|
342
|
+ if(N_Utils.isListNotEmpty(qpoints)){
|
|
343
|
+ if(qpoints.size() == 1){
|
|
344
|
+ //试题只有一个知识点
|
|
345
|
+ Map pointmap = qpoints.get(0);
|
|
346
|
+ QuestionOrderVo qpoint = new QuestionOrderVo();
|
|
347
|
+ qpoint.setId(pointmap.get("pointid").toString());
|
|
348
|
+ qpoint.setName(pointmap.get("pointname").toString());
|
|
349
|
+ qpoint.setOrder(dq.getQorder());
|
|
350
|
+ qpoint.setScore(dq.getScore());
|
|
351
|
+ qpoint.setQlevel(dq.getQlevel());
|
|
352
|
+ qpoint.setQuestionid(dq.getQuestionid());
|
|
353
|
+ if(qnstr == null){
|
|
354
|
+ qpoint.setQns(new String[]{dq.getQn()});
|
|
355
|
+ }else{
|
|
356
|
+ qpoint.setQns(qnstr);
|
|
357
|
+ }
|
|
358
|
+
|
|
359
|
+ if(N_Utils.isListEmpty(mptqids)){
|
|
360
|
+ qpoint.setMptqids(new Integer[]{dq.getMptqid()});
|
|
361
|
+ }else{
|
|
362
|
+ Integer[] mptqidstr = mptqids.stream().toArray(Integer[]::new);
|
|
363
|
+ qpoint.setMptqids(mptqidstr);
|
|
364
|
+ }
|
|
365
|
+ pointqlist.add(qpoint);
|
|
366
|
+
|
|
367
|
+ //试题对应知识点
|
|
368
|
+ QuestionPointVo questionPointVo = new QuestionPointVo();
|
|
369
|
+ questionPointVo.setOrder(dq.getQorder());
|
|
370
|
+ questionPointVo.setScore(dq.getScore());
|
|
371
|
+ questionPointVo.setQlevel(dq.getQlevel());
|
|
372
|
+ questionPointVo.setQuestionid(dq.getQuestionid());
|
|
373
|
+ List<Map> pointids = new ArrayList<>();
|
|
374
|
+ Map map = new HashMap();
|
|
375
|
+ map.put("pointid",pointmap.get("pointid").toString());
|
|
376
|
+ map.put("score",dq.getScore());
|
|
377
|
+ pointids.add(map);
|
|
378
|
+ questionPointVo.setPointids(pointids);
|
|
379
|
+
|
|
380
|
+ if(N_Utils.isListEmpty(mptqids)){
|
|
381
|
+ List<Integer> saveids = new ArrayList<>();
|
|
382
|
+ saveids.add(dq.getMptqid());
|
|
383
|
+ questionPointVo.setMptqids(saveids);
|
|
384
|
+ questionPointVo.setMptqid(dq.getMptqid());
|
|
385
|
+ }else{
|
|
386
|
+ questionPointVo.setMptqids(mptqids);
|
|
387
|
+ questionPointVo.setMptqid(0);
|
|
388
|
+ }
|
|
389
|
+ quesplist.add(questionPointVo);
|
|
390
|
+ }else{
|
|
391
|
+
|
|
392
|
+ //试题有多个知识点
|
|
393
|
+ //计算每个知识点所占分值(平均分配)
|
|
394
|
+ Double[] avgps = N_Utils.getPointAvgScore(qpoints.size(),dq.getScore());
|
|
395
|
+ List<Map> pointids = new ArrayList<>();
|
|
396
|
+ for(int m = 0; m<qpoints.size();m++){
|
|
397
|
+ Map pointmap = qpoints.get(m);
|
|
398
|
+ QuestionOrderVo qpoint = new QuestionOrderVo();
|
|
399
|
+ qpoint.setId(pointmap.get("pointid").toString());
|
|
400
|
+ qpoint.setName(pointmap.get("pointname").toString());
|
|
401
|
+ qpoint.setOrder(dq.getQorder());
|
|
402
|
+ qpoint.setQlevel(dq.getQlevel());
|
|
403
|
+ qpoint.setQuestionid(dq.getQuestionid());
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+ Map quesmap = new HashMap();//试题对应知识点
|
|
407
|
+ quesmap.put("pointid",pointmap.get("pointid").toString());
|
|
408
|
+
|
|
409
|
+ if(avgps.length == 2 && (m+1) == qpoints.size()){
|
|
410
|
+ //不能整除分,并且是最后一个知识点
|
|
411
|
+ qpoint.setScore(avgps[1]);
|
|
412
|
+ quesmap.put("score",avgps[1]);
|
|
413
|
+ }else{
|
|
414
|
+ qpoint.setScore(avgps[0]);
|
|
415
|
+ quesmap.put("score",avgps[0]);
|
|
416
|
+ }
|
|
417
|
+ pointids.add(quesmap);
|
|
418
|
+
|
|
419
|
+ //题号集合
|
|
420
|
+ if(qnstr == null){
|
|
421
|
+ qpoint.setQns(new String[]{dq.getQn()});
|
|
422
|
+ }else{
|
|
423
|
+ qpoint.setQns(qnstr);
|
|
424
|
+ }
|
|
425
|
+ //试卷中试题id集合
|
|
426
|
+ if(N_Utils.isListEmpty(mptqids)){
|
|
427
|
+ qpoint.setMptqids(new Integer[]{dq.getMptqid()});
|
|
428
|
+ }else{
|
|
429
|
+ Integer[] eptqidstr = mptqids.stream().toArray(Integer[]::new);
|
|
430
|
+ qpoint.setMptqids(eptqidstr);
|
|
431
|
+ }
|
|
432
|
+ pointqlist.add(qpoint);
|
|
433
|
+ }
|
|
434
|
+
|
|
435
|
+ //试题对应知识点
|
|
436
|
+ QuestionPointVo questionPointVo = new QuestionPointVo();
|
|
437
|
+ questionPointVo.setOrder(dq.getQorder());
|
|
438
|
+ questionPointVo.setScore(dq.getScore());
|
|
439
|
+ questionPointVo.setQlevel(dq.getQlevel());
|
|
440
|
+ questionPointVo.setQuestionid(dq.getQuestionid());
|
|
441
|
+ questionPointVo.setPointids(pointids);
|
|
442
|
+ if(N_Utils.isListEmpty(mptqids)){
|
|
443
|
+ List<Integer> saveids = new ArrayList<>();
|
|
444
|
+ saveids.add(dq.getMptqid());
|
|
445
|
+ questionPointVo.setMptqids(saveids);
|
|
446
|
+ questionPointVo.setMptqid(dq.getMptqid());
|
|
447
|
+
|
|
448
|
+ }else{
|
|
449
|
+ questionPointVo.setMptqids(mptqids);
|
|
450
|
+ questionPointVo.setMptqid(0);
|
|
451
|
+ }
|
|
452
|
+ quesplist.add(questionPointVo);
|
|
453
|
+
|
|
454
|
+ }
|
|
455
|
+ } else{
|
|
456
|
+ QuestionPointVo questionPointVo = new QuestionPointVo();
|
|
457
|
+ questionPointVo.setOrder(dq.getQorder());
|
|
458
|
+ questionPointVo.setScore(dq.getScore());
|
|
459
|
+ questionPointVo.setQlevel(dq.getQlevel());
|
|
460
|
+ questionPointVo.setQuestionid(dq.getQuestionid());
|
|
461
|
+ questionPointVo.setPointids(null);
|
|
462
|
+ if(N_Utils.isListEmpty(mptqids)){
|
|
463
|
+ List<Integer> saveids = new ArrayList<>();
|
|
464
|
+ saveids.add(dq.getMptqid());
|
|
465
|
+ questionPointVo.setMptqids(saveids);
|
|
466
|
+ questionPointVo.setMptqid(dq.getMptqid());
|
|
467
|
+ }else{
|
|
468
|
+ questionPointVo.setMptqids(mptqids);
|
|
469
|
+ questionPointVo.setMptqid(0);
|
|
470
|
+ }
|
|
471
|
+
|
|
472
|
+ quesplist.add(questionPointVo);
|
|
473
|
+ }
|
|
474
|
+ }
|
|
475
|
+
|
|
476
|
+ //设置题型下试题题号及分值
|
|
477
|
+ private void setPaperQuestionQtypeScore(List<QuestionOrderVo> qtypelist,MsPaperQtypeQuestionVo dq,String[] qnstr,Integer[] mptqidstr){
|
|
478
|
+ QuestionOrderVo qtype = new QuestionOrderVo();
|
|
479
|
+ qtype.setId(dq.getQtypeid());
|
|
480
|
+ qtype.setName(dq.getQtypename());
|
|
481
|
+ qtype.setComplexity(dq.getComplexity());
|
|
482
|
+ qtype.setOrder(dq.getQorder());
|
|
483
|
+ qtype.setScore(dq.getScore());
|
|
484
|
+ qtype.setQlevel(dq.getQlevel());
|
|
485
|
+ qtype.setQuestionid(dq.getQuestionid());
|
|
486
|
+ if(qnstr == null){
|
|
487
|
+ qtype.setQns(new String[]{dq.getQn()});
|
|
488
|
+ }else{
|
|
489
|
+ qtype.setQns(qnstr);
|
|
490
|
+ }
|
|
491
|
+ if(mptqidstr == null){
|
|
492
|
+ qtype.setMptqids(new Integer[]{dq.getMptqid()});
|
|
493
|
+ }else{
|
|
494
|
+ qtype.setMptqids(mptqidstr);
|
|
495
|
+ }
|
|
496
|
+
|
|
497
|
+ qtypelist.add(qtype);
|
|
498
|
+ }
|
|
499
|
+
|
|
500
|
+ //设置试题难易度
|
|
501
|
+ private void setPaperQuestionComplexityScore(List<QuestionOrderVo> complexityList,MsPaperQtypeQuestionVo dq,String[] qnstr,Integer[] mptqidstr){
|
|
502
|
+ QuestionOrderVo qtype = new QuestionOrderVo();
|
|
503
|
+ qtype.setId(dq.getComplexity().toString());//存放试题难易度
|
|
504
|
+ qtype.setOrder(dq.getQorder());
|
|
505
|
+ qtype.setScore(dq.getScore());
|
|
506
|
+ qtype.setQlevel(dq.getQlevel());
|
|
507
|
+ qtype.setQuestionid(dq.getQuestionid());
|
|
508
|
+ if(qnstr == null){
|
|
509
|
+ qtype.setQns(new String[]{dq.getQn()});
|
|
510
|
+ }else{
|
|
511
|
+ qtype.setQns(qnstr);
|
|
512
|
+ }
|
|
513
|
+ if(mptqidstr == null){
|
|
514
|
+ qtype.setMptqids(new Integer[]{dq.getMptqid()});
|
|
515
|
+ }else{
|
|
516
|
+ qtype.setMptqids(mptqidstr);
|
|
517
|
+ }
|
|
518
|
+
|
|
519
|
+ complexityList.add(qtype);
|
|
520
|
+ }
|
|
521
|
+
|
|
522
|
+ //设置附件
|
|
523
|
+ private void setPaperFiles(MsPaper paper,List<MsPaperFile> pfiles,List<String> imgs) {
|
|
524
|
+ if(paper.getHasfile() == 1){
|
|
525
|
+ int order= 1;
|
|
526
|
+ for(MsPaperFile pf :pfiles){
|
|
527
|
+ pf.setCreateid(paper.getCreateid());
|
|
528
|
+ pf.setCreatetime(paper.getHandletime());
|
|
529
|
+ pf.setMpid(paper.getMpid());
|
|
530
|
+ pf.setFileorder(order);
|
|
531
|
+ order ++;
|
|
532
|
+
|
|
533
|
+ if(isImgFormatForsourcepath(pf.getSourcepath()) && !imgs.contains(pf.getSourcepath())){
|
|
534
|
+ imgs.add(pf.getSourcepath());
|
|
535
|
+ }
|
|
536
|
+ }
|
|
537
|
+ }
|
|
538
|
+ }
|
|
539
|
+
|
|
540
|
+ //根据地址判断是否图片
|
|
541
|
+ private boolean isImgFormatForsourcepath(String sourcepath){
|
|
542
|
+ if(sourcepath != null && sourcepath !=""){
|
|
543
|
+ if(sourcepath.contains(".jpg") || sourcepath.contains(".png") || sourcepath.contains(".jpeg")){
|
|
544
|
+ return true;
|
|
545
|
+ }else{
|
|
546
|
+ return false;
|
|
547
|
+ }
|
|
548
|
+ }else{
|
|
549
|
+ return false;
|
|
550
|
+ }
|
|
551
|
+
|
|
552
|
+ }
|
|
553
|
+
|
|
554
|
+ //保存试卷分析--附件
|
|
555
|
+ private void savePaperAnalyzeForFj(MsPaper paper,List<MsPaperQtype> fjtypelist,List<MsPaperQtypeQuestion> queslist){
|
|
556
|
+ //保存之前先清除之前的试卷分析
|
|
557
|
+ msPaperAnalyzeMapper.deleteByMpId(paper.getMpid());
|
|
558
|
+ //总体分析(主观题、客观题)
|
|
559
|
+ //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF11综合题12听力13填空题
|
|
560
|
+ int znum = 0;
|
|
561
|
+ double zscore = 0;
|
|
562
|
+ int knum = 0;
|
|
563
|
+ double kscore = 0;
|
|
564
|
+ for(MsPaperQtypeQuestion q : queslist){
|
|
565
|
+ if(N_Utils.isObjectiveQuestion(q.getCtype())){
|
|
566
|
+ knum ++;
|
|
567
|
+ kscore = kscore + q.getQscore();
|
|
568
|
+ }else{
|
|
569
|
+ znum ++;
|
|
570
|
+ zscore = zscore + q.getQscore();
|
|
571
|
+ }
|
|
572
|
+ }
|
|
573
|
+
|
|
574
|
+ double znumrate = N_Utils.getIntegerDivideAndMulitiply(znum, paper.getPnum());
|
|
575
|
+ double knumrate = N_Utils.getDoubleReduce(100.0, znumrate);
|
|
576
|
+
|
|
577
|
+ double zscorerate = N_Utils.getDoubleDivideAndMulitiply(zscore, paper.getPscore());
|
|
578
|
+ double kscorerate = N_Utils.getDoubleReduce(100.0,zscorerate);
|
|
579
|
+
|
|
580
|
+ List<Map> ranglist = new ArrayList<>();
|
|
581
|
+ Map zgmap = new TreeMap();
|
|
582
|
+ zgmap.put("qtname","主观题");
|
|
583
|
+ zgmap.put("score",zscore);
|
|
584
|
+ zgmap.put("num",znum);
|
|
585
|
+ zgmap.put("srate",zscorerate);
|
|
586
|
+ zgmap.put("nrate",znumrate);
|
|
587
|
+ ranglist.add(zgmap);
|
|
588
|
+ Map kgmap = new TreeMap();
|
|
589
|
+ kgmap.put("qtname","客观题");
|
|
590
|
+ kgmap.put("score",kscore);
|
|
591
|
+ kgmap.put("num",knum);
|
|
592
|
+ kgmap.put("srate",kscorerate);
|
|
593
|
+ kgmap.put("nrate",knumrate);
|
|
594
|
+ ranglist.add(kgmap);
|
|
595
|
+
|
|
596
|
+ Map ztmap = new TreeMap<>();
|
|
597
|
+ ztmap.put("pnum", paper.getPnum());
|
|
598
|
+ ztmap.put("pscore",paper.getPscore());
|
|
599
|
+ ztmap.put("ranglist",ranglist);
|
|
600
|
+
|
|
601
|
+ //题型分布(按照名称进行分组)
|
|
602
|
+ fjtypelist.stream().sorted(Comparator.comparing(MsPaperQtype::getMptorder)).collect(Collectors.toList());
|
|
603
|
+ Map<String,List<MsPaperQtype>> qtypemap = fjtypelist.stream().collect(Collectors.groupingBy(MsPaperQtype:: getMptname, Collectors.toList()));
|
|
604
|
+ List<Map> qtlist = new ArrayList<>();
|
|
605
|
+ for(Map.Entry<String, List<MsPaperQtype>> entry : qtypemap.entrySet()){
|
|
606
|
+ List<MsPaperQtype> aq = entry.getValue();
|
|
607
|
+ int num = aq.stream().mapToInt(MsPaperQtype::getMptnum).sum();
|
|
608
|
+ double tscore = aq.stream().collect(Collectors.summingDouble(MsPaperQtype:: getMptscore));
|
|
609
|
+ tscore = N_Utils.formatDouble(tscore,1);
|
|
610
|
+ double storerate = N_Utils.getDoubleDivideAndMulitiply(tscore, paper.getPscore());
|
|
611
|
+ //获取小题题号
|
|
612
|
+
|
|
613
|
+ List<Integer> orderlist = new ArrayList<>();
|
|
614
|
+ List<Integer> mptqidlist = new ArrayList<>();
|
|
615
|
+ List<String> qnlist = new ArrayList<>();
|
|
616
|
+ List<Double> scorelist = new ArrayList<>();
|
|
617
|
+ List<String> qnamelist = new ArrayList<>();
|
|
618
|
+ for(MsPaperQtype t : aq){
|
|
619
|
+ List<MsPaperQtypeQuestion> qlist = t.getQuestions();
|
|
620
|
+ for(MsPaperQtypeQuestion q : qlist){
|
|
621
|
+ orderlist.add(q.getQorder());
|
|
622
|
+ mptqidlist.add(q.getId());
|
|
623
|
+ qnlist.add(q.getQn());
|
|
624
|
+ scorelist.add(q.getQscore());
|
|
625
|
+ qnamelist.add(q.getQtypename());
|
|
626
|
+ }
|
|
627
|
+ }
|
|
628
|
+
|
|
629
|
+ Map anmap = new TreeMap();//题型对应试题的id和基础信息
|
|
630
|
+ anmap.put("orders",orderlist);
|
|
631
|
+ anmap.put("mptqids",mptqidlist);
|
|
632
|
+ anmap.put("qns",qnlist);
|
|
633
|
+ anmap.put("scores",scorelist);
|
|
634
|
+ anmap.put("qtypenames",qnamelist);
|
|
635
|
+
|
|
636
|
+ Map tmap = new TreeMap();
|
|
637
|
+ tmap.put("qtname",entry.getKey());
|
|
638
|
+ tmap.put("qtid",aq.get(0).getMptid());
|
|
639
|
+ tmap.put("num",num);
|
|
640
|
+ tmap.put("score",tscore);
|
|
641
|
+ tmap.put("srate",storerate);
|
|
642
|
+ tmap.put("ques",anmap);
|
|
643
|
+ qtlist.add(tmap);
|
|
644
|
+ }
|
|
645
|
+
|
|
646
|
+ MsPaperAnalyze epa = new MsPaperAnalyze();
|
|
647
|
+ epa.setMpid(paper.getMpid());
|
|
648
|
+ epa.setAlljson(JSON.toJSONString(ztmap));
|
|
649
|
+ epa.setQnumjson(JSON.toJSONString(qtlist));
|
|
650
|
+ msPaperAnalyzeMapper.insertUseGeneratedKeys(epa);
|
|
651
|
+ }
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+ /*
|
|
655
|
+ * @Description 试卷答案-客观题
|
|
656
|
+ * @Date 2024/10/17 15:38:44
|
|
657
|
+ * @Author WN
|
|
658
|
+ * @Param [qtype]
|
|
659
|
+ * @Return com.xhkjedu.vo.ResultVo
|
|
660
|
+ **/
|
|
661
|
+ public ResultVo answerObjective(MsPaperQtype qtype){
|
|
662
|
+ Integer mpid = qtype.getMpid();
|
|
663
|
+ List<MsPaperQtypeQuestion> questions = qtype.getQuestions();
|
|
664
|
+ for(MsPaperQtypeQuestion question : questions) {
|
|
665
|
+ if(N_Utils.isTrueInteger(question.getMptqid()) || N_Utils.isEmpty(question.getQanswer())){
|
|
666
|
+ return new ResultVo(1,"请设置对应试题答案");
|
|
667
|
+ }
|
|
668
|
+ }
|
|
669
|
+
|
|
670
|
+ //获取试题答案改变的试题
|
|
671
|
+ List<MsPaperQtypeQuestion> changelist = listChangeQuestionAnswer(questions,mpid);
|
|
672
|
+
|
|
673
|
+ //获取考试状态
|
|
674
|
+ int examstate = 0;
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+ saveQuestionAnswerObjective(mpid,changelist);
|
|
678
|
+
|
|
679
|
+ //判断考试状态是开始,已提交学生重新批阅
|
|
680
|
+
|
|
681
|
+ return new ResultVo(0,"保存成功");
|
|
682
|
+ }
|
|
683
|
+ //获取答案改变的试题
|
|
684
|
+ private List<MsPaperQtypeQuestion> listChangeQuestionAnswer(List<MsPaperQtypeQuestion> questions,Integer mpid){
|
|
685
|
+ List<MsPaperQtypeQuestion> changelist = new ArrayList<>();
|
|
686
|
+ //获取试卷中原试题答案
|
|
687
|
+ List<MsPaperQtypeQuestion> yqlist = msPaperQtypeQuestionMapper.listQuestionsByEpid(mpid);
|
|
688
|
+ for(MsPaperQtypeQuestion tq : questions){
|
|
689
|
+ if(N_Utils.isTrueInteger(tq.getMptqid()) && N_Utils.isNotEmpty(tq.getQanswer())){
|
|
690
|
+ MsPaperQtypeQuestion yq = yqlist.stream().filter(y -> y.getMptqid().equals(tq.getMptqid())).findFirst().orElse(null);
|
|
691
|
+
|
|
692
|
+ if(N_Utils.isObjectiveQuestion(yq.getCtype())){
|
|
693
|
+ if(!tq.getQanswer().equalsIgnoreCase(yq.getQanswer()) || !tq.getLoseoption().equals(yq.getLoseoption()) || !tq.getScoreset().equals(yq.getScoreset())){
|
|
694
|
+ //说明新设置的答案和原设置的答案不一致,则为变动的
|
|
695
|
+ tq.setCtype(yq.getCtype());
|
|
696
|
+ tq.setQscore(yq.getQscore());
|
|
697
|
+ changelist.add(tq);
|
|
698
|
+ }
|
|
699
|
+ }
|
|
700
|
+ }
|
|
701
|
+ }
|
|
702
|
+ return changelist;
|
|
703
|
+ }
|
|
704
|
+
|
|
705
|
+ @Transactional(rollbackFor = Exception.class)
|
|
706
|
+ public void saveQuestionAnswerObjective(Integer mpid,List<MsPaperQtypeQuestion> questions){
|
|
707
|
+ //更新试卷设置答案状态
|
|
708
|
+ msPaperMapper.updatePaperAnswer(1,mpid);
|
|
709
|
+ //保存试卷答案
|
|
710
|
+ msPaperQtypeQuestionMapper.updateBatchQuestionAnswer(questions);
|
|
711
|
+ //保存试卷模版题块中试题答案
|
|
712
|
+
|
|
713
|
+ //如果考试一开始,标记需要批改的学生试题
|
|
714
|
+ }
|
|
715
|
+
|
|
716
|
+ /*
|
|
717
|
+ * @Description 试卷答案-主观题
|
|
718
|
+ * @Date 2024/10/17 15:40:47
|
|
719
|
+ * @Author WN
|
|
720
|
+ * @Param [qtype]
|
|
721
|
+ * @Return com.xhkjedu.vo.ResultVo
|
|
722
|
+ **/
|
|
723
|
+ @Transactional(rollbackFor = Exception.class)
|
|
724
|
+ public void answerSubjective(MsPaper paper){
|
|
725
|
+ Integer mpid = paper.getMpid();
|
|
726
|
+ List<MsPaperFile> pfiles = paper.getPfiles();
|
|
727
|
+ //删除已保存主观题答案图片
|
|
728
|
+ msPaperFileMapper.deleteByMpidAndType(mpid,2);
|
|
729
|
+ Integer timestamp = N_Utils.getSecondTimestamp();
|
|
730
|
+ for (MsPaperFile pf : pfiles) {
|
|
731
|
+ pf.setMpid(mpid);
|
|
732
|
+ pf.setCreatetime(timestamp);
|
|
733
|
+ pf.setFiletype(2);
|
|
734
|
+ }
|
|
735
|
+ msPaperFileMapper.insertList(pfiles);
|
|
736
|
+ }
|
|
737
|
+
|
|
738
|
+ /*
|
|
739
|
+ * @Description 试卷题干文件
|
|
740
|
+ * @Date 2024/10/17 16:00:37
|
|
741
|
+ * @Author WN
|
|
742
|
+ * @Param [paper]
|
|
743
|
+ * @Return com.xhkjedu.vo.ResultVo
|
37
|
744
|
**/
|
38
|
|
- public List<MsPaperQtype> queryList(MsPaperQtype msPaperQtype){
|
39
|
|
- return msPaperQtypeMapper.selectAll();
|
|
745
|
+ @Transactional(rollbackFor = Exception.class)
|
|
746
|
+ public void savePaperFiles(MsPaper paper){
|
|
747
|
+ Integer mpid = paper.getMpid();
|
|
748
|
+ List<MsPaperFile> pfiles = paper.getPfiles();
|
|
749
|
+ //删除已保存主观题答案图片
|
|
750
|
+ msPaperFileMapper.deleteByMpidAndType(mpid,1);
|
|
751
|
+ Integer timestamp = N_Utils.getSecondTimestamp();
|
|
752
|
+ for (MsPaperFile pf : pfiles) {
|
|
753
|
+ pf.setMpid(mpid);
|
|
754
|
+ pf.setCreatetime(timestamp);
|
|
755
|
+ pf.setFiletype(1);
|
|
756
|
+ }
|
|
757
|
+ msPaperFileMapper.insertList(pfiles);
|
40
|
758
|
}
|
41
|
759
|
}
|