Merge pull request #1764 from MITx/hotfix/diana/random_check_bug

Fixed bug in parsing of urandom struct so that seed
This commit is contained in:
David Ormsbee
2013-03-29 08:10:49 -07:00

View File

@@ -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'])