From 5c3dfd928095ace1c0021bf4107579e2865621ed Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 6 Mar 2013 16:43:12 -0500 Subject: [PATCH] Update correctmap to handle partially correct answers, and fix annotation tests so that they use the new test_system functionality --- common/lib/capa/capa/correctmap.py | 2 +- common/lib/xmodule/xmodule/tests/test_annotatable_module.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/correctmap.py b/common/lib/capa/capa/correctmap.py index 9e76fc20bf..f246b406d5 100644 --- a/common/lib/capa/capa/correctmap.py +++ b/common/lib/capa/capa/correctmap.py @@ -95,7 +95,7 @@ class CorrectMap(object): def is_correct(self, answer_id): if answer_id in self.cmap: - return self.cmap[answer_id]['correctness'] == 'correct' + return self.cmap[answer_id]['correctness'] in ['correct', 'partially-correct'] return None def is_queued(self, answer_id): diff --git a/common/lib/xmodule/xmodule/tests/test_annotatable_module.py b/common/lib/xmodule/xmodule/tests/test_annotatable_module.py index 3f9fe349a0..30f9c9ff92 100644 --- a/common/lib/xmodule/xmodule/tests/test_annotatable_module.py +++ b/common/lib/xmodule/xmodule/tests/test_annotatable_module.py @@ -34,7 +34,7 @@ class AnnotatableModuleTestCase(unittest.TestCase): shared_state = None def setUp(self): - self.annotatable = AnnotatableModule(test_system, self.location, self.definition, self.descriptor, self.instance_state, self.shared_state) + self.annotatable = AnnotatableModule(test_system(), self.location, self.definition, self.descriptor, self.instance_state, self.shared_state) def test_annotation_data_attr(self): el = etree.fromstring('test') @@ -126,4 +126,4 @@ class AnnotatableModuleTestCase(unittest.TestCase): xmltree = etree.fromstring('foo') actual = self.annotatable._extract_instructions(xmltree) - self.assertIsNone(actual) \ No newline at end of file + self.assertIsNone(actual)