from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class Introduction(Page): """Description of the game: How to play and returns expected""" def before_next_page(self): self.group.calcStateVariables() class Initial(Page): pass class OrderDecision(Page): """Player: Choose how much to order""" form_model = 'player' form_fields = ['placed_order'] class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): #self.group.calcStateVariables() pass body_text = "Waiting for other participants to contribute." class Results(Page): """Players payoff: How much each has earned""" def vars_for_template(self): return { 'total_earnings': self.group.total_contribution * Constants.multiplier, } page_sequence = [ Introduction, OrderDecision, ResultsWaitPage, ##Results ]