Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set points to 0 upon aborting a submission #1528

Merged
merged 1 commit into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion judge/bridge/judge_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def on_submission_terminated(self, packet):
logger.info('%s: Submission aborted: %s', self.name, packet['submission-id'])
self._free_self(packet)

if Submission.objects.filter(id=packet['submission-id']).update(status='AB', result='AB'):
if Submission.objects.filter(id=packet['submission-id']).update(status='AB', result='AB', points=0):
event.post('sub_%s' % Submission.get_id_secret(packet['submission-id']), {'type': 'aborted-submission'})
self._post_update_submission(packet['submission-id'], 'terminated', done=True)
json_log.info(self._make_json_log(packet, action='aborted', finish=True, result='AB'))
Expand Down
2 changes: 1 addition & 1 deletion judge/judgeapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ def abort_submission(submission):
# This defaults to true, so that in the case the JudgeList fails to remove the submission from the queue,
# and returns a bad-request, the submission is not falsely shown as "Aborted" when it will still be judged.
if not response.get('judge-aborted', True):
Submission.objects.filter(id=submission.id).update(status='AB', result='AB')
Submission.objects.filter(id=submission.id).update(status='AB', result='AB', points=0)
event.post('sub_%s' % Submission.get_id_secret(submission.id), {'type': 'aborted-submission'})
_post_update_submission(submission, done=True)