def assert_submitted(course, problem_type, choices):
 all_choices = ['choice_0', 'choice_1', 'choice_2', 'choice_3']
 for this_choice in all_choices:
  def submit_problem():
   element = world.css_find(inputfield(course, problem_type, choice=this_choice))
   if (this_choice in choices):
    assert element.checked
   else:
    assert (not element.checked)
  world.retry_on_exception(submit_problem)

def assert_submitted ( course , problem_type , choices ) : all_choices = [ 'choice_0' , 'choice_1' , 'choice_2' , 'choice_3' ] for this_choice in all_choices : def submit_problem ( ) : element = world . css_find ( inputfield ( course , problem_type , choice = this_choice ) ) if ( this_choice in choices ) : assert element . checked else : assert ( not element . checked ) world . retry_on_exception ( submit_problem )
assert that choice names given in *choices* are the only ones submitted .