mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
Merge c1755476be into a429dbb72f
This commit is contained in:
commit
5cb816f477
@ -151,7 +151,11 @@ class JudgeDispatcher(DispatcherBase):
|
|||||||
"spj_compile_config": spj_config.get("compile"),
|
"spj_compile_config": spj_config.get("compile"),
|
||||||
"spj_src": self.problem.spj_code
|
"spj_src": self.problem.spj_code
|
||||||
}
|
}
|
||||||
|
self.last_result = None
|
||||||
|
try:
|
||||||
|
self.last_result = Submission.objects.get(id=self.submission.id).result
|
||||||
|
except:
|
||||||
|
pass
|
||||||
Submission.objects.filter(id=self.submission.id).update(result=JudgeStatus.JUDGING)
|
Submission.objects.filter(id=self.submission.id).update(result=JudgeStatus.JUDGING)
|
||||||
|
|
||||||
service_url = server.service_url
|
service_url = server.service_url
|
||||||
@ -194,8 +198,9 @@ class JudgeDispatcher(DispatcherBase):
|
|||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
# update problem status
|
# update problem status
|
||||||
problem = Problem.objects.select_for_update().get(contest_id=self.contest_id, id=self.problem.id)
|
problem = Problem.objects.select_for_update().get(contest_id=self.contest_id, id=self.problem.id)
|
||||||
|
if self.last_result is None:
|
||||||
problem.submission_number += 1
|
problem.submission_number += 1
|
||||||
if self.submission.result == JudgeStatus.ACCEPTED:
|
if self.submission.result == JudgeStatus.ACCEPTED and self.last_result != JudgeStatus.ACCEPTED:
|
||||||
problem.accepted_number += 1
|
problem.accepted_number += 1
|
||||||
problem_info = problem.statistic_info
|
problem_info = problem.statistic_info
|
||||||
problem_info[result] = problem_info.get(result, 0) + 1
|
problem_info[result] = problem_info.get(result, 0) + 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user