Add advanced rejudge scheduling#754
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an “evaluation scheduling” option to the rejudge flow so admins can spread rejudge jobs over time (instant / delayed / slow / custom cadence), leveraging Celery countdown scheduling.
Changes:
- Extend
judge()plumbing (contest + problem controllers) to accept an optionaldelayand pass it to the eval manager ascountdown. - Add scheduling parameter parsing and apply per-submission delays when enqueueing rejudge jobs.
- Add UI controls and tests for the new scheduling options.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
oioioi/problems/controllers.py |
Adds delay parameter and forwards it as Celery countdown when scheduling evaluation. |
oioioi/contests/controllers.py |
Extends contest-controller judge() to forward delay to the problem controller. |
oioioi/contests/views.py |
Implements scheduling option parsing and applies computed delays during rejudge enqueueing. |
oioioi/contests/templates/contests/confirm_rejudge.html |
Adds scheduling selector UI (instant/delayed/slow/custom) and custom-parameter inputs. |
oioioi/contests/tests/tests.py |
Adds tests validating that delays are passed to judge() according to selected scheduling. |
oioioi/default_settings.py |
Introduces default settings for delayed/slow durations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Previously, if 0 submission were selected with a custom rejudge ootion, the program tried to divide the time by 0, to spread them out evenly. This commit adds necessary guards, so that for 0 selected submissions these calculations are not completed. Selecting 0 submissions is not an error, but it doesn't result in anything besides a message.
sylwia-sapkowska
left a comment
There was a problem hiding this comment.
Looks ok to me.
|
|
@twalen I have moved CSS from the html file, to a separate static file as requested. This PR should be ready for merge now. |
malevitzch
left a comment
There was a problem hiding this comment.
I have a few problems with the style, otherwise it looks solid
| }); | ||
| } | ||
|
|
||
| // Initialize on page load |
| border-bottom-right-radius: 0.375rem; | ||
| } | ||
|
|
||
| /* Active State Style */ |
There was a problem hiding this comment.
This comment is obsolete and the code already passes that infromation in the css class name "btn-check:chceked"
| FORUM_POST_MAX_LENGTH = 20000 | ||
| FORUM_REACTIONS_TO_DISPLAY = 10 | ||
|
|
||
| # REJUDGE EVALUATION SCHEDULING VARIABLES |
| pass | ||
|
|
||
| def judge(self, submission, extra_args=None, is_rejudge=False): | ||
| def judge(self, submission, extra_args=None, is_rejudge=False, delay: int | float = 0): |
There was a problem hiding this comment.
The single type annotation stands out here, I understand that submission can't be typed right now, but extra_args could be "dict[str, Any] | None" and is_rejudge could just be "bool" if you wish to use type annotations
|
|
||
| def judge(self, submission, extra_args=None, is_rejudge=False): | ||
| submission.problem_instance.problem.controller.judge(submission, extra_args, is_rejudge) | ||
| def judge(self, submission, extra_args=None, is_rejudge=False, delay: int | float = 0): |
There was a problem hiding this comment.
I don't like the typing here, same as in oioioi/problems/controllers.py
| const delayStepInput = document.getElementById('custom_delay_step'); | ||
|
|
||
| if (batchSizeInput && delayStepInput) { | ||
| // Check if custom is already selected on page load |
There was a problem hiding this comment.
And this one, those comments are made obsolete by reading the code even without deeper javascript knowledge
| const batchSizeInput = document.getElementById('custom_batch_size'); | ||
| const delayStepInput = document.getElementById('custom_delay_step'); | ||
|
|
||
| if (this.value === 'custom') { |
There was a problem hiding this comment.
Feels like you are doing CSS's job with javascript here, but I might be wrong





This commit adds a scheduling option, which allows the user to specify how submission jobs will be evaluated in the rejudge queue, with the following options:
With the info button pressed, the screen looks like this:

Note: This is a clean version of this old draft PR: #724
Closes: #672