from otree.api import * c = cu doc = 'Demographic Questions' class C(BaseConstants): NAME_IN_URL = 'my_survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(max=1000, min=18, label='What is your age?') gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female'], ['Other', 'Other']], label='Please indicate your gender ') education = models.StringField(choices=[['High School or Less', 'High School or Less'], ['Some College', 'Some College'], ['Current College Student', 'Current College Student'], ["Bachelor's Degree", "Bachelor's Degree"], ['Graduate or Professional Degree', 'Graduate or Professional Degree']], label='Please indicate your level of education') income = models.StringField(choices=[['Less than $25,000', 'Less than $25,000'], ['$25,000 to $34,999', '$25,000 to $34,999'], ['$35,000 to $49,999', '$35,000 to $49,999'], ['$50,000 to $74,999', '$50,000 to $74,999'], ['$75,000 to $99,999', '$75,000 to $99,999'], ['$100,000 to $124,999', '$100,000 to $124,999'], ['$125,000 to $149,999', '$125,000 to $149,999'], ['$150,000 to $174,999', '$150,000 to $174,999'], ['$175,000 to $199,999', '$175,000 to $199,999'], ['$200,000 to $249,999', '$200,000 to $249,999'], ['$250,000 or more', '$250,000 or more']], label='Please indicate your level of income') race = models.StringField(choices=[['Asian/Pacific Islander ', 'Asian/Pacific Islander '], ['African American ', 'African American '], ['Caucasian/White ', 'Caucasian/White '], ['Native American/Indigenous', 'Native American/Indigenous'], ['Other', 'Other'] ], label='Please indicate your race') hispanic = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Are you Hispanic?') class Survey(Page): form_model = 'player' form_fields = ['age', 'gender', 'education', 'income', 'race', 'hispanic'] page_sequence = [Survey]