from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'condition1' PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 ACTIVE_ROLE = 'active player' PASSIVE_ROLE = 'passive player' class Subsession(BaseSubsession): @staticmethod def creating_session(subsession): subsession.group_randomly(fixed_id_in_group=True) print(subsession.get_group_matrix()) class Group(BaseGroup): @staticmethod def set_payoffs(groups): Active = group.get_player_by_role(C.ACTIVE_ROLE) Passive = group.get_player_by_role(C.PASSIVE_ROLE) class Player(BasePlayer): competition = models.StringField(initial='',label = 'Which scheme would you like to choose in case condition 1 applies?', choices = ["Competition Scheme", "Individual Scheme"]) # PAGES class Condition1(Page): form_model = 'player' form_fields = ["competition"] def is_displayed(player:Player): return player.role == C.ACTIVE_ROLE class Condition1p(Page): form_model = 'player' def is_displayed(player: Player): return player.role == C.PASSIVE_ROLE class Results(Page): form_model = 'player' def is_displayed(player:Player): return player.role == C.ACTIVE_ROLE page_sequence = [Condition1, Condition1p,Results]