from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Choice(Page): form_model = 'player' form_fields = ['choice'] def vars_for_template(self): return { 'payoff_I_call': Constants.payoff_others_call, 'payoff_others_call': Constants.payoff_I_call, 'payoff_no_call': Constants.payoff_no_call, #'players_in_my_group': len(self.group.get_players()), } class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): self.subsession.set_payoffs() # class Results(Page): # def vars_for_template(self): # self.participant.vars['exp09_my_choice'] = self.player.choice # self.participant.vars['exp09_others_choice'] = [p.choice for p in self.get_others_in_group()] # self.participant.vars['exp09_my_payoff'] = self.player.payoff # # return { # 'my_choice': self.player.choice, # 'others_choice': [p.choice for p in self.get_others_in_group()], # 'my_payoff': self.player.payoff, # } class EmptyPage(Page): pass page_sequence = [ Choice, ResultsWaitPage, EmptyPage, #Results ]