assertchoice.tag=="choice","only <choice> tags should be immediate children of a <choicegroup>"
choices[choice.get("name")]=etree.tostring(choice[0])# TODO: what if choice[0] has math tags in it?
ifnotchoice.tag=='choice':
raiseException,"[courseware.capa.inputtypes.choicegroup] Error only <choice> tags should be immediate children of a <choicegroup>, found %s instead"%choice.tag
ctext=""
ctext+=''.join([etree.tostring(x)forxinchoice])# TODO: what if choice[0] has math tags in it?