from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Info(Page): form_model = 'player' form_fields = ['Fname','Lname','sID', 'cell','address','SSN'] class GameWaitpPage(WaitPage): pass class MyPage(Page): live_method = 'live_method' def js_vars(self): return dict( id=self.player.id_in_group, payoff = self.player.payoff, ) form_model = 'player' form_fields = ['finalpayoff'] # def before_next_page(self): #self.group.test = self.group.testfunction() # this will call test function when page is submitted class ResultsWaitPage(WaitPage): after_all_players_arrive = 'set_finalpayoffs' # after_all_players_arrive = 'function' only works in wait page # after_all_players_arrive = 'function' can only call functions from "group" class Result(Page): form_model = 'player' #form_fields = ['finalpayoff'] # do not need form_fields if not input page_sequence = [Info,GameWaitpPage,MyPage,ResultsWaitPage,Result]