from otree.api import * doc = """ Demographic Information Questions """ class C(BaseConstants): PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 NAME_IN_URL = 'demographic_questions_nogender' male_link = [['https://i.imgur.com/cKIK5BW.png', 'Adam'], ['https://i.imgur.com/ANNCedm.png', 'Ben'], ['https://i.imgur.com/RpiKCuq.png', 'Charles'], ['https://i.imgur.com/Yf17Sdv.png', 'Daniel'], ['https://i.imgur.com/wKTO2pm.png', 'Edward'], ['https://i.imgur.com/mABiM5L.png', 'George'], ['https://i.imgur.com/BL7Vp8G.png', 'Henry'], ['https://i.imgur.com/emkx6dl.png', 'John'], ['https://i.imgur.com/iWfKsiq.png', 'Martin'], ['https://i.imgur.com/8nIOJfG.png', 'Tom'] ] female_link = [['https://i.imgur.com/mcnlsDa.png', 'Anne'], ['https://i.imgur.com/hQTTOPT.png', 'Barbara'], ['https://i.imgur.com/0eHjDYg.png', 'Caroline'], ['https://i.imgur.com/yjk25hp.png', 'Diana'], ['https://i.imgur.com/9571b0a.png', 'Emily'], ['https://i.imgur.com/oiFiWsE.png', 'Gabrielle'], ['https://i.imgur.com/uBZFySm.png', 'Hannah'], ['https://i.imgur.com/c6aK2zc.png', 'Jacqueline'], ['https://i.imgur.com/spsAHl1.png', 'Mary'], ['https://i.imgur.com/A3CwzJg.png', 'Tracy'] ] class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(min=1, max=99, label='Your age is: ') gender = models.StringField( choices=['Female', 'Male'], widget=widgets.RadioSelect, label='Your gender is: ' ) major = models.StringField(label='What is your major?') year = models.StringField( choices=['Freshman', 'Sophomore', 'Junior', 'Senior', 'Graduate', 'Other'], widget=widgets.RadioSelect, label='What year are you in?' ) game_theory = models.BooleanField( choices=[ [1, 'Yes'], [0, 'No'] ], widget=widgets.RadioSelect, label='Have you ever taken Game Theory course?' ) experiment = models.IntegerField(min=0, label='How many experiments have you participated before?') img = models.IntegerField() avatar_name = models.StringField() # FUNCTIONS # PAGES class Welcome(Page): pass class Demographic(Page): form_model = 'player' form_fields = ['age', 'gender', 'major', 'year', 'game_theory', 'experiment'] page_sequence = [Welcome, Demographic]