from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Elisa Macchi' doc = """ Intro """ class Constants(BaseConstants): name_in_url = 'intro' players_per_group = None num_rounds = 1 ### Instructions consent_template = 'intro/consent_template.html' n_questions = 6 n_images = 3 # Time num_rounds = 1 max_time = 40 # Payoffs: participation_fee = c(5000) max_bonus = c(5000) min_bonus = c(5000) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # Demographics year_of_birth = models.IntegerField(choices=range(1930, 2000, 1), label='''In which year were you born?''') gender = models.BooleanField(choices=[[1, 'Male'], [0, 'Female']], label='''Are you:''' ) income = models.CurrencyField( label='''What is your monthly personal income in shillings? Please, provide your best approximation.''', choices=currency_range(c(0), c(50000000), c(20000)) ) hhincome = models.CurrencyField( label=''' What is your monthly household income in shillings? Please, provide your best guess.''', choices=currency_range(c(0), c(100000000), c(50000)) ) marital_status = models.IntegerField(choices=[[1, 'Single'], [2, 'Married'], [3, 'Living as married'], [4, 'Separated'], [5, 'Divorced'], [6, 'Widowed']], widget=widgets.RadioSelectHorizontal, label=''' Are you:''' ) children = models.IntegerField(choices=range(0, 16, 1), label=''' How many children do you have? Please, only count those you support financially.''' ) race = models.IntegerField(choices=[[1, 'African'], [2, 'Indian'], [3, 'Asian'], [4, 'White'], [5, 'Mixed']], label='''What is your race?''') education = models.IntegerField(choices=[[1, 'Primary school'], [2, 'Secondary school'], [3, 'Technical/Vocational training'], [4, 'Some College'], [5, 'Bachelor Degree'], [6, 'Masters Degree'], [7, 'Post-graduate degree'], [8, 'None of the above']], widget=widgets.RadioSelect, label=''' What is the highest level of education you have completed?''' ) occupation = models.IntegerField(choices=[[1,'Employee'], [2, 'Mobile money'], [3, 'Retail shop'], [4, 'Sells clothes/boutique'], [5, 'Diary'], [6, 'Poultry'], [7, 'Phone accessories'], [8, 'Agricultural produce and drug shop'], [9, 'Hardware store'], [10, 'Not employed'], [11,'Other (specify)']], widget=widgets.RadioSelect, label=''' What is your occupation?''' ) other_occupation = models.StringField( label=''' Please, specify your occupation:''', blank=True )