oioioi.usercontests.controllers

Module Contents

Classes

UserContestController

Contains the contest logic and rules.

class oioioi.usercontests.controllers.UserContestController(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]
registration_controller()[source]
can_see_test(request, test)[source]
can_see_checker_exe(request, checker)[source]
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.

filter_visible_sources(request, queryset)[source]

Determines which sources the user could see.

This usually involves cross-user privileges, like publicizing sources. Default implementations delegates to filter_my_visible_submissions(), except for admins and observers, which get full access.

Queryset’s model should be oioioi.contest.Submission

can_see_source(request, submission)[source]

Check if submission’s source should be visible. :type submission: oioioi.contest.Submission

Consider using filter_visible_sources instead, especially for batch queries.