from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): form_model = 'player' form_fields = ['name', 'age', 'gender', 'degree', 'work_Experience'] class Introduction2(Page): form_model = 'player' form_fields = ['number_of_months', 'Designation'] def is_displayed(self): return self.player.work_Experience == "yes" class Introtoe1(Page): def is_displayed(self): return self.player.id_in_group == 1 class Introtoe3(Page): def is_displayed(self): return self.player.id_in_group == 3 class Introtoe2(Page): def is_displayed(self): return self.player.id_in_group == 2 class z1_choice(Page): form_model = 'group' form_fields = ['z1_choice'] def is_displayed(self): return self.player.id_in_group == 1 class q1_choice(Page): form_model = 'group' form_fields = ['q1_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q2_choice(Page): form_model = 'group' form_fields = ['q2_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q3_choice(Page): form_model = 'group' form_fields = ['q3_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q4_choice(Page): form_model = 'group' form_fields = ['q4_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q5_choice(Page): form_model = 'group' form_fields = ['q5_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q6_choice(Page): form_model = 'group' form_fields = ['q6_choice'] def is_displayed(self): return self.player.id_in_group == 2 class q7_choice(Page): form_model = 'group' form_fields = ['q7_choice'] def is_displayed(self): return self.player.id_in_group == 2 class A(Page): form_model = 'group' form_fields = ['a_choice'] def is_displayed(self): return self.player.id_in_group == 1 class A1(Page): form_model = 'group' form_fields = ['a1_choice'] def is_displayed(self): return self.player.id_in_group == 2 class A2(Page): form_model = 'group' form_fields = ['a2_choice'] def is_displayed(self): if self.player.id_in_group == 1 and self.group.a1_choice == "report": return self.group.a_choice == "commit" class A3(Page): form_model = 'group' form_fields = ['a4_choice'] def is_displayed(self): if self.group.a3_choice == "ask": return self.player.id_in_group == 3 class A4(Page): def is_displayed(self): if self.group.a3_choice == "don't ask": return self.player.id_in_group == 3 class A3result(Page): def is_displayed(self): if self.group.a_choice == "commit" and self.group.a3_choice == "ask": return self.player.id_in_group == 2 class Aske3(Page): form_model = 'group' form_fields = ['a3_choice'] def is_displayed(self): if self.group.a_choice == "commit": return self.player.id_in_group == 2 class Rinves(Page): def is_displayed(self): if self.group.a1_choice == "report" and self.player.id_in_group == 1: return self.group.a_choice == "commit" class NRinves(Page): def is_displayed(self): if self.group.a1_choice == "not report" and self.player.id_in_group == 1: return self.group.a_choice == "commit" class Invesdone(Page): def is_displayed(self): if self.player.id_in_group == 1 and self.group.a1_choice == "report": return self.group.a_choice == "commit" class InvestdoneNR(Page): def is_displayed(self): if self.group.a1_choice == "not report" and self.player.id_in_group == 1: return self.group.a_choice == "commit" class WaitForP1(WaitPage): title_text = "waiting for Employee 1" body_text = "let the employee 1 take decison" class WaitForP2(WaitPage): title_text = "waiting for Employee 2" body_text = "let the employee 2 take decison" class WaitForP3(WaitPage): title_text = "waiting for Employee 3" body_text = "let the employee 3 take decison" class Results(Page): pass class ResultsWaitPage(WaitPage): title_text = "pls wait for the results" body_text = "let the employee 2 take decison" def after_all_players_arrive(self): self.group.set_payoffs() page_sequence = [ Introduction, Introduction2, Introtoe1, Introtoe2, Introtoe3, A, WaitForP1, Aske3, WaitForP3, A3, WaitForP3, A3result, A1, WaitForP2, z1_choice, q1_choice, q2_choice, q3_choice, q4_choice, q5_choice, q6_choice, q7_choice, Rinves, NRinves, Invesdone, InvestdoneNR, A2, A4, ResultsWaitPage, Results ]