From a770e34bec6b339776f64f46ad09faf8659d48e6 Mon Sep 17 00:00:00 2001 From: Julian Arni Date: Wed, 6 Feb 2013 20:36:44 -0500 Subject: [PATCH] Adding multiple-choice loncapa integration. --- common/lib/capa/capa/responsetypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 78c986a963..1ecba36d50 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -632,8 +632,10 @@ class MultipleChoiceResponse(LoncapaResponse): # define correct choices (after calling secondary setup) xml = self.xml - cxml = xml.xpath('//*[@id=$id]//choice[@correct="true"]', id=xml.get('id')) - self.correct_choices = [contextualize_text(choice.get('name'), self.context) for choice in cxml] + cxml = xml.xpath('//*[@id=$id]//choice', id=xml.get('id')) + self.correct_choices = [contextualize_text(choice.get('name'), + self.context) for choice in cxml if + contextualize_text(choice.get('correct'), self.context) == "true"] def mc_setup_response(self): '''