from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Intro(Page): def is_displayed(self): return self.round_number==1 def before_next_page(self): # participants have 4 minutes to complete as many pages as possible import time self.participant.vars['expiry'] = time.time() + 4*60 class Image1(Page): form_model = 'player' form_fields = ['descriptionimage1'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image2(Page): form_model = 'player' form_fields = ['descriptionimage2'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image3(Page): form_model = 'player' form_fields = ['descriptionimage3'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image4(Page): form_model = 'player' form_fields = ['descriptionimage4'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image5(Page): form_model = 'player' form_fields = ['descriptionimage5'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image6(Page): form_model = 'player' form_fields = ['descriptionimage6'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image7(Page): form_model = 'player' form_fields = ['descriptionimage7'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image8(Page): form_model = 'player' form_fields = ['descriptionimage8'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image9(Page): form_model = 'player' form_fields = ['descriptionimage9'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Image10(Page): form_model = 'player' form_fields = ['descriptionimage10'] timer_text = 'Time left to complete this work period:' def get_timeout_seconds(self): import time return self.participant.vars['expiry'] - time.time() def is_displayed(self): return self.get_timeout_seconds() > 3 class Results(Page): pass page_sequence = [ Intro, #Image1, #Image2, #Image3, #Image4, #Image5, #Image6, #Image7, #Image8, #Image9, #Image10, #Results ]