from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class CalculatePayment(Page): timeout_seconds = 30 def before_next_page(self): self.player.random_app_payoff() print("Randomly chosen game for payment: Part", self.player.paying_game) print("Participation fee:", self.session.config['participation_fee']) print("Experiment payoff:", self.participant.payoff) class PaymentInfo(Page): timeout_seconds = 30 def vars_for_template(self): print(self.participant.vars) return { 'experiment_payoff': self.participant.payoff, 'random_game': self.player.paying_game, 'total_payoff' : self.player.payoff_with_pf } class PaymentDecision(Page): form_model = 'player' form_fields = ['payment_choice'] class End(Page): pass page_sequence = [CalculatePayment, PaymentInfo, PaymentDecision, End]