from otree.api import * import os # ------------------- # Constants # ------------------- class C(BaseConstants): NAME_IN_URL = 'instructions' PLAYERS_PER_GROUP = None NUM_ROUNDS = 22 # ------------------- # Group / Player / Subsession # ------------------- class Group(BaseGroup): pass class Player(BasePlayer): pass class Subsession(BaseSubsession): pass # ------------------- # Pages # ------------------- class Start(Page): @staticmethod def is_displayed(player): return player.round_number == 1 class Consent(Page): @staticmethod def is_displayed(player): return player.round_number == 1 class Instructions(Page): allow_back_button = True @staticmethod def vars_for_template(player: Player): round_number = player.round_number image_path = f"instructions/FVY2 Instructions-20_Page_{round_number}.png" return dict( round_number=round_number, image_path=image_path, max_rounds=C.NUM_ROUNDS, ) # Page sequence # ------------------- page_sequence = [Start, Consent, Instructions]