From f90dd49556a1968c8b77de0f2b16bb04f9ebe31a Mon Sep 17 00:00:00 2001 From: Will Daly Date: Fri, 29 Mar 2013 10:18:11 -0400 Subject: [PATCH] Fixed bug in parsing of urandom struct so that seed is set to an integer (and correctly saved) instead of a tuple. --- common/lib/capa/capa/capa_problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 68f80006f6..696b12377f 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -118,7 +118,7 @@ class LoncapaProblem(object): # 3. Assign from the OS's random number generator self.seed = state.get('seed', seed) if self.seed is None: - self.seed = struct.unpack('i', os.urandom(4)) + self.seed = struct.unpack('i', os.urandom(4))[0] self.student_answers = state.get('student_answers', {}) if 'correct_map' in state: self.correct_map.set_dict(state['correct_map'])