Radio button inputs: multiple choice or true/false
Radio button inputs: multiple choice or true/false
TODO: allow order of choices to be randomized, following lon-capa spec. Use "location" attribute,
TODO: allow order of choices to be randomized, following lon-capa spec. Use
ie random, top, bottom.
"location" attribute, ie random, top, bottom.
'''
'''
eid=element.get('id')
eid=element.get('id')
ifelement.get('type')=="MultipleChoice":
ifelement.get('type')=="MultipleChoice":
type="radio"
element_type="radio"
elifelement.get('type')=="TrueFalse":
elifelement.get('type')=="TrueFalse":
type="checkbox"
element_type="checkbox"
else:
else:
type="radio"
element_type="radio"
choices=[]
choices=[]
forchoiceinelement:
forchoiceinelement:
ifnotchoice.tag=='choice':
ifnotchoice.tag=='choice':
raiseException("[courseware.capa.inputtypes.choicegroup] Error only <choice> tags should be immediate children of a <choicegroup>, found %s instead"%choice.tag)