from otree.api import ( Page, WaitPage, models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) 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='Please enter your age?', min=13, max=125) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Non-binary', 'Non-binary'], ['Prefer not to say', 'Prefer not to say']], label='What is your gender?', widget=widgets.RadioSelect, ) race = models.StringField( choices=[['White', 'White'], ['Black or African American', 'Black or African American'], ['Asian', 'Asian'], ['American Indian or Alaska Native', 'American Indian or Alaska Native'], ['Native Hawaiian or Other Pacific Islander', 'Native Hawaiian or Other Pacific Islander'], ['Race not listed','Race not listed'], ['Prefer not to say', 'Prefer not to say']], label='What racial or ethnic groups do you identify with? Please select all that apply.', widget=widgets.RadioSelect, ) education = models.StringField( choices=[['Grades 1-8', 'Grades 1-8'], ['Grades 9-11', 'Grades 9-11'], ['High school diploma', 'High school diploma'], ['Some college but no degree', 'Some college but no degree'], ['Community college degree', 'Community college degree'], ['Vocational or technical school degree', 'Vocational or technical school degree'], ['BA or BS degree', 'BA or BS degree'], ['Graduate or professional school', 'Graduate or professional school']], label='What is the highest level of schooling you have completed? ', widget=widgets.RadioSelect, ) Hometown = models.StringField(label='What is your hometown?') Current_City = models.StringField(label='What city are you currently living in?') Major = models.StringField(label='What is your major?') Politics = models.StringField( choices=[['Republican', 'Republican'], ['Democrat', 'Democrat'], ['Green Party', 'Green Party'], ['Independent', 'Independent'], ['Libertarian', 'Libertarian'], ['Other', 'Other'], ['Unsure', 'Unsure'], ['Prefer not to answer', 'Prefer not to answer']], label='What political party do you align the most with on climate related policy?', widget=widgets.RadioSelect, ) Q1_1 = models.StringField( choices = [ [1, 'Not at all'], [2, 'A little'], [3, 'Somewhat'], [4, 'Very'], [5, 'Extremely'], ] ) Q2_1 = models.StringField( choices=[ [1, 'No impact'], [2, 'A small impact'], [3, 'A moderate impact'], [4, 'A large impact'], [5, 'An extremely large impact'], ] ) Q3_1 = models.StringField( choices=[ [1, 'Strongly disagree'], [2, 'Mildly disagree'], [3, 'Neutral'], [4, 'Mildly agree'], [5, 'Strongly agree'], ] ) Q4_1 = models.StringField( choices=[ [1, 'Strongly disagree'], [2, 'Mildly disagree'], [3, 'Neutral'], [4, 'Mildly agree'], [5, 'Strongly agree'], ] ) Q5_1 = models.StringField( choices=[ [1, 'None'], [2, 'A little'], [3, 'A moderate amount'], [4, 'Quite a bit'], [5, 'A great deal'], ] ) Q6_1 = models.StringField( choices=[ [1, 'Never'], [2, 'Rarely'], [3, 'Sometimes'], [4, 'Very often'], [5, 'Extremely often'], ] ) Q7_1 = models.StringField( choices=[ [1, 'Strongly oppose'], [2, 'Somewhat oppose'], [3, 'Neutral'], [4, 'Somewhat support'], [5, 'Strongly support'], ] ) < table class ="table" > {{ for field in form}} < tr > < th > {{field.label}} < / th > {{ for choice in field}} < td > {{choice}} < / td >\ {{endfor}} < / tr > {{endfor}} < / table > crt_bat = models.IntegerField( label=''' A bat and a ball cost 22 dollars in total. The bat costs 20 dollars 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'] class CognitiveReflectionTest(Page): form_model = 'player' form_fields = ['crt_bat', 'crt_widget', 'crt_lake'] page_sequence = [Demographics, CognitiveReflectionTest]