from otree.api import * import time doc = """ Introduction """ class C(BaseConstants): NAME_IN_URL = 'survey2' PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): language = models.StringField( inital="Yes", label="Are you fluent in English?", choices= ["Yes", "No"], widget=widgets.RadioSelect ) halloween = models.StringField( inital="Eating turkey", label="Which of these is NOT associated with Halloween?", choices=["Pumpkin", "Trick & Treat", "Costumes", "Ghosts", "Eating turkey"], widget=widgets.RadioSelect ) zipcode = models.StringField( inital="02318", label="Which of these is an American zip code?", choices=["112", "14 Monroe Avenue", "19", "02318", "7TX4LZ"], widget=widgets.RadioSelect ) class drop(Page): @staticmethod def is_displayed(player): return player.language == "No" class drop2(Page): @staticmethod def is_displayed(player): return player.halloween != "Eating turkey" class drop3(Page): @staticmethod def is_displayed(player): return player.zipcode != "02318" class Demographics(Page): form_model = 'player' form_fields = ['language', 'halloween', 'zipcode'] class Introduction2(Page): timeout_seconds = 75 page_sequence = [Demographics, drop, drop2, drop3, Introduction2]