from ._builtin import Page, WaitPage class WaitforStart(WaitPage): wait_for_all_groups = True class StartChat(Page): timeout_seconds = 30 class WaitforChatid(WaitPage): def after_all_players_arrive(self): self.group.set_chat_id() class WaitforChat(WaitPage): wait_for_all_groups = True class ChatPractice(Page): timeout_seconds = 125 class Alphabet(Page): form_model = 'player' form_fields = ['alphabet'] def is_displayed(self): return self.player.id_in_group % 4 == 1 or self.player.id_in_group % 4 == 2 class Alphabetwait(Page): timeout_seconds = 30 def is_displayed(self): return self.player.id_in_group % 4 == 3 or self.player.id_in_group % 4 == 0 class ResultsChat(Page): pass class StartpBCG(Page): timeout_seconds = 30 class Chat(Page): timeout_seconds = 185 class Guess(Page): form_model = 'player' form_fields = ['guess', 'reason'] def is_displayed(self): return self.player.id_in_group % 4 == 1 or self.player.id_in_group % 4 == 2 class Guesswait(Page): timeout_seconds = 30 def is_displayed(self): return self.player.id_in_group % 4 == 3 or self.player.id_in_group % 4 == 0 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, StartChat, WaitforChatid, WaitforChat, ChatPractice, Alphabet, Alphabetwait, WaitforChat, ResultsChat, WaitforChat, Chat, Guess, Guesswait, ResultsWaitPage, AllWait, Results]