oioioi.disqualification.controllers

Module Contents

Classes

DisqualificationContestControllerMixin

ContestController mixin that adds a disqualification functionality to

DisqualificationProgrammingContestControllerMixin

ContestController mixin that renders submission disqualification info.

WithDisqualificationRankingControllerMixin

RankingController mixin that manages disqualification module influence

class oioioi.disqualification.controllers.DisqualificationContestControllerMixin[source]

Bases: object

ContestController mixin that adds a disqualification functionality to the contest.

is_submission_disqualified(submission)[source]

Decides whether the submission is currently disqualified.

This won’t automatically propagate to user disqualification. Used mostly with single submission context.

has_disqualification_history(submission)[source]

Should be True if the submission was disqualified anytime.

This method is for example used to check if the disqualification admin panel should be displayed.

is_any_submission_to_problem_disqualified(user, problem_instance)[source]

Should be True if the given user has any disqualified submission to this problem.

If so, this will usually result in hiding scores in other submissions to this problem.

is_user_disqualified(request, user)[source]

True if the user should be considered disqualified

The default implementation does not infer it from previous methods.

user_has_disqualification_history(request, user)[source]

True if the user was disqualified anytime.

This method is for example used to check if the disqualification admin panel should be displayed.

exclude_disqualified_users(queryset)[source]

Filters the queryset of User to select only users which are not disqualified in this contest.

change_submission_kind(submission, kind)[source]

Changing the kind of submission should undisqualify given submission

_render_disqualification_reason(request, submission)[source]

Renders part with reason of the given submission disqualification.

This method is only used internally.

_get_contest_disq_info()[source]
render_submission_disqualifiaction(request, submission)[source]

Renders the disqualification reason of the given submission to HTML.

_render_contestwide_disqualification_reason(request, user)[source]

Renders part with reason of the given user disqualification not directly associated with any particular submission.

This method is only used internally.

render_my_submissions_header(request, submissions)[source]
render_disqualifications(request, user, submissions)[source]

Renders all disqualifications of the given user to HTML, which may be put anywhere on the site.

This method should process only submission from submissions.

get_contest_participant_info_list(request, user)[source]
class oioioi.disqualification.controllers.DisqualificationProgrammingContestControllerMixin[source]

Bases: object

ContestController mixin that renders submission disqualification info.

render_submission(request, submission)[source]
class oioioi.disqualification.controllers.WithDisqualificationRankingControllerMixin[source]

Bases: object

RankingController mixin that manages disqualification module influence on rankings.

_show_disqualified(key)[source]

Decides if disqualified users should be included in the ranking.

They will be marked as disqualified and will not influence the places of other contestants.

filter_users_for_ranking(key, queryset)[source]
_render_ranking_page(key, data, page)[source]
_get_csv_header(key, data)[source]
_get_csv_row(key, row)[source]
serialize_ranking(key)[source]
_annotate_disqualified(key, data)[source]
_ignore_in_ranking_places(data_row)[source]