예제 #1
0
파일: problem.py 프로젝트: wkoha/xblock-sdk
 def calc_context(self, context):
     """If we have a script, run it, and return the resulting context."""
     if self.script:
         # Seed the random number for the student
         if not self.seed:
             self.set_student_seed()
         random.seed(self.seed)
         script_vals = run_script(self.script)
         context = dict(context)
         context.update(script_vals)
     return context
예제 #2
0
 def calc_context(self, context):
     """If we have a script, run it, and return the resulting context."""
     if self.script:
         # Seed the random number for the student
         if not self.seed:
             self.set_student_seed()
         random.seed(self.seed)
         script_vals = run_script(self.script)
         context = dict(context)
         context.update(script_vals)
     return context