from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from . import models from .models import Constants class Introduction(Page): timeout_seconds = 600 class Beliefs(Page): form_model = models.Group form_fields = ['responsep_{}'.format(int(i)) for i in Constants.offer_choices] def is_displayed(self): return self.player.id_in_group == 1 class Offer(Page): form_model = models.Group form_fields = ['amount_offered'] def is_displayed(self): return self.player.id_in_group == 1 timeout_seconds = 600 class WaitForProposer(WaitPage): pass class AcceptStrategy(Page): form_model = models.Group form_fields = ['response_{}'.format(int(i)) for i in Constants.offer_choices] def is_displayed(self): return self.player.id_in_group == 2 class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): self.group.set_payoffs() class Results(Page): pass page_sequence = [Introduction, Offer, Beliefs, WaitForProposer, AcceptStrategy, ResultsWaitPage, Results]