Module Contents



ContestController mixin that sets up quiz config for the contest.


Defines rules for quizzes.

class oioioi.quizzes.controllers.QuizContestControllerMixin[source]

Bases: object

ContestController mixin that sets up quiz config for the contest.


Determines if checking a quiz questions’ answer should be case insensitive.

class oioioi.quizzes.controllers.QuizProblemController(problem)[source]

Bases: oioioi.problems.controllers.ProblemController

Defines rules for quizzes.


Called whan a (usually new) problem has just got the controller attached or after the problem has been modified.

_form_field_id_for_question(problem_instance, question)[source]
validate_submission_form(request, problem_instance, form, cleaned_data)[source]
render_question(request, question)[source]
render_answer(request, answer)[source]
add_question_to_form(request, form, problem_instance, question)[source]
select_questions(user, problem_instance, submission)[source]
adjust_submission_form(request, form, problem_instance)[source]
create_submission(request, problem_instance, form_data, **kwargs)[source]
_submit_answers(selected_answers, question, submission)[source]
_get_selected_answers(form_data, field_id, question)[source]

Returns an iterable of mixins to add to the default oioioi.problems.admin.ProblemAdmin for this particular problem.

The default implementation returns an empty tuple.


Returns a list of tuples (url, name) that will be displayed under actions in ProblemSite.

render_report_failure(request, report)[source]
render_report(request, report)[source]

Renders the given report to HTML.

Default implementation supports only rendering reports of kind FAILURE and raises NotImplementedError otherwise.

render_submission(request, submission)[source]

Renders the given submission footer to HTML.

Footer is shown under the submission reports. The default implementation returns an empty string.

fill_evaluation_environ(environ, submission, **kwargs)[source]

Fills a minimal environment with evaluation receipt and other values required by the evaluation machinery.

Passed environ should already contain entries for the actiual data to be judged (for example the source file to evaluate).

Details on which keys need to be present should be specified by particular subclasses.

As the result, environ will be filled at least with a suitable evaluation recipe.

generate_base_environ(environ, submission, **kwargs)[source]
generate_initial_evaluation_environ(environ, submission, **kwargs)[source]

If the ProblemController supports problem statement, opening the problem in a contest shows the associated problem statement or an information that it doesn’t have one. On the other hand, if it doesn’t support the problem statement, opening the problem redirects to submit solution page.