From 269468ba6ef7cedd9130bd05e435c29dbccb3dac Mon Sep 17 00:00:00 2001 From: kimth Date: Tue, 17 Jul 2012 10:47:10 -0400 Subject: [PATCH] CorrectMap.is_queued and .is_right_queuekey defaults to False if answer_id not found --- common/lib/capa/capa/correctmap.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/lib/capa/capa/correctmap.py b/common/lib/capa/capa/correctmap.py index c0426caffb..11c5bb75f1 100644 --- a/common/lib/capa/capa/correctmap.py +++ b/common/lib/capa/capa/correctmap.py @@ -66,12 +66,10 @@ class CorrectMap(object): return None def is_queued(self,answer_id): - if answer_id in self.cmap: return self.cmap[answer_id]['queuekey'] is not None - return None + return answer_id in self.cmap and self.cmap[answer_id]['queuekey'] is not None def is_right_queuekey(self, answer_id, test_key): - if answer_id in self.cmap: return self.cmap[answer_id]['queuekey'] == test_key - return None + return answer_id in self.cmap and self.cmap[answer_id]['queuekey'] == test_key def get_npoints(self,answer_id): if self.is_correct(answer_id):