from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants import time class instructions(Page): form_model = 'player' class instructions2(Page): form_model = 'player' points_per_question = 1 points_per_question_div = points_per_question / 4 class std_instructions(Page): def vars_for_template(self): return { 'points_per_question': points_per_question } def is_displayed(self): if self.participant.vars['payout_trmt'] == 'std': return True else: return False class rand_instructions(Page): def vars_for_template(self): return { 'points_per_question': points_per_question } def is_displayed(self): if self.participant.vars['payout_trmt'] == 'rand': return True else: return False class split_instructions(Page): def vars_for_template(self): return { 'points_per_question': points_per_question, 'points_per_question_div_4': points_per_question / 4 } def is_displayed(self): if self.participant.vars['payout_trmt'] == 'split': return True else: return False class TC_instructions(Page): def is_displayed(self): if self.participant.vars['tc_trmt'] == True: return True else: return False def vars_for_template(self): return { 'points_per_question': points_per_question } class noTC_instructions(Page): def is_displayed(self): if self.participant.vars['tc_trmt'] == False: return True else: return False def vars_for_template(self): return { 'points_per_question': points_per_question } class instructions_end(Page): def before_next_page(self): if self.participant.vars['tc_trmt'] == True: #30 mins treatment self.participant.vars['expiry'] = time.time() + 12#30*60 #times 60 seconds elif self.participant.vars['tc_trmt'] == False: #60 mins treatment self.participant.vars['expiry'] = time.time() + 12#60*60 #times 60 seconds page_sequence = [ instructions, std_instructions, rand_instructions, split_instructions, TC_instructions, noTC_instructions, instructions_end ]