from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class MyPage1(Page): form_model = 'player' form_fields = ['Q1'] class MyPage2(Page): form_model = 'player' form_fields = ['Q2'] class MyPage3(Page): form_model = 'player' form_fields = ['imput1_amount','imput2_amount','imput3_amount','imput4_amount'] class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): pass class Results(Page): def vars_for_template(self): player = self.player player.dis1 = ((player.imput1_amount / 4000) ** 2) - 1 player.dis2 = (player.imput2_amount / 4000) -1 player.dis3 = ((player.imput3_amount / 4000) ** 0.5) - 1 player.dis4 = ((player.imput4_amount / 4000) ** 0/25) - 1 return{ 'dis1': player.dis1, 'dis2': player.dis2, 'dis3': player.dis3, 'dis4': player.dis4 } page_sequence = [ MyPage1, MyPage2, MyPage3, Results ]