from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class IC_Page(Page): # timeout_seconds = 60 * 10 timeout_submission = {'consent': False} form_model = 'player' form_fields = ['consent'] def before_next_page(self): self.participant.vars['consent'] = self.player.consent class End_Page(Page): # timeout_seconds = 60 * 3 def is_displayed(self): return not self.player.consent def app_after_this_page(self, upcoming_apps): return upcoming_apps[-1] class General_Instructions(Page): # timeout_seconds = 60 * 10 def is_displayed(self): return self.player.consent def vars_for_template(self): return {'showup_points': round(self.session.config['participation_fee'] / self.session.config['real_world_currency_per_point']), 'showup_fee': self.session.config['participation_fee'], 'money_per_1k_points': round(1000 * self.session.config['real_world_currency_per_point'], 3) } page_sequence = [ IC_Page, End_Page, General_Instructions ]