oioioi.acm.controllers

Module Contents

Classes

ACMContestController

Contains the contest logic and rules.

ACMOpenContestController

Contains the contest logic and rules.

_FakeUserResultForProblem

ACMRankingController

Ranking system uses two types of keys: "partial key"s and "full key"s.

NotificationsMixinForACMContestController

Modifies default contest notification settings from

Attributes

oioioi.acm.controllers.IGNORED_STATUSES = ['CE', 'SE', '?'][source]
class oioioi.acm.controllers.ACMContestController(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]
registration_controller()[source]
get_round_freeze_time(round)[source]

Returns time after which any further updates should be non-public.

fill_evaluation_environ(environ, submission)[source]
update_report_statuses(submission, queryset)[source]

Updates statuses of reports for the newly judged submission.

Usually this involves looking at reports and deciding which should be ACTIVE and which should be SUPERSEDED.

Parameters
update_submission_score(submission)[source]

Updates status, score and comment in a submission.

Usually this involves looking at active reports and aggregating information from them.

get_submission_relative_time(submission)[source]
_fill_user_result_for_problem(result, pi_submissions)[source]
update_user_result_for_problem(result)[source]
results_visible(request, submission)[source]

Determines whether it is a good time to show the submission’s results.

This method is not used directly in any code outside of the controllers. It’s a helper method used in a number of other controller methods, as described.

The default implementations uses the round’s results_date. If it’s None, results are not available. Admins are always shown the results.

get_visible_reports_kinds(request, submission)[source]
can_see_submission_score(request, submission)[source]
can_see_submission_status(request, submission)[source]

Statuses are taken from initial tests which are always public.

render_submission_date(submission, shortened=False)[source]
ranking_controller()[source]
can_see_round(request_or_context, round)[source]

Determines if the current user is allowed to see the given round.

If not, everything connected with this round will be hidden.

The default implementation checks if the round is not in the future.

get_default_safe_exec_mode()[source]
class oioioi.acm.controllers.ACMOpenContestController(contest)[source]

Bases: ACMContestController

Contains the contest logic and rules.

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

description[source]
registration_controller()[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.

class oioioi.acm.controllers._FakeUserResultForProblem(user, problem_instance)[source]

Bases: object

property user_id[source]
property problem_instance_id[source]
__repr__()[source]

Return repr(self).

class oioioi.acm.controllers.ACMRankingController(contest)[source]

Bases: oioioi.rankings.controllers.DefaultRankingController

Ranking system uses two types of keys: “partial key”s and “full key”s. Please note that full keys are abbreviated in the code as “key”s.

A pair (request, partial_key) should allow to build a full key, while a partial_key can always be extracted from the full key. partial keys identify the rounds to display and are used everywhere outside controllers and rankingsd (e.g. in views and urls). However, the actual ranking contents can depend on many other factors, like user permissions. This was the reason for introduction of full keys, which are always sufficient to choose the right data for serialization and display.

description[source]
_iter_rounds(can_see_all, timestamp, partial_key, request=None)[source]
can_search_for_users()[source]

Determines if in this ranking, searching for users is enabled.

_render_ranking_page(key, data, page)[source]
_get_csv_header(key, data)[source]
_get_csv_row(key, row)[source]
filter_users_for_ranking(key, queryset)[source]
_get_old_results(freeze_time, pis, users)[source]
serialize_ranking(key)[source]

Returns some data (representing ranking). This data will be used by render_ranking() to generate the html code.

class oioioi.acm.controllers.NotificationsMixinForACMContestController[source]

Bases: object

Modifies default contest notification settings from NotificationsMixinForContestController. It enables sending notifications about new public messages to all participants and modifies submission notification messages so that

users_to_receive_public_message_notification()[source]
get_notification_message_submission_judged(submission)[source]