from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'ConsentForm' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Group(BaseGroup): pass class Player(BasePlayer): consent = models.BooleanField(choices=[[True, 'I have read the consent form above and AGREE to participate in the experiment.'], [False, 'I have read the consent form above and DISAGREE to participate in the experiment.']], initial=False, label='By checking the box “I have read the consent form above and AGREE to participate in the experiment” below, you indicate your consent to participate in the study. ', widget=widgets.RadioSelect) class keyinfo(Page): form_model = 'player' class consentform(Page): form_model = 'player' form_fields = ['consent'] @staticmethod # populates a participant # variable with the respondent's consent status (for use across apps) def before_next_page(player: Player, timeout_happened): participant = player.participant participant.consent = player.consent @staticmethod # sends nonconsenting participants to the last app def app_after_this_page(player, upcoming_apps): if not player.consent: return upcoming_apps[-1] class Subsession(BaseSubsession): pass page_sequence = [keyinfo,consentform]