def inputfield(course, problem_type, choice=None, input_num=1):
 section_loc = section_location(course)
 ptype = problem_type.replace(' ', '_')
 if (problem_type in ('radio_text', 'checkbox_text')):
  selector_template = 'input#{}_2_{input}'
 else:
  selector_template = 'input#input_{}_2_{input}'
 sel = selector_template.format(section_loc.course_key.make_usage_key('problem', ptype).html_id(), input=input_num)
 if (choice is not None):
  base = ('_choice_' if (problem_type == 'multiple choice') else '_')
  sel = ((sel + base) + str(choice))
 assert world.is_css_present(sel)
 return sel

def inputfield ( course , problem_type , choice = None , input_num = 1 ) : section_loc = section_location ( course ) ptype = problem_type . replace ( ' ' , '_' ) if ( problem_type in ( 'radio_text' , 'checkbox_text' ) ) : selector_template = 'input#{}_2_{input}' else : selector_template = 'input#input_{}_2_{input}' sel = selector_template . format ( section_loc . course_key . make_usage_key ( 'problem' , ptype ) . html_id ( ) , input = input_num ) if ( choice is not None ) : base = ( '_choice_' if ( problem_type == 'multiple choice' ) else '_' ) sel = ( ( sel + base ) + str ( choice ) ) assert world . is_css_present ( sel ) return sel
return the css selector for problem_type .