Ejemplo n.º 1
0
    def __init__(self, system, xml):
        """ Store context needed for the test across transactions """
        self.system = system
        self.xml = xml

        # Construct a small pool of unique seeds
        # To keep our implementation in line with the one capa actually uses,
        # construct the problems, then use the seeds they generate
        self.seeds = [
            lcp.LoncapaProblem(self.xml, 'problem_id', system=self.system).seed
            for i in range(self.NUM_UNIQUE_SEEDS)
        ]
Ejemplo n.º 2
0
    def __init__(self):
        """ Create the problem """

        # Get the context (re-used across transactions)
        self.context = TestContext.singleton()

        # Create a new custom response problem
        # using one of a small number of unique seeds
        # We're assuming that the capa module is limiting the number
        # of seeds (currently not the case for certain settings)
        self.problem = lcp.LoncapaProblem(self.context.xml,
                                          '1',
                                          state=None,
                                          seed=self.context.random_seed(),
                                          system=self.context.system)