oioioi.contests.utils
¶
Module Contents¶
Classes¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Checks if results of all rounds of the current contest are visible to |
|
Checks if results of all non-trial rounds of the current contest are |
|
|
|
|
|
|
|
|
|
|
|
Returns first unsuccessful status or 'OK' if all are successful |
Returns list of dotted paths to contest controller classes in use |
|
|
Returns materialized set of contests visible to the logged in user. |
|
Returns a list of contests for which the logged |
|
Checks if the user is the contest admin of the current contest. |
|
Checks if the user should be allowed on the admin pages of the contest. |
|
Checks if the user is a basic admin of the current contest. |
|
Checks if the current user can observe the current contest. |
|
Checks if the current user has permission to see personal data. |
|
|
|
Returns the submission if it exists and user has rights to see it. |
|
Returns the end_date of the latest past round and the start_date |
|
|
|
- class oioioi.contests.utils.RoundTimes(start, end, contest, show_results=None, show_public_results=None, extra_time=0)[source]¶
Bases:
object
- results_visible(current_datetime)[source]¶
Returns True if results are visible for a user.
Usually show_results date decides.
When a RoundTimeExtension is set for a given user and the round is still active, results publication is delayed.
- public_results_visible(current_datetime)[source]¶
Returns True if the results of the round have already been made public
It the contest’s controller makes no distinction between personal and public results, this function returns the same as :meth:’results_visible’.
Otherwise the show_public_results date is used.
- oioioi.contests.utils.all_public_results_visible(request)[source]¶
Checks if results of all rounds of the current contest are visible to public.
- oioioi.contests.utils.all_non_trial_public_results_visible(request)[source]¶
Checks if results of all non-trial rounds of the current contest are visible to public.
- oioioi.contests.utils.aggregate_statuses(statuses)[source]¶
Returns first unsuccessful status or ‘OK’ if all are successful
- oioioi.contests.utils.used_controllers()[source]¶
Returns list of dotted paths to contest controller classes in use by contests on this instance.
- oioioi.contests.utils.visible_contests(request)[source]¶
Returns materialized set of contests visible to the logged in user.
- oioioi.contests.utils.administered_contests(request)[source]¶
Returns a list of contests for which the logged user has contest_admin permission for.
- oioioi.contests.utils.is_contest_admin(request)[source]¶
Checks if the user is the contest admin of the current contest. This permission level allows full access to all contest functionality.
- oioioi.contests.utils.can_admin_contest(user, contest)[source]¶
Checks if the user should be allowed on the admin pages of the contest. This is the same level of permissions as is_contest_basicadmin.
- oioioi.contests.utils.is_contest_basicadmin(request)[source]¶
Checks if the user is a basic admin of the current contest. This permission level allows edit access to basic contest functionality. It is also implied by having full admin privileges (is_contest_admin).
- oioioi.contests.utils.is_contest_observer(request)[source]¶
Checks if the current user can observe the current contest.
- oioioi.contests.utils.can_see_personal_data(request)[source]¶
Checks if the current user has permission to see personal data.
- oioioi.contests.utils.get_submission_or_error(request, submission_id, submission_class=Submission)[source]¶
Returns the submission if it exists and user has rights to see it.