from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class MyWaitPage(WaitPage): title_text = 'Bitte warten Sie auf die anderen Personen' class Decision(Page): form_model = 'player' form_fields = ['labor_supply'] timeout_seconds = 90 timer_text = 'Verfügbare Zeit um Ihre Entscheidung zu treffen' def before_next_page(self): #import time if self.timeout_happened: #self.participant.vars['expiry_stage3'] = True self.participant.vars['labor_supply'] = 0 self.participant.vars['no_decision'] = True else: self.participant.vars['labor_supply'] = self.player.labor_supply # Each player gets its minutes (expiry time is saved) #self.participant.vars['expiry_stage3'] = time.time() + self.participant.vars['labor_supply'] * 60 class MyWaitPage2(WaitPage): title_text = 'Bitte warten Sie auf die anderen Personen' page_sequence = [MyWaitPage, Decision, MyWaitPage2]