from otree.api import * doc = """ Want to know which Weekday is preferred for drinking. """ class C(BaseConstants): NAME_IN_URL = 'Wednesday_Or_Thursday' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='How old are you?', min=6, max=125) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Non-Binary', 'Non-Binary']], label='What is your gender? ', widget=widgets.RadioSelectHorizontal, ) is_student = models.BooleanField( label="Are you a student?" ) city = models.StringField(label='Where are you from?') day = models.StringField( choices=[['Wednesday', 'Wednesday'], ['Thursday', 'Thursday']], label='If you have to drink during the week. Which day would you choose?', widget=widgets.RadioSelectHorizontal, ) # PAGES class Introduction(Page): pass class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'is_student', 'city'] class Question(Page): form_model = 'player' form_fields = ['day'] class Results(Page): pass page_sequence = [Introduction, Demographics, Question, Results]