Example #1
0
 def __init__(self, problem_list, **kwargs):
     if isinstance(problem_list, Problem):
         problem_list = [problem_list]
     super(Exam, self).__init__(stack(problem_list))
Example #2
0
 def test_stack(self):
     self.assertEqual(
         stack(['patate', 'poil']), 'patate\npoil')
     a = Block('patate')
     b = Block('poil')
     self.assertEqual(stack([a,b]), 'patate\npoil')
Example #3
0
 def formated_content(self):
     if hasattr(self.content, '__iter__'):
         return stack(self.content)
     return self.content
Example #4
0
 def __init__(self, content=None, nb_compile_times=1):
     if content is not None:
         self.content = content
     if hasattr(self.content, '__iter__'):
         self.content = stack(self.content)
     self.nb_compile_times = nb_compile_times