from otree.api import * doc = """ Intro: consent """ class C(BaseConstants): NAME_IN_URL = 'intro' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): participate = models.BooleanField( choices=[ [True, 'Igen'], [False, 'Nem'], ], label="Kérünk, hogy erősítsd meg, hogy részt szeretnél venni a kutatásban. Kattints az igen válaszlehetőségre, amennyiben beleegyezel a részvételbe.") # PAGES class Intro(Page): timeout_seconds = 120 form_model = "player" form_fields = ["participate"] @staticmethod def is_displayed(player: Player): return player.round_number == 1 @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant if timeout_happened: participant.participate = False else: participant.participate = player.participate participant.participate = player.participate ##ha exitbe akarjuk küldeni @staticmethod def app_after_this_page(player, upcoming_apps): participant = player.participant if participant.participate == False: # return 'goodbye' return upcoming_apps[2] elif participant.participate: return upcoming_apps[0] page_sequence = [Intro]