from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'consent_form' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent_accepted = models.BooleanField() participant_label = models.StringField(initial="0") device = models.StringField(initial="-") # PAGES class ConsentPage(Page): form_model = 'player' form_fields = ['consent_accepted', 'device'] def is_displayed(player): if player.participant.label: player.participant_label = player.participant.label else: player.participant_label = "-2" return True pass class NoConsentPage(Page): def is_displayed(player): return player.consent_accepted == False page_sequence = [ConsentPage, NoConsentPage]