from ._builtin import Page, WaitPage from .models import Constants class IDinput(Page): form_model = 'player' form_fields = ['ID_number'] timeout_seconds = 600 class WaitforStart(WaitPage): wait_for_all_groups = True class StartStage3(Page): timeout_seconds = 60 class Introduction(Page): timeout_seconds = 300 class Offer(Page): form_model = 'player' form_fields = ['offer'] def is_displayed(self): return self.player.id_in_group == 1 or self.player.id_in_group == 3 class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): self.group.set_payoffs() class AllWait(WaitPage): wait_for_all_groups = True class Results(Page): pass page_sequence = [WaitforStart, StartStage3, Offer, ResultsWaitPage, AllWait, Results]