from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'debrief' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): debrief_duration = models.FloatField() # PAGES class Debrief(Page): @staticmethod def vars_for_template(player: Player): # Wir holen die Strikes aus den participant.vars strikes = player.participant.vars.get('timeout_strikes', 0) is_ghost = strikes >= 3 return { 'is_ghost': is_ghost, 'strikes': strikes } @staticmethod def before_next_page(player: Player, timeout_happened): import time # participant._last_page_timestamp ist ein interner oTree-Wert start_time = player.participant._last_page_timestamp if start_time: player.debrief_duration = time.time() - start_time page_sequence = [Debrief]