|
@@ -196,7 +196,7 @@ public class ScoreController extends BaseExamController {
|
|
@RoleRequire(Role.SCHOOL_ADMIN)
|
|
@RoleRequire(Role.SCHOOL_ADMIN)
|
|
public ModelAndView calculate(HttpServletRequest request) {
|
|
public ModelAndView calculate(HttpServletRequest request) {
|
|
int examId = getSessionExamId(request);
|
|
int examId = getSessionExamId(request);
|
|
- if (lockService.trylock(LockType.SCORE_CALCULATE, examId)) {
|
|
|
|
|
|
+ if (!lockService.isLocked(LockType.SCORE_CALCULATE, examId)) {
|
|
ScoreCalculateThread thread = new ScoreCalculateThread(examId, lockService, studentService, questionService,
|
|
ScoreCalculateThread thread = new ScoreCalculateThread(examId, lockService, studentService, questionService,
|
|
markService, reportService, examService, subjectService, groupService);
|
|
markService, reportService, examService, subjectService, groupService);
|
|
taskExecutor.submit(thread);
|
|
taskExecutor.submit(thread);
|
|
@@ -276,7 +276,7 @@ public class ScoreController extends BaseExamController {
|
|
}
|
|
}
|
|
return obj;
|
|
return obj;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@RequestMapping("/getProcess")
|
|
@RequestMapping("/getProcess")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public JSONObject getProcess(HttpServletRequest request) {
|
|
public JSONObject getProcess(HttpServletRequest request) {
|
|
@@ -285,10 +285,10 @@ public class ScoreController extends BaseExamController {
|
|
boolean running = lockService.isLocked(LockType.SCORE_CALCULATE, examId);
|
|
boolean running = lockService.isLocked(LockType.SCORE_CALCULATE, examId);
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
obj.accumulate("running", running);
|
|
obj.accumulate("running", running);
|
|
- if(exam.getProcess()!=null){
|
|
|
|
|
|
+ if (exam.getProcess() != null) {
|
|
DecimalFormat format = new DecimalFormat("##.##");
|
|
DecimalFormat format = new DecimalFormat("##.##");
|
|
- obj.accumulate("process", format.format(exam.getProcess()*100));
|
|
|
|
- }else{
|
|
|
|
|
|
+ obj.accumulate("process", format.format(exam.getProcess() * 100));
|
|
|
|
+ } else {
|
|
obj.accumulate("process", 0);
|
|
obj.accumulate("process", 0);
|
|
}
|
|
}
|
|
return obj;
|
|
return obj;
|