from otree.api import * doc = """ This app asks for demographic information. """ class C(BaseConstants): NAME_IN_URL = 'demographics' 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 (in years)?", min=0, max=140, blank=True) gender = models.StringField( choices=[ ['male', 'Male'], ['female', 'Female'], ['non_binary', 'Non-binary'], ['not_disclosed', 'Prefer not to disclose'] ], label="What is your gender identification?", widget=widgets.RadioSelect, blank=True ) english = models.IntegerField( choices=[ [1, "Very bad"], [2, "Bad"], [3, "Poor"], [4, "Neither good nor bad"], [5, "Fair"], [6, "Good"], [7, "Very good"] ], label="How would you generally rate your understanding of the English used in this study?", widget=widgets.RadioSelect ) attentive = models.IntegerField( choices=[ [1, "1 - Not at all"], [2, "2"], [3, "3"], [4, "4"], [5, "5 - Very much"] ], label="How attentive were you during the study? (Your response will not affect your compensation)", widget=widgets.RadioSelect ) purpose = models.LongStringField( label="What do you think is the purpose of this study? (briefly, in one sentence)", blank=True ) place = models.StringField( label="In which country are you living at the moment?", blank=True ) any_error = models.LongStringField( label="Did you spot any errors during the study? Anything that we should pay attention to in the next runs?", blank=True ) # PAGES class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'english', 'attentive', 'purpose', 'place', 'any_error'] page_sequence = [Demographics]