from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'instructions' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): round_0 = models.IntegerField() class Intro_round_0(Page): pass # PAGES class MyPage(Page): pass class Round_0(Page): form_model = 'player' form_fields = ['round_0'] class Results(Page): @staticmethod def vars_for_template(player: Player): contribution = player.round_0 saldo = 10 -contribution envio = contribution * 3 retribution = round(envio/2) total = (10 - contribution) + retribution return dict(back=retribution, total=total, saldo=saldo, envio=envio) class Loading(Page): pass page_sequence = [MyPage, Intro_round_0, Round_0, Results,Loading]