from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Prolific_Consent_form' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): read_information_sheet = models.BooleanField(initial=False, label='I have read the Participant Information Sheet ') Yes_No = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Please confirm if you agree with the above statements:') def custom_export(players): yield ['participant_code', 'id_in_group'] for p in players: pp = p.participant yield [pp.code, p.id_in_group] class LandingPage(Page): form_model = 'player' class ParticipantInformationSheet(Page): form_model = 'player' class Participant_Consent(Page): form_model = 'player' form_fields = ['Yes_No'] class EndofStudy(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return not player.Yes_No class Prolific_redirect(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return not player.Yes_No @staticmethod def js_vars(player: Player): session = player.session subsession = player.subsession return dict(completionlink= player.subsession.session.config['completionlink']) page_sequence = [LandingPage, ParticipantInformationSheet, Participant_Consent, EndofStudy, Prolific_redirect]