from otree.api import * doc = """ This app creates a survey containing the questions for the end of the experiment. """ class Constants(BaseConstants): name_in_url = 'finalSurvey' 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?' ) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Other', 'Other']], label='What is your gender?', widget=widgets.RadioSelect, ) everHeard = models.BooleanField( label='Have you ever heard about underground economy?', choices=[[True, "Yes"], [False, "No"]] ) perception = models.StringField( label='What do you think of underground economy?' ) clarity = models.IntegerField( label='Please rate the clarity of the experiment from 1 (i.e. not clear at all) to 10 (i.e. perfectly clear)', choices=list(range(1, 11)) ) # PAGES class survey(Page): form_model = "player" form_fields = ["age", "gender", "everHeard", "perception", "clarity"] class end(Page): def is_displayed(player: Player): return player.round_number == Constants.num_rounds def before_next_page(player: Player): participant = player.participant participant.finished = True page_sequence = [survey, end]