from otree.api import * import time doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'consent' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): timeout = models.FloatField() ProlificID = models.StringField() enroll = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, 'Yes'], [0, 'No']]) # PAGES class Consent(Page): form_model = 'player' form_fields = ['ProlificID', 'enroll'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant # in settings.py need to add 'enroll' to PARTICIPANT_FIELDS. participant.enroll = player.enroll participant.wait_page_arrival = time.time() class Consent_Completion(Page): @staticmethod def is_displayed(player): participant = player.participant return participant.enroll == 0 page_sequence = [Consent, Consent_Completion]