from otree.api import * class C(BaseConstants): NAME_IN_URL = 'dictator' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 ENDOWMENT = 90 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): amount_given = models.IntegerField( min=0, max=100, label='', ) #PAGES class Instructions(Page): pass class Decision(Page): form_model = 'player' form_fields = ['amount_given'] @staticmethod def before_next_page(player, timeout_happened): player.participant.vars['dictator_payoff'] = 90 - player.amount_given page_sequence = [Instructions, Decision]