From 8a75e1ad19894101863bfbcdb3814955488b9d98 Mon Sep 17 00:00:00 2001 From: Julian Arni Date: Thu, 7 Feb 2013 14:50:18 -0500 Subject: [PATCH] Added comment --- common/lib/capa/capa/responsetypes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 1ecba36d50..0ecbfdc55d 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -633,9 +633,11 @@ class MultipleChoiceResponse(LoncapaResponse): # define correct choices (after calling secondary setup) xml = self.xml 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"] + # contextualize correct attribute and then select ones for which + # correct = "true" + 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): '''