def create_multiple_choice_xml(correct_choice=2, num_choices=4):
 choices = [False for _ in range(num_choices)]
 choices[correct_choice] = True
 choice_names = ['choice_{}'.format(index) for index in range(num_choices)]
 question_text = 'The correct answer is Choice {}'.format(correct_choice)
 return MultipleChoiceResponseXMLFactory().build_xml(question_text=question_text, choices=choices, choice_names=choice_names)

def create_multiple_choice_xml ( correct_choice = 2 , num_choices = 4 ) : choices = [ False for _ in range ( num_choices ) ] choices [ correct_choice ] = True choice_names = [ 'choice_{}' . format ( index ) for index in range ( num_choices ) ] question_text = 'The correct answer is Choice {}' . format ( correct_choice ) return MultipleChoiceResponseXMLFactory ( ) . build_xml ( question_text = question_text , choices = choices , choice_names = choice_names )
return the multiple choice problem xml .