|
@@ -120,11 +120,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int applyCurrentCount(MarkQuestion markQuestion) {
|
|
|
- // todo 正在评卷数量查询 (评卷员和评卷分组分开2个方法)
|
|
|
TaskLock taskLock = getTaskLock(markQuestion);
|
|
|
int count = 0;
|
|
|
if (taskLock != null) {
|
|
|
- count = taskLock.count();
|
|
|
+ count = taskLock.count(markQuestion.getId());
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
@@ -372,7 +371,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
scoreCalculate(studentId, version);
|
|
|
} else {//否则更新该学生主观题状态为未阅卷
|
|
|
// markStudentService.updateSubjectiveStatusAndScore(studentId, SubjectiveStatus.UNMARK, null, null);
|
|
|
- markStudentService.updateSubjectiveScoreByVersion(studentId, SubjectiveStatus.MARKED, null, null, version);
|
|
|
+ markStudentService.updateSubjectiveScoreByVersion(studentId, SubjectiveStatus.UNMARK, null, null, version);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
@@ -423,8 +422,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return;
|
|
|
}
|
|
|
int count = 0;
|
|
|
- List<MarkStudent> studentList = markStudentService.listUnMarkTaskStudent(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId(), pageSize);
|
|
|
- while (CollectionUtils.isNotEmpty(studentList)) {
|
|
|
+ List<MarkStudent> studentList = markStudentService.listUnMarkTaskStudent(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId(), pageSize);while (CollectionUtils.isNotEmpty(studentList)) {
|
|
|
// 已生成的双评任务总数的第一组任务数
|
|
|
int doubleMarkTaskCount1 = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumber(
|
|
|
markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId(), 1);
|
|
@@ -844,6 +842,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
Set<Long> questions = markTaskList.stream().map(MarkTask::getQuestionId).collect(Collectors.toSet());
|
|
|
if (this.applyTask(examId, paperNumber, studentId, 1, userId, questions)) {
|
|
|
task = taskService.build(userId, markTaskList);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -954,7 +953,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
|
|
|
private SubmitResult submitResult(Long examId, String paperNumber, Long userId, MarkResult result) {
|
|
|
int spentAvg = result.getSpent() / result.getQuestionList().size();
|
|
|
- int i = 0;
|
|
|
+ int count = 0;
|
|
|
for (MarkResultQuestion markResultQuestion : result.getQuestionList()) {
|
|
|
try {
|
|
|
lockService.watch(LockType.QUESTION, markResultQuestion.getQuestionId());
|
|
@@ -974,13 +973,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
updateMarkedCount(markUserQuestion.getExamId(), markUserQuestion.getPaperNumber(), markUserQuestion.getQuestionId());
|
|
|
// 未评完
|
|
|
resetStudentGroup(task.getStudentId());
|
|
|
- i++;
|
|
|
+ count++;
|
|
|
}
|
|
|
}
|
|
|
if (markResultQuestion.getMarkerScore() <= markQuestion.getTotalScore()) {//阅卷分是否小于等于该组总分
|
|
|
if (submitTask(task, userId, markQuestion, markResultQuestion)) {
|
|
|
updateMarkedCount(markUserQuestion.getExamId(), markUserQuestion.getPaperNumber(), markUserQuestion.getQuestionId());
|
|
|
- i++;
|
|
|
+ count++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -990,7 +989,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
lockService.unwatch(LockType.QUESTION, markResultQuestion.getQuestionId());
|
|
|
}
|
|
|
}
|
|
|
- if (CollectionUtils.size(result.getQuestionList()) == i) {
|
|
|
+ if (CollectionUtils.size(result.getQuestionList()) == count) {
|
|
|
return SubmitResult.success(examId, paperNumber, result.getStudentId());
|
|
|
} else {
|
|
|
return SubmitResult.faile();
|
|
@@ -1131,4 +1130,41 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void deleteMarkTask(MarkQuestion markQuestion) {
|
|
|
+ // 正评相关数据
|
|
|
+ markArbitrateHistoryService.deleteByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ markProblemHistoryService.deleteByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ markTaskService.deleteByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ markRejectHistoryService.deleteByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ markSubjectiveScoreService.deleteByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ // 释放本小题所有评卷员的任务
|
|
|
+ List<MarkUserQuestion> markUserQuestions = markUserQuestionService.listByExamIdAndPaperNumberAndQuestionId(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId());
|
|
|
+ for (MarkUserQuestion markUserQuestion : markUserQuestions) {
|
|
|
+ releaseByMarkUserGroup(markUserQuestion);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 未分组的题目
|
|
|
+// long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
|
|
|
+// markGroup.getExamId(), markGroup.getPaperNumber(), false);
|
|
|
+// // 考生整体状态与总分更新
|
|
|
+// long groupCount = markGroupService.countByExamIdAndPaperNumber(markGroup.getExamId(),
|
|
|
+// markGroup.getPaperNumber());
|
|
|
+// if (groupCount == 0 || unGroupQuestionCount > 0) {
|
|
|
+// markStudentService.updateSubjectiveStatusAndScore(markGroup.getExamId(), markGroup.getPaperNumber(),
|
|
|
+// SubjectiveStatus.UNMARK, null, null);
|
|
|
+// } else {
|
|
|
+// List<Long> studentList = markStudentService.findIdByExamIdAndPaperNumber(markGroup.getExamId(), markGroup.getPaperNumber());
|
|
|
+// for (Long studentId : studentList) {
|
|
|
+// checkStudentSubjective(studentId, groupCount, unGroupQuestionCount);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void releaseByMarkQuestion(MarkQuestion markQuestion) {
|
|
|
+ TaskLock taskLock = getTaskLock(markQuestion);
|
|
|
+ taskLock.clear();
|
|
|
+ }
|
|
|
+
|
|
|
}
|