oioioi.mp.controllers

Module Contents

Classes

MPRegistrationController

A base class for classes which should have a list of subclasses

MPContestController

Contains the contest logic and rules.

MPRankingController

Changes to Default Ranking:

Attributes

oioioi.mp.controllers.CONTEST_RANKING_KEY = c[source]
class oioioi.mp.controllers.MPRegistrationController(contest)[source]

Bases: oioioi.participants.controllers.ParticipantsController

A base class for classes which should have a list of subclasses available.

The list of subclasses is available in their subclasses class attributes. Classes which have explicitly set abstract class attribute to True are not added to subclasses.

If a class has modules_with_subclasses attribute (list or string), then specified modules for all installed applications can be loaded by calling load_subclasses().

property form_class[source]
property participant_admin[source]
registration_template = mp/registration.html[source]
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

allow_login_as_public_name()[source]

Determines if participants may choose to stay anonymous, i.e. use their logins as public names.

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.Q expression which can be used on oioioi.contests.models.Contest queryset 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`.

can_register(request)[source]
registration_view(request)[source]
mixins_for_admin()[source]

Returns an iterable of mixins to add to the default oioioi.contests.admin.ContestAdmin for the contest.

The default implementation returns an empty tuple.

can_change_terms_accepted_phrase(request)[source]
Returns

Whether the given contest has custom registered

participants (like the ones in OI and PA). Then and only then we allow to change terms accepted phrase.

class oioioi.mp.controllers.MPContestController(contest)[source]

Bases: oioioi.programs.controllers.ProgrammingContestController

Contains the contest logic and rules.

This is the computerized implementation of the contest’s official rules.

description[source]
create_forum = False[source]
show_email_in_participants_data = True[source]
registration_controller()[source]
ranking_controller()[source]
update_user_result_for_problem(result)[source]

Submissions sent during the round are scored as normal. Submissions sent while the round was over but SubmissionScoreMultiplier was active are scored with given multiplier.

can_submit(request, problem_instance, check_round_times=True)[source]

Contest admin can always submit. Participant can submit if: a. round is active OR b. SubmissionScoreMultiplier exists and it’s end_time is ahead

class oioioi.mp.controllers.MPRankingController(contest)[source]

Bases: oioioi.rankings.controllers.DefaultRankingController

Changes to Default Ranking: 1. Sum column is just after User column 2. Rounds with earlier start_date are more to the left

description[source]
_iter_rounds(can_see_all, timestamp, partial_key, request=None)[source]
_filter_pis_for_ranking(partial_key, queryset)[source]
_render_ranking_page(key, data, page)[source]
_allow_zero_score()[source]