from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): form_model = 'player' class PersonalDetails(Page): form_model = 'player' form_fields = ['age', 'gender', 'workerID'] class Round1(Page): form_model = 'player' form_fields = ['contribution1'] class Round2(Page): form_model = 'player' form_fields = ['contribution2'] class Round3(Page): form_model = 'player' form_fields = ['contribution3'] class TreatmentPage(Page): form_model = 'player' def vars_for_template(self): return dict( payoff1 = Constants.endowment - self.player.contribution1, payoff2 = Constants.endowment - self.player.contribution2, payoff3 = Constants.endowment - self.player.contribution3, ) class FinalPage(Page): form_model = 'player' page_sequence = [Introduction, PersonalDetails, Round1, Round2, Round3, TreatmentPage, FinalPage]