def get_dropdown_question(self,html_frag):
	field = typeformio.dropdown_field()
	logging.info("dropdown field question") 
        choices = [ l.text for l in html_frag.find_all("option") if l.text !='' ]
        map(field.add_option,choices)
        field.set_tags((html_frag.find("select")["name"]).replace(".",":"))
	return field 
Beispiel #2
0
 def get_dropdown_question(self, html_frag):
     field = typeformio.dropdown_field()
     logging.info("dropdown field question")
     choices = [
         l.text for l in html_frag.find_all("option") if l.text != ''
     ]
     map(field.add_option, choices)
     field.set_tags((html_frag.find("select")["name"]).replace(".", ":"))
     return field
Beispiel #3
0
 def get_select_question(self, html_frag, question):
     logging.info("select question")
     option_data = []
     field = typeformio.dropdown_field(question)
     for i, option in enumerate(html_frag.find_all("option")):
         # removing the repeating question in the text of the first option
         option_text = ' '.join(option.stripped_strings)
         option_data.append({'text': option_text, 'text_input': False})
         field.add_option(option_text)
     return field
Beispiel #4
0
    def get_select_question(self,html_frag,question):
	logging.info("select question")
	option_data = []
	field = typeformio.dropdown_field(question)
	for i,option in enumerate(html_frag.find_all("option")):
	    # removing the repeating question in the text of the first option
	    option_text = ' '.join(option.stripped_strings)
	    option_data.append({'text':option_text,'text_input':False})
	    field.add_option(option_text)
	return field