|
@@ -120,11 +120,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int applyCurrentCount(MarkQuestion markQuestion) {
|
|
|
-
|
|
|
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.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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void releaseByMarkQuestion(MarkQuestion markQuestion) {
|
|
|
+ TaskLock taskLock = getTaskLock(markQuestion);
|
|
|
+ taskLock.clear();
|
|
|
+ }
|
|
|
+
|
|
|
}
|