Commit b53327a6 by kimth

Correctmap state debugging continued...

parent ff38f5b3
......@@ -101,6 +101,7 @@ class LoncapaProblem(object):
print 'THK: LoncapaProblem.__init__'
print json.dumps(state['correct_map'], indent=4)
self.correct_map.set_dict(state['correct_map'])
print json.dumps(self.correct_map.get_dict(), indent=4)
if 'done' in state:
self.done = state['done']
......
......@@ -58,10 +58,11 @@ class CorrectMap(object):
dict of dicts format.
'''
if correct_map and not (type(correct_map[correct_map.keys()[0]]) == dict):
self.__init__() # empty current dict
for k in correct_map: self.set(k, correct_map[k]) # create new dict entries
self.__init__() # empty current dict
for k in correct_map: self.set(k, correct_map[k]) # create new dict entries
else:
self.cmap = correct_map
self.__init__()
for k in correct_map: self.set(k, **correct_map[k])
def is_correct(self, answer_id):
if answer_id in self.cmap: return self.cmap[answer_id]['correctness'] == 'correct'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment