from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Welcomepage(Page): pass class Instructions1(Page): form_model = 'player' form_fields = ['testq1'] class Instructions2(Page): form_model = 'player' form_fields = ['testq2','testq3'] class Instructions3(Page): form_model = 'player' form_fields = ['testq4','testq5'] class Instructionspost(Page): pass class Playerdetails(Page): form_model = 'player' form_fields= ['name','age','gender','background','backgroundother'] class ResultsWaitPage(WaitPage): body_text ="Please wait till the other players enter their details. After this you would be informed about your group allocation and then proceed to the Instructions Page" after_all_players_arrive = 'colour_allocation' class Colourdisplay(Page): pass class WarningMATH0(Page): form_mode = 'player' class MATH0(Page): timeout_seconds = 80 form_model = 'player' form_fields = ['M0','M1','M2','M12','M13','M14','M15','M16','M17','M18','M19','M20','M21','M22','M23','M24','M25','M26','M27','M28'] class MATH0Wait(WaitPage): body_text ="You have finished Practice Math Round. Please wait till the other players finish Practice Math Round. After this, you would proceed to MATH-1." after_all_players_arrive = 'math0_payoff' class WarningMATH1(Page): form_mode = 'player' class MATH1(Page): timeout_seconds = 80 form_model = 'player' form_fields = ['M3','M4','M5','M29','M30','M31','M32','M33','M34','M35','M36','M37','M38','M39','M40','M41','M42','M43','M44','M45'] class MATH1Wait(WaitPage): body_text ="You have finised MATH-1. Please wait till the other players finish MATH-1. After this, you will know about your performance in MATH-1, and whether or not you would proceed to MATH-2. If you do not proceed to MATH-2, you will proceed to Prediction Task." after_all_players_arrive = 'math1_payoff' class MATH1Results(Page): pass class WarningMATH2(Page): form_mode = 'player' def is_displayed(self): return self.player.winner == 1 or self.player.otherwinner == 1 class MATH2(Page): timeout_seconds = 80 form_model = 'player' form_fields = ['M6','M7','M8','M46','M47','M48','M49','M50','M51','M52','M53','M54','M55','M56','M57','M58','M59','M60','M61','M62'] def is_displayed(self): return self.player.winner == 1 or self.player.otherwinner == 1 class MATH2Wait(WaitPage): body_text ="You have finsihed MATH-2. Please wait till the other player finishes MATH-2, post which you will know about the final results. The final results will display your earnings in each stage and your total earnings from the experiment." after_all_players_arrive = 'math2_payoff' def is_displayed(self): return self.player.winner == 1 or self.player.otherwinner == 1 class MATH2Results(Page): timeout_seconds = 30 def is_displayed(self): return self.player.winner == 1 or self.player.otherwinner == 1 pass class WarningGG(Page): form_mode = 'player' def is_displayed(self): return self.player.winner == 0 and self.player.otherwinner == 0 class GG(Page): form_model = 'player' form_fields = ['M9','M10','M11'] def is_displayed(self): return self.player.winner == 0 and self.player.otherwinner == 0 class GGWait(WaitPage): body_text ="Please wait till the other players in the Prediction Task Round as well as the players in the MATH-2 round finish. Once the scores of MATH-2 players are calculated, your predictions will be evaluated. The next page will display your earnings in each stage and your total earnings from the experiment. " after_all_players_arrive = 'gg_payoff' def is_displayed(self): return self.player.winner == 0 and self.player.otherwinner == 0 class GGResults(Page): def is_displayed(self): return self.player.winner == 0 and self.player.otherwinner == 0 pass class Payoffs(Page): pass page_sequence = [Welcomepage,Playerdetails,ResultsWaitPage,Colourdisplay,Instructions1,Instructions2,Instructions3,Instructionspost,WarningMATH0, MATH0, MATH0Wait,WarningMATH1, MATH1, MATH1Wait, MATH1Results,WarningMATH2, MATH2, MATH2Wait, MATH2Results,WarningGG,GG,GGWait,GGResults]