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 = ['first_choice', 'second_choice'] def before_next_page(self): self.player.set_payoff() class Results(Page): def vars_for_template(self): if self.player.final_choice == 1: choice = self.player.first_choice else: choice = self.player.second_choice return dict( choice=choice, ) page_sequence = [Choice, Results]