|
@@ -7,10 +7,12 @@ import com.xhkjedu.smarking.mapper.papercheck.MsPaperCheckTeacherTaskMapper;
|
7
|
7
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
|
8
|
8
|
import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
|
9
|
9
|
import com.xhkjedu.smarking.mapper.system.UserMapper;
|
|
10
|
+import com.xhkjedu.smarking.model.paper.MsPaperBlockQuestion;
|
10
|
11
|
import com.xhkjedu.smarking.model.papercheck.MsPaperCheck;
|
11
|
12
|
import com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher;
|
12
|
13
|
import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
|
13
|
14
|
import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
|
|
15
|
+import com.xhkjedu.smarking.utils.MarkingUtil;
|
14
|
16
|
import com.xhkjedu.smarking.vo.papercheck.MsCheckParam;
|
15
|
17
|
import com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo;
|
16
|
18
|
import com.xhkjedu.utils.N_Utils;
|
|
@@ -239,6 +241,8 @@ public class MsPaperCheckTeacherTaskService {
|
239
|
241
|
}
|
240
|
242
|
msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
|
241
|
243
|
}
|
|
244
|
+ sq.setChecktype(checktype);
|
|
245
|
+ sq.setMpid(paperCheck.getMpid());
|
242
|
246
|
}
|
243
|
247
|
Map map = new HashMap();
|
244
|
248
|
map.put("sq", sq);
|
|
@@ -279,4 +283,101 @@ public class MsPaperCheckTeacherTaskService {
|
279
|
283
|
List<Map> list = msPaperCheckTeacherTaskMapper.detailByQuestion(mpid, mblockid, dispenseway, check.getChecktype());
|
280
|
284
|
return setListNum(dispenseway, list);
|
281
|
285
|
}
|
|
286
|
+
|
|
287
|
+ /**
|
|
288
|
+ * @Description 批阅
|
|
289
|
+ * @Date 2024/11/12 10:02
|
|
290
|
+ * @Author YWX
|
|
291
|
+ * @Param [param]
|
|
292
|
+ * @Return void
|
|
293
|
+ **/
|
|
294
|
+ public void correct(MsPaperCheckVo param) {
|
|
295
|
+ MsPaperCheck check = msPaperCheckMapper.findByMBlockId(param.getMpid(), param.getMblockid());
|
|
296
|
+ if (check == null) {
|
|
297
|
+ throw new ServiceException("该阅卷任务不存在");
|
|
298
|
+ } else if (check.getCheckstate().equals(0)) {
|
|
299
|
+ throw new ServiceException("该阅卷任务未开始");
|
|
300
|
+ } else if (check.getCheckstate().equals(2)) {
|
|
301
|
+ throw new ServiceException("该阅卷任务已暂停");
|
|
302
|
+ }
|
|
303
|
+ Integer checktype = check.getChecktype();
|
|
304
|
+ Integer correcttype = check.getCorrecttype();
|
|
305
|
+ Integer mpsbid = param.getMpsbid();
|
|
306
|
+ Integer hasgood = param.getHasgood();
|
|
307
|
+ Integer hasbad = param.getHasbad();
|
|
308
|
+ Integer hasproblem = param.getHasproblem();
|
|
309
|
+ Integer problemtype = param.getProblemtype();
|
|
310
|
+ String problemcomm = param.getProblemcomm();
|
|
311
|
+ Double qscore = param.getQscore();
|
|
312
|
+ List<MsPaperBlockQuestion> questions = param.getQuestions();
|
|
313
|
+ int checked = 1;
|
|
314
|
+ if (checktype.equals(1)) {//单评
|
|
315
|
+ if (hasproblem.equals(0)) {
|
|
316
|
+ checked = 2;
|
|
317
|
+ }
|
|
318
|
+ Double firstccore = param.getFirstccore();
|
|
319
|
+ if (correcttype.equals(3)) {//按题块批阅
|
|
320
|
+ //题块批阅信息
|
|
321
|
+ MsPaperStudentBlock block = new MsPaperStudentBlock();
|
|
322
|
+ block.setMpsbid(mpsbid);
|
|
323
|
+ block.setChecked(checked);
|
|
324
|
+ block.setFirstcime(N_Utils.getSecondTimestamp());
|
|
325
|
+ block.setFirstccore(firstccore);
|
|
326
|
+ block.setHasgood(hasgood);
|
|
327
|
+ block.setHasbad(hasbad);
|
|
328
|
+ block.setHasproblem(hasproblem);
|
|
329
|
+ block.setProblemtype(problemtype);
|
|
330
|
+ block.setProblemcomm(problemcomm);
|
|
331
|
+ msPaperStudentBlockMapper.updateByPrimaryKeySelective(block);
|
|
332
|
+ block.setStudentid(param.getStudentid());
|
|
333
|
+ block.setMblockid(param.getMblockid());
|
|
334
|
+
|
|
335
|
+ List<MsPaperStudentQuestion> studentQuestions = new ArrayList<>();
|
|
336
|
+ for (MsPaperBlockQuestion question : questions) {
|
|
337
|
+ Double stuscore = question.getStuscore();
|
|
338
|
+ if (N_Utils.isTrueInteger(question.getMptqid())) {
|
|
339
|
+ MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
|
340
|
+ studentQuestion.setMptqid(question.getMptqid());
|
|
341
|
+ studentQuestion.setFirstccore(stuscore);
|
|
342
|
+ studentQuestion.setStuscore(stuscore);
|
|
343
|
+ studentQuestions.add(studentQuestion);
|
|
344
|
+ } else {
|
|
345
|
+ String[] mptqids = question.getMergeqid().split(",");
|
|
346
|
+ String[] mergescores = question.getMergescore().split(",");
|
|
347
|
+ double[] scores = new double[mergescores.length];
|
|
348
|
+ int last = mergescores.length - 1;
|
|
349
|
+ double score = 0;
|
|
350
|
+ for (int i = 0; i < mergescores.length; i++) {
|
|
351
|
+ scores[i] = MarkingUtil.mul(MarkingUtil.div(mergescores[i], qscore), stuscore);
|
|
352
|
+ score = MarkingUtil.add(score, scores[i]);
|
|
353
|
+ if (i == last) {
|
|
354
|
+ scores[i] = MarkingUtil.sub(stuscore, score);
|
|
355
|
+ }
|
|
356
|
+ }
|
|
357
|
+ for (int i = 0; i < mptqids.length; i++) {
|
|
358
|
+ MsPaperStudentQuestion studentQuestion = new MsPaperStudentQuestion();
|
|
359
|
+ studentQuestion.setMptqid(N_Utils.obj2Int(mptqids[i]));
|
|
360
|
+ studentQuestion.setFirstccore(scores[i]);
|
|
361
|
+ studentQuestion.setStuscore(scores[i]);
|
|
362
|
+ studentQuestions.add(studentQuestion);
|
|
363
|
+ }
|
|
364
|
+ }
|
|
365
|
+ }
|
|
366
|
+ msPaperStudentQuestionMapper.checkByMptqidAndStudentId(studentQuestions, block);//更新学生单题批阅信息
|
|
367
|
+ } else {//按试题批阅
|
|
368
|
+ MsPaperStudentQuestion question = new MsPaperStudentQuestion();
|
|
369
|
+ question.setMpsqid(mpsbid);
|
|
370
|
+ question.setChecked(checked);
|
|
371
|
+ question.setFirstcime(N_Utils.getSecondTimestamp());
|
|
372
|
+ question.setFirstccore(firstccore);
|
|
373
|
+ question.setHasgood(hasgood);
|
|
374
|
+ question.setHasbad(hasbad);
|
|
375
|
+ question.setHasproblem(hasproblem);
|
|
376
|
+ question.setProblemtype(problemtype);
|
|
377
|
+ question.setProblemcomm(problemcomm);
|
|
378
|
+ msPaperStudentQuestionMapper.updateByPrimaryKeySelective(question);
|
|
379
|
+ }
|
|
380
|
+ }
|
|
381
|
+ msPaperCheckTeacherTaskMapper.correct(param);
|
|
382
|
+ }
|
282
|
383
|
}
|