from typing import List from otree.api import * doc = """Survey for Public Goods Game.""" class Constants(BaseConstants): name_in_url = 'survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age?') gender = models.StringField( widget=widgets.RadioSelect, label='''Choose the gender you most identify with.''', choices=['Male', 'Female', 'Nonbinary', 'Other/Prefer Not to Disclose'] ) race = models.StringField( widget=widgets.RadioSelect, label='''Choose the race/ethnicity that best describes you.''', choices=['Indigenous American or Alaska Native', 'Asian or Pacific Islander', 'Black or African American', 'White or Caucasian', 'Hispanic or Latino', 'Multiracial or Biracial', 'Other'] ) socioecon_status = models.StringField( widget=widgets.RadioSelect, label='''Choose the socioeconomic range that best describes you.''', choices=['Low income', 'Middle income', 'High income'] ) econ_classes = models.IntegerField( label='''How many Economics classes have you taken?''' ) math_classes = models.IntegerField( label='''How many Math classes have you taken?''' ) crt_bat = models.FloatField( label=''' A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How many dollars does the ball cost?''' ) crt_widget = models.IntegerField( label=''' "If it takes 5 machines 5 minutes to make 5 widgets, how many minutes would it take 100 machines to make 100 widgets?" ''' ) crt_lake = models.IntegerField( label=''' In a lake, there is a patch of lily pads. Every day, the patch doubles in size. If it takes 48 days for the patch to cover the entire lake, how many days would it take for the patch to cover half of the lake? ''' ) # FUNCTIONS # PAGES class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'race', 'socioecon_status', 'econ_classes', 'math_classes'] class CRT(Page): form_model = 'player' form_fields = ['crt_bat', 'crt_widget', 'crt_lake'] page_sequence = [Demographics, CRT]