from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Survey(Page): form_model = 'player' form_fields = ['gender', 'age', 'study', 'dice_generator'] def before_next_page(self): self.player.final = self.player.participant.vars['payment'] class Results(Page): def vars_for_template(self): if self.player.participant.vars['treatment'] == "control": coin = False else: coin = True return dict( coin=coin, round=self.player.participant.vars['paying_round'], perform=self.player.participant.vars['performance'], pay=self.player.participant.vars['payment'], euros=self.player.participant.vars['payment'].to_real_world_currency(self.session), dice=self.player.participant.vars['dice'], winning=self.player.participant.vars['winning'], ) page_sequence = [Survey, Results]