from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): form_model = "player" form_fields = ["contribution"] timeout_seconds = 60 def is_displayed(self): return True def vars_for_template(self): return dict() class Contribute(Page): form_model = "player" form_fields = ["contribution"] class ResultsWaitPage(WaitPage): body_text = "Waiting for other participants to contribute." def after_all_players_arrive(self): self.group.set_payoffs() class Results(Page): def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) page_sequence = [Introduction, Contribute, ResultsWaitPage, Results]