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 { 'GG': Constants.payoff_meyou_GG, 'LL': Constants.payoff_meyou_LL, 'LG': Constants.payoff_meyou_LG, 'GL': Constants.payoff_meyou_GL, } class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): self.subsession.set_payoffs() # class Results(Page): # def vars_for_template(self): # self.participant.vars['exp01_my_choice'] = self.player.choice # self.participant.vars['exp01_others_choice'] = self.group.get_player_by_id(self.player.id_in_group % 2 + 1).choice # self.participant.vars['exp01_my_payoff'] = self.player.payoff # # return { # 'my_choice': self.player.choice, # 'others_choice': self.group.get_player_by_id(self.player.id_in_group % 2 + 1).choice, # 'my_payoff': self.player.payoff, # } class EmptyPage(Page): pass class EmptyPage(Page): pass page_sequence = [ Choice, ResultsWaitPage, EmptyPage, #Results ]