from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Contribution1(Page): form_model = 'player' form_fields = ['contribution'] def is_displayed(self): return self.round_number == 1 def vars_for_template(self): return dict() class Contribution2(Page): form_model = 'player' form_fields = ['mycontribution', 'contribution'] def is_displayed(self): return self.round_number > 1 def vars_for_template(self): return dict( last_round_payoff = self.player.in_round(self.round_number - 1).payoff ) class ResultsWaitPage(WaitPage): body_text = 'Bitte warten Sie, bis alle Teamleiter investiert haben.' def after_all_players_arrive(self): self.group.set_payoffs() class Results(Page): form_model = 'player' def vars_for_template(self): a = self.player.payoff return dict(a=a) page_sequence = [Contribution1, Contribution2, ResultsWaitPage, Results]