oioioi.oi.controllers¶
Module Contents¶
Classes¶
A base class for classes which should have a list of subclasses |
|
Contains the contest logic and rules. |
|
Contains the contest logic and rules. |
|
Contains the contest logic and rules. |
|
Contains the contest logic and rules. |
|
Contains the contest logic and rules. |
Attributes¶
- class oioioi.oi.controllers.OIRegistrationController(contest)[source]¶
Bases:
oioioi.participants.controllers.ParticipantsControllerA base class for classes which should have a list of subclasses available.
The list of subclasses is available in their
subclassesclass attributes. Classes which have explicitly setabstractclass attribute toTrueare not added tosubclasses.If a class has
modules_with_subclassesattribute (list or string), then specified modules for all installed applications can be loaded by callingload_subclasses().- classmethod anonymous_can_enter_contest()[source]¶
Determines if an anonymous user can enter the contest.
Allowed anonymous users will have limited functionality, but they can see the problems, review questions etc. Modules should give them as much functionality as reasonably possible.
- Return type
bool
- can_enter_contest(request)[source]¶
Determines if the current user is allowed to enter the contest, i.e. see any page related to the contest.
The default implementation uses
filter_visible_contests()with a single-element contest queryset.- Return type
bool
- visible_contests_query(request)[source]¶
Provides a
django.db.models.Qexpression which can be used onoioioi.contests.models.Contestqueryset already limited to contests using this controller to filter for contests the user can enter.It must not make use of attribute contest of the controller, as it is not guaranteed to be set. It is called with None contest in :function:`oioioi.contests.utils.visible_contests`.
- get_contest_participant_info_list(request, user)[source]¶
Returns a list of tuples (priority, info). Each entry represents a fragment of HTML with information about the user’s participation in the contest. This information will be visible for contest admins. It can be any information an application wants to add.
The fragments are sorted by priority (descending) and rendered in that order.
The default implementation returns basic info about the contestant: his/her full name, e-mail, the user id, his/her submissions and round time extensions.
To add additional info from another application, override this method. For integrity, include the result of the parent implementation in your output.
- mixins_for_admin()[source]¶
Returns an iterable of mixins to add to the default
oioioi.contests.admin.ContestAdminfor the contest.The default implementation returns an empty tuple.
- class oioioi.oi.controllers.OIContestController(contest)[source]¶
Bases:
oioioi.programs.controllers.ProgrammingContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.
- can_submit(request, problem_instance, check_round_times=True)[source]¶
Determines if the current user is allowed to submit a solution for the given problem.
The default implementation checks if the user is not anonymous, and if the round is active for the given user. Subclasses should also call this default implementation.
- class oioioi.oi.controllers.OIOnsiteContestController(contest)[source]¶
Bases:
OIContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.
- class oioioi.oi.controllers.OIFinalOnsiteContestController(contest)[source]¶
Bases:
OIOnsiteContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.
- class oioioi.oi.controllers.BOIOnsiteContestController(contest)[source]¶
Bases:
OIOnsiteContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.
- class oioioi.oi.controllers.BOIOnlineContestController(contest)[source]¶
Bases:
BOIOnsiteContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.