from otree.api import * c = cu doc = 'Provide a general instruction' class C(BaseConstants): NAME_IN_URL = 'instruction_general' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 TREATMENTS = ('mmpl', 'pmpl') class Subsession(BaseSubsession): pass def creating_session(subsession: Subsession): session = subsession.session if subsession.round_number == 1: from random import choice players = subsession.get_players() for p in players: participant = p.participant participant.mpl_treatment = choice(C.TREATMENTS) class Group(BaseGroup): pass class Player(BasePlayer): pass class GeneralInstruction(Page): form_model = 'player' page_sequence = [GeneralInstruction]