Adding multiple-choice loncapa integration.

This commit is contained in:
Julian Arni
2013-02-06 20:36:44 -05:00
committed by Victor Shnayder
parent b6ec41cae0
commit a770e34bec

View File

@@ -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):
'''