from otree.api import * import time doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'consent_ucy' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent = models.BooleanField( choices=[ [True, 'Yes, I have read and understood the information sheet and agree to take part in this research project'], [False, 'No, I decided not to take part in this research project'], ] ) prolific_id = models.StringField(initial="empty") # PAGES class Consent(Page): form_model = 'player' form_fields = ['consent'] @staticmethod def before_next_page(player, timeout_happened): participant = player.participant participant.consent = player.consent participant.wait_page_arrival = time.time() # set default values for participant vars participant.wait_too_long = False participant.is_dropout = False player.prolific_id = player.participant.label @staticmethod def app_after_this_page(player, upcoming_apps): if not player.consent: return upcoming_apps[-1] page_sequence = [Consent, ]