|
@@ -277,7 +277,7 @@ public class MarkController extends BaseController {
|
|
try {
|
|
try {
|
|
task.setSpent((new Date().getTime() - task.getSpent()) / 1000);
|
|
task.setSpent((new Date().getTime() - task.getSpent()) / 1000);
|
|
MarkLibrary library = libraryService.findById(task.getLibraryId());
|
|
MarkLibrary library = libraryService.findById(task.getLibraryId());
|
|
- if (library != null && library.getStatus() != LibraryStatus.ARBITRATED && library.getStatus() != LibraryStatus.WAIT_ARBITRATE) {
|
|
|
|
|
|
+ if (checkLibrary(library, marker)) {
|
|
library.setMarkerId(marker.getId());
|
|
library.setMarkerId(marker.getId());
|
|
library.setMarkerTime(new Date());
|
|
library.setMarkerTime(new Date());
|
|
library.setMarkerScore(task.getTotalScore());
|
|
library.setMarkerScore(task.getTotalScore());
|
|
@@ -353,4 +353,23 @@ public class MarkController extends BaseController {
|
|
return array;
|
|
return array;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean checkLibrary(MarkLibrary library, Marker marker) {
|
|
|
|
+ if (library == null) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!library.getExamId().equals(marker.getExamId())) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!library.getSubjectCode().equals(marker.getSubjectCode())) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!library.getGroupNumber().equals(marker.getGroupNumber())) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (library.getStatus() != LibraryStatus.WAITING && library.getStatus() != LibraryStatus.MARKED) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|