from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'consent_form_HBL' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent_answer = models.BooleanField( label = "If you agree to participate, please consent to this form to start!", choices = [ [True, "I understand and I DO want to participate in this study."], [False, "I understand and I DO NOT want to participate in this study."] ] ) # PAGES class Consent(Page): @staticmethod def is_displayed(player: Player): return player.round_number == 1 form_model = 'player' form_fields = ['consent_answer'] # @staticmethod # def js_vars(player: Player): # return dict( # demo = player.session.is_demo, # ) # def error_message(player: Player, values): # solutions = dict(consent_answer = True) # return {f: 'Wrong' for f in solutions if values[f] != solutions[f]} class Disagree(Page): # Display this page only if paricipant disagrees with the terms. @staticmethod def is_displayed(player): if player.round_number == 1: if player.consent_answer == False: return True else: return False class overallExplaination(Page): pass page_sequence = [Consent, Disagree, overallExplaination]