Commit cdaec1e6 by kimth

CorrectMap.is_queued and .is_right_queuekey defaults to False if answer_id not found

parent b10cf31a
...@@ -66,12 +66,10 @@ class CorrectMap(object): ...@@ -66,12 +66,10 @@ class CorrectMap(object):
return None return None
def is_queued(self,answer_id): def is_queued(self,answer_id):
if answer_id in self.cmap: return self.cmap[answer_id]['queuekey'] is not None return answer_id in self.cmap and self.cmap[answer_id]['queuekey'] is not None
return None
def is_right_queuekey(self, answer_id, test_key): def is_right_queuekey(self, answer_id, test_key):
if answer_id in self.cmap: return self.cmap[answer_id]['queuekey'] == test_key return answer_id in self.cmap and self.cmap[answer_id]['queuekey'] == test_key
return None
def get_npoints(self,answer_id): def get_npoints(self,answer_id):
if self.is_correct(answer_id): if self.is_correct(answer_id):
......
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