from otree.api import * import time doc = """ Identification """ class C(BaseConstants): NAME_IN_URL = 'id' PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): prolificid = models.StringField( label="Please enter your Prolific ID") is_dropout = models.BooleanField(initial=False) # PAG class drop(Page): @staticmethod def is_displayed(player: Player): return player.is_dropout class Introduction(Page): timeout_seconds = 60 @staticmethod def before_next_page(player: Player, timeout_happened): if timeout_happened: player.is_dropout = True class html(Page): form_model = 'player' form_fields = ['prolificid'] page_sequence = [html, drop]