oioioi.contests.problem_instance_controller

Module Contents

Classes

ProblemInstanceController

ProblemInstanceController decides whether to call problem

class oioioi.contests.problem_instance_controller.ProblemInstanceController(problem_instance)[source]

Bases: object

ProblemInstanceController decides whether to call problem controller or contest controller. Problem controller will be chosen if the problem instance is not attached to any contest (eg. for main_problem_instance).

Outside functions which want to call one of the above controllers and it is not clear that contest controller exists, should call ProblemInstanceController, example:

problem_instance.contest.controller.get_submissions_limit()  # WRONG
problem_instance.controller.get_submissions_limit()  # GOOD

From its functions the contest controller can call the problem controller, but the problem controller should not call the contest controller.

For visuals:

Call, for example *.get_submissions_limit()
                    |
                    V
       ProblemInstanceController
         |                    |
         V                    V
ContestController  -->  ProblemController
__getattr__(name)[source]