from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class part1(Page): form_model = 'player' form_fields = ['trick', 'risk', 'loss_aversion', 'altruism'] class part2(Page): form_model = 'player' form_fields = ['gender', 'age', 'ethnicity', 'birthplace', 'econ_major'] class part3(Page): form_model = 'player' form_fields = ['email', 'email2'] def error_message(self, values): if values['email'] != values['email2']: return 'Your second email entry doesn\'t match the first.' class Results(Page): def vars_for_template(self): return { 'round_selected': self.player.participant.vars['round_selected'], 'game_payment': self.player.participant.vars['final_payment']-10, 'final_payment': self.player.participant.vars['final_payment'] } page_sequence = [part1, part2, part3, Results ]