from otree.api import * class C(BaseConstants): NAME_IN_URL = 'payment' PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): BonusPayout = models.IntegerField() ChosenRound_1 = models.IntegerField() ChosenRound_2 = models.IntegerField() ChosenRound_3 = models.IntegerField() pass # FUNCTIONS # PAGES class Payoff(Page): @staticmethod def vars_for_template(player): player.BonusPayout = player.participant.BonusPayout player.ChosenRound_1 = player.participant.ChosenRound_1 player.ChosenRound_2 = player.participant.ChosenRound_2 player.ChosenRound_3 = player.participant.ChosenRound_3 return dict( payout_in_currency=cu(player.participant.calulated_final_payoff).to_real_world_currency(player.session) ) pass page_sequence = [ Payoff]