from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'live_page_accept_offer' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 endowment = 100 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): money_after_trade = models.FloatField() accepted_other_participants_offer = models.BooleanField() # PAGES class MyPage(Page): form_model = "player" form_fields = ["money_after_trade", "accepted_other_participants_offer"] @staticmethod def live_method(player: Player, data): if data["information_type"] == "offer": if player.id_in_group == 1: return {2: {"information_type": "offer", "offer": data["offer"]}} else: return {1: {"information_type": "offer", "offer": data["offer"]}} else: if data["information_type"] == "response": if player.id_in_group == 1: class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [MyPage, ResultsWaitPage, Results]