from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class MyPage(Page): # variables for template # ---------------------------------------------------------------------------------------------------------------- def vars_for_template(self): return { 'scl_payoff': self.participant.vars['scl_payoff'], 'lottery_choice': self.participant.vars['lottery_choice'], 'outcome_lo': self.participant.vars['outcome_lo'], 'outcome_hi': self.participant.vars['outcome_hi'], 'hi_lo': "B" if self.player.participant.vars['outcome_to_pay'] == "high" else "A", 'rows_right': self.participant.vars['rows_right'], 'rows_payoff': self.participant.vars['rows_payoff'], 'final_payoff_with_endowment': Constants.show_up + Constants.endowment + self.participant.vars['scl_payoff'] + self.participant.vars['rows_payoff'], 'part_no': self.participant.vars['part_no'] } class BeforeEnd( Page ): form_model = 'player' form_fields = ['water', 'known_others', 'known_from'] class Results(Page): def vars_for_template(self): return { 'final_payoff_with_endowment': Constants.show_up + Constants.endowment + self.participant.vars['scl_payoff'] + self.participant.vars['rows_payoff'], 'part_no': self.participant.vars['part_no'] } page_sequence = [ BeforeEnd, MyPage, Results ]