from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Page1(Page): pass class Page2(Page): def is_displayed(self): return self.player.experiment == 'PS' form_model = 'player' form_fields = ['age', 'gender', 'ethnicity', 'degree', 'employment_status', 'income', 'community', 'religion', 'politics'] class Page3(Page): def is_displayed(self): return self.player.experiment == 'BE' form_model = 'player' form_fields = ['alternative_identification', 'reason_rule_following'] class Page4(Page): form_model = 'player' form_fields = ['device', 'browser', 'understanding_problems', 'technical_problems', 'comments'] class Page5(Page): def vars_for_template(self): if self.player.experiment == 'BE': return { 'ITG_correct': self.player.participant.vars['ITG_correct'], 'ITG_profit': self.player.participant.vars['ITG_profit'], 'RFT_balls_in_blue': self.player.participant.vars['RFT_balls_in_blue'], 'RFT_balls_in_yellow': self.player.participant.vars['RFT_balls_in_yellow'], 'RFT_profit': self.player.participant.vars['RFT_profit'], } if self.player.experiment == 'NEE': return { 'ITG_correct': self.player.participant.vars['ITG_correct'], 'ITG_profit': self.player.participant.vars['ITG_profit'], } class Page6(Page): pass page_sequence = [Page1, Page2, Page3, Page4, Page5, Page6]