from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants import random # ---------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------- class P0Welcome(Page): form_model = 'player' form_fields = ['geraet', 'os_name', 'os_version', 'browser_name', 'browser_version'] def before_next_page(self): self.participant.vars['treatment'] = self.player.treatment self.participant.vars['subtreatment'] = self.player.subtreatment # ---------------------------------------------------------------------------------------------------------------------- class P0CloseSession(Page): def is_displayed(self): return self.player.browser_name == 'Internet Explorer' or \ self.player.geraet == 2 or self.player.geraet == 3 # ---------------------------------------------------------------------------------------------------------------------- class P1InstructionsPage1(Page): pass # ---------------------------------------------------------------------------------------------------------------------- class P1InstructionsPage2(Page): def vars_for_template(self): return { 'treatment': self.participant.vars['treatment'] } # ---------------------------------------------------------------------------------------------------------------------- class P1InstructionsPage2_new(Page): def vars_for_template(self): return { 'treatment': self.participant.vars['treatment'] } # ---------------------------------------------------------------------------------------------------------------------- class P1InstructionsPage3(Page): def vars_for_template(self): return { 'subtreatment': self.participant.vars['subtreatment'] } # ---------------------------------------------------------------------------------------------------------------------- class P2PrePart1(Page): def vars_for_template(self): return { 'treatment': self.participant.vars['treatment'] } # ---------------------------------------------------------------------------------------------------------------------- class P5DebiasingElicitationFrame(Page): form_model = 'player' form_fields = ['mean_reduced', 'mean_not_reduced'] def is_displayed(self): return self.participant.vars['treatment'] == 'debiasing' # ---------------------------------------------------------------------------------------------------------------------- class P6DebiasingDistribution(Page): def is_displayed(self): return self.participant.vars['treatment'] == 'debiasing' # ---------------------------------------------------------------------------------------------------------------------- class P6AlternativeTask(Page): def is_displayed(self): return self.participant.vars['treatment'] == 'base' # ---------------------------------------------------------------------------------------------------------------------- class P7PrePart2(Page): def vars_for_template(self): return { 'subtreatment': self.participant.vars['subtreatment'] } # ---------------------------------------------------------------------------------------------------------------------- page_sequence = [ P0Welcome, P0CloseSession, P1InstructionsPage1, # P1InstructionsPage2, P1InstructionsPage2_new, P2PrePart1, P5DebiasingElicitationFrame, P6DebiasingDistribution, P6AlternativeTask, P1InstructionsPage3, P7PrePart2 ]