from otree.api import * c = Currency doc = """ Your app description """ class Constants(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: return {2: {"information_type": "response", "response": data["offer_response"]}} else: return {1: {"information_type": "response", "response": data["offer_response"]}} class Results(Page): pass page_sequence = [MyPage, Results]