Exemplo n.º 1
0
from questionnaire import Questionnaire
q = Questionnaire(can_go_back=False)


def email(email):
    import re
    if not re.match(r'[^@]+@[^@]+\.[^@]+', email):
        return 'Enter a valid email'


def one(options):
    if len(options) < 1:
        return 'You must choose at least 1 type of junk mail'


def join(options):
    return ', '.join(options)


q.raw('email').validate(email)
q.many('junk_mail', 'this one weird trick', 'cheap viagra', 'dermatologists hate her').validate(one).transform(join)

q.run()
print(q.answers)
Exemplo n.º 2
0
from questionnaire import Questionnaire
q = Questionnaire()


def two(options):
    if len(options) < 2:
        return 'You must choose at least 2 options'


def join(options):
    return ', '.join(options)


q.many('options',
       'Option 1',
       'Option 2',
       'Option 3',
       prompt='Choose some options').validate(two).transform(join)
q.many('more', 'Option 4', 'Option 5', 'Option 6',
       prompt='Choose some more').validate(two).transform(join)

q.run()
print(q.answers)

q.many('yet_more',
       'Option 7',
       'Option 8',
       prompt='And more...',
       default=[0, 1])
q.many('done', 'Option 9', 'Option 10', prompt='Last ones', default=1)
Exemplo n.º 3
0
        quest.raw(translate_client.translate("start_date",target_language=abbreviated_language)['translatedText'],prompt=translate_client.translate('what is the start year?',target_language=abbreviated_language)['translatedText'])
        quest.raw(translate_client.translate("end_date",target_language=abbreviated_language)['translatedText'],prompt=translate_client.translate('what is the end year?',target_language=abbreviated_language)['translatedText'])
        quest.raw(translate_client.translate("institution",target_language=abbreviated_language)['translatedText'],prompt=translate_client.translate('What is the company name?',target_language=abbreviated_language)['translatedText'])
        quest.raw(translate_client.translate("task",target_language=abbreviated_language)['translatedText'],prompt=translate_client.translate('give a brief description of your responsibilities',target_language=abbreviated_language)['translatedText'])

except:
    print("Number only, " + translate_client.translate('number only',target_language=abbreviated_language)['translatedText'])


quest.run()
quest.format_answers(fmt='array')
PART_FIVE = "PART_FIVE = " + quest.format_answers(fmt='array')
exec(PART_FIVE)

questi = Questionnaire()
questi.many("Choose the languages you speak", 'Afrikaans', 'Albanian', 'Amharic', 'Arabic', 'Armenian', 'Azerbaijani', 'Basque', 'Belarusian', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Cebuano', 'Chichewa', 'Chinese (Simplified)', 'Chinese (Traditional)', 'Corsican', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Esperanto', 'Estonian', 'Filipino', 'Finnish', 'French', 'Frisian', 'Galician', 'Georgian', 'German', 'Greek', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hawaiian', 'Hebrew', 'Hindi', 'Hmong', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish', 'Italian', 'Japanese', 'Javanese', 'Kannada', 'Kazakh', 'Khmer', 'Korean', 'Kurdish (Kurmanji)', 'Kyrgyz', 'Lao', 'Latin', 'Latvian', 'Lithuanian', 'Luxembourgish', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Myanmar (Burmese)', 'Nepali', 'Norwegian', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Scots Gaelic', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala', 'Slovak', 'Slovenian', 'Somali', 'Spanish', 'Sundanese', 'Swahili', 'Swedish', 'Tajik', 'Tamil', 'Telugu', 'Thai', 'Turkish', 'Ukrainian', 'Urdu', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa', 'Yiddish', 'Yoruba', 'Zulu')

questi.run()
PART_SIX = questi.format_answers(fmt='array')
PART_SIX = "PART_SIX = " + questi.format_answers(fmt='array')
exec(PART_SIX)






questio = Questionnaire()
questio.raw(translate_client.translate("Numbers of Volunteer Experiences Previously Held",target_language=abbreviated_language)['translatedText'],prompt=translate_client.translate('Number of Volunteer Positions previously Held?',target_language=abbreviated_language)['translatedText'])
questio.run()
PART_SEVEN = "PART_SEVEN = " + questio.format_answers(fmt='array')
Exemplo n.º 4
0
from questionnaire import Questionnaire
q = Questionnaire()


def two(options):
    if len(options) < 2:
        return 'You must choose at least 2 options'


def join(options):
    return ', '.join(options)


q.many('options', 'Option 1', 'Option 2', 'Option 3', prompt='Choose some options').validate(two).transform(join)
q.many('more', 'Option 4', 'Option 5', 'Option 6', prompt='Choose some more').validate(two).transform(join)

q.run()
print(q.answers)


q.many('yet_more', 'Option 7', 'Option 8', prompt='And more...', default=[0, 1])
q.many('done', 'Option 9', 'Option 10', prompt='Last ones', default=1)

q.run()
print(q.answers)
Exemplo n.º 5
0
from questionnaire import Questionnaire
q = Questionnaire(can_go_back=False)


def email(email):
    import re
    if not re.match(r'[^@]+@[^@]+\.[^@]+', email):
        return 'Enter a valid email'


def one(options):
    if len(options) < 1:
        return 'You must choose at least 1 type of junk mail'


def join(options):
    return ', '.join(options)


q.raw('email').validate(email)
q.many('junk_mail', 'this one weird trick', 'cheap viagra',
       'dermatologists hate her').validate(one).transform(join)

q.run()
print(q.answers)
Exemplo n.º 6
0
from questionnaire import Questionnaire
q = Questionnaire()

q.one('day', 'monday', 'friday', 'saturday')
q.one('time', 'morning', 'night')

q.many('activities', 'tacos de pastor', 'go to cantina',
       'write code').condition(('time', 'night'))
q.many('activities', 'barbacoa', 'watch footy', 'walk dog').condition(
    ('day', 'saturday'), ('time', 'morning'))
q.many('activities', 'eat granola', 'get dressed', 'go to work').condition(
    ('time', 'morning'))

q.run()
print(q.format_answers(fmt='array'))
Exemplo n.º 7
0
from questionnaire import Questionnaire
q = Questionnaire()

q.one('day', 'monday', 'friday', 'saturday')
q.one('time', 'morning', 'night')

q.many('activities', 'tacos de pastor', 'go to cantina', 'write code').condition(('time', 'night'))
q.many('activities', 'barbacoa', 'watch footy', 'walk dog').condition(('day', 'saturday'), ('time', 'morning'))
q.many('activities', 'eat granola', 'get dressed', 'go to work').condition(('time', 'morning'))

q.run()
print(q.format_answers(fmt='array'))