:py:mod:`oioioi.oi.controllers` =============================== .. py:module:: oioioi.oi.controllers Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.oi.controllers.OIRegistrationController oioioi.oi.controllers.OIContestController oioioi.oi.controllers.OIOnsiteContestController oioioi.oi.controllers.OIFinalOnsiteContestController oioioi.oi.controllers.BOIOnsiteContestController oioioi.oi.controllers.BOIOnlineContestController Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.oi.controllers.auditLogger .. py:data:: auditLogger .. py:class:: OIRegistrationController(contest) Bases: :py:obj:`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 :attr:`subclasses` class attributes. Classes which have *explicitly* set :attr:`abstract` class attribute to ``True`` are not added to :attr:`subclasses`. If a class has ``modules_with_subclasses`` attribute (list or string), then specified modules for all installed applications can be loaded by calling :meth:`~RegisteredSubclassesBase.load_subclasses`. .. py:property:: form_class .. py:property:: participant_admin .. py:method:: anonymous_can_enter_contest() :classmethod: 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. :rtype: bool .. py:method:: can_enter_contest(request) Determines if the current user is allowed to enter the contest, i.e. see any page related to the contest. The default implementation uses :meth:`filter_visible_contests` with a single-element contest queryset. :rtype: bool .. py:method:: visible_contests_query(request) Provides a :class:`django.db.models.Q` expression which can be used on :class:`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`. .. py:method:: can_register(request) .. py:method:: can_unregister(request, participant) .. py:method:: registration_view(request) .. py:method:: get_contest_participant_info_list(request, user) 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. .. py:method:: mixins_for_admin() Returns an iterable of mixins to add to the default :class:`oioioi.contests.admin.ContestAdmin` for the contest. The default implementation returns an empty tuple. .. py:method:: can_change_terms_accepted_phrase(request) :return: 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. .. py:class:: OIContestController(contest) Bases: :py:obj:`oioioi.programs.controllers.ProgrammingContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:attribute:: description .. py:attribute:: create_forum :annotation: = True .. py:attribute:: show_email_in_participants_data :annotation: = True .. py:method:: fill_evaluation_environ(environ, submission) .. py:method:: registration_controller() .. py:method:: can_submit(request, problem_instance, check_round_times=True) 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. .. py:method:: can_see_stats(request) .. py:method:: should_confirm_submission_receipt(request, submission) .. py:method:: update_user_result_for_problem(result) .. py:method:: default_can_see_ranking(request) .. py:method:: default_contestlogo_url() .. py:method:: default_contesticons_urls() .. py:class:: OIOnsiteContestController(contest) Bases: :py:obj:`OIContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:attribute:: description .. py:class:: OIFinalOnsiteContestController(contest) Bases: :py:obj:`OIOnsiteContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:attribute:: description .. py:method:: can_see_submission_score(request, submission) .. py:method:: update_user_result_for_problem(result) .. py:class:: BOIOnsiteContestController(contest) Bases: :py:obj:`OIOnsiteContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:attribute:: description .. py:attribute:: create_forum :annotation: = False .. py:method:: can_see_test_comments(request, submissionreport) .. py:method:: reveal_score(request, submission) .. py:method:: update_user_result_for_problem(result) .. py:method:: get_visible_reports_kinds(request, submission) .. py:method:: can_print_files(request) .. py:method:: default_contestlogo_url() .. py:method:: default_contesticons_urls() .. py:method:: fill_evaluation_environ(environ, submission) .. py:class:: BOIOnlineContestController(contest) Bases: :py:obj:`BOIOnsiteContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:attribute:: description .. py:attribute:: create_forum :annotation: = False .. py:method:: registration_controller() .. py:method:: is_onsite() Determines whether the contest is on-site.