from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class StartWaitPage(Page): def is_displayed(self): return self.round_number == 1 class Role(Page): def is_displayed(self): return self.round_number == 1 or self.round_number == 8 or self.round_number == 15 timeout_seconds = 20 class Role_Introduction(Page): def is_displayed(self): return self.round_number == 1 or self.round_number == 8 or self.round_number == 15 timeout_seconds = 120 class Point(Page): def is_displayed(self): return self.player.id_in_group == 2 or self.player.id_in_group == 3 class P1_Entry(Page): def is_displayed(self): return self.player.id_in_group == 1 timeout_seconds = 30 form_model = 'group' form_fields = ['p1_entry'] class P1_Entry_Check(Page): def is_displayed(self): return self.player.id_in_group == 1 timeout_seconds = 20 form_model = 'group' form_fields = ['p1_entry_check'] class P1_Entry_Re(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry_check == '0' timeout_seconds = 30 form_model = 'group' form_fields = ['p1_entry'] class EntryWaitPage(WaitPage): body_text = "参入の意思決定を行っています。しばらくお待ちください。" class P1_Entry_Result(Page): timeout_seconds = 20 class P2_Sosi(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' timeout_seconds = 30 form_model = 'group' form_fields = ['p2_sosi'] class P2_Sosi_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_sosi_check'] class P2_Sosi_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi_check == '0' timeout_seconds = 30 form_model = 'group' form_fields = ['p2_sosi'] class P3_Sosi(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' timeout_seconds = 30 form_model = 'group' form_fields = ['p3_sosi'] class P3_Sosi_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_sosi_check'] class P3_Sosi_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p3_sosi_check == '0' timeout_seconds = 30 form_model = 'group' form_fields = ['p3_sosi'] class P2_Sosi_Sannkou(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'NE' timeout_seconds = 30 form_model = 'group' form_fields = ['p2_sosi_sannkou'] class P3_Sosi_Sannkou(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'NE' timeout_seconds = 30 form_model = 'group' form_fields = ['p3_sosi_sannkou'] class SosiWaitPage(WaitPage): def is_displayed(self): return self.group.p1_entry == 'E' body_text = "参入阻止の意思決定を行っています。しばらくお待ちください。" class P2P3_Sosi_Result(Page): def is_displayed(self): return self.group.p1_entry == 'E' timeout_seconds = 20 class NormalWaitPage(WaitPage): pass class Decide_P2_NE(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'NE' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_NE'] class Decide_P2_NE_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'NE' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_unit_NE_check'] class Decide_P2_NE_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'NE' and self.group.p2_unit_NE_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_NE'] class Decide_P3_NE(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'NE' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_NE'] class Decide_P3_NE_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'NE' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_unit_NE_check'] class Decide_P3_NE_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'NE' and self.group.p3_unit_NE_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_NE'] class Decide_P3_ENY(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_Y'] class Decide_P3_ENY_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_unit_Y_check'] class Decide_P3_ENY_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' and self.group.p3_unit_Y_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_Y'] class Decide_P2_EYN(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_Y'] class Decide_P2_EYN_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_unit_Y_check'] class Decide_P2_EYN_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' and self.group.p2_unit_Y_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_Y'] class Decide_P2_EYY(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_Y'] class Decide_P2_EYY_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_unit_Y_check'] class Decide_P2_EYY_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' and self.group.p2_unit_Y_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_Y'] class Decide_P3_EYY(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_Y'] class Decide_P3_EYY_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_unit_Y_check'] class Decide_P3_EYY_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' and self.group.p3_unit_Y_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_Y'] class DecideWaitPage(WaitPage): body_text = "他の実験参加者が生産量を決定するまでお待ちください。" class Decide_P1_ENN(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P1_ENN_Check(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p1_unit_check'] class Decide_P1_ENN_Re(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' and self.group.p1_unit_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P2_ENN(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_N'] class Decide_P2_ENN_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_unit_N_check'] class Decide_P2_ENN_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' and self.group.p2_unit_N_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_N'] class Decide_P3_ENN(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p3_sosi == 'N' and self.group.p2_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_N'] class Decide_P3_ENN_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_unit_N_check'] class Decide_P3_ENN_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' and self.group.p3_unit_N_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_N'] class Decide_P1_ENY(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P1_ENY_Check(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p1_unit_check'] class Decide_P1_ENY_Re(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' and self.group.p1_unit_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P2_ENY(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_N'] class Decide_P2_ENY_Check(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p2_unit_N_check'] class Decide_P2_ENY_Re(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' and self.group.p2_unit_N_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p2_unit_N'] class Decide_P1_EYN(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P1_EYN_Check(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p1_unit_check'] class Decide_P1_EYN_Re(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' and self.group.p1_unit_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P3_EYN(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_N'] class Decide_P3_EYN_Check(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 20 form_model = 'group' form_fields = ['p3_unit_N_check'] class Decide_P3_EYN_Re(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' and self.group.p3_unit_N_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p3_unit_N'] class Decide_P1_EYY(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class Decide_P1_EYY_Check(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 20 form_model = 'group' form_fields = ['p1_unit_check'] class Decide_P1_EYY_Re(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' and self.group.p1_unit_check == '0' timeout_seconds = 60 form_model = 'group' form_fields = ['p1_unit'] class ResultsWaitPage(WaitPage): body_text = "他の実験参加者が生産量を決定するまでお待ちください。" def after_all_players_arrive(self): self.group.set_payoffs() class Result_P1_NE(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'NE' timeout_seconds = 30 class Result_P2_NE(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'NE' timeout_seconds = 30 class Result_P3_NE(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'NE' timeout_seconds = 30 class Result_P1_ENN(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P2_ENN(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P3_ENN(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P1_ENY(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Result_P2_ENY(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Result_P3_ENY(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'N' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Result_P1_EYN(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P2_EYN(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P3_EYN(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'N' timeout_seconds = 30 class Result_P1_EYY(Page): def is_displayed(self): return self.player.id_in_group == 1 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Result_P2_EYY(Page): def is_displayed(self): return self.player.id_in_group == 2 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Result_P3_EYY(Page): def is_displayed(self): return self.player.id_in_group == 3 and self.group.p1_entry == 'E' and self.group.p2_sosi == 'Y' and self.group.p3_sosi == 'Y' timeout_seconds = 30 class Shuffle(Page): def is_displayed(self): return self.round_number == 7 or self.round_number == 14 timeout_seconds = 20 class ShuffleWaitPage(WaitPage): body_text = "他の実験参加者を待っています。しばらくお待ちください。" def is_displayed(self): return self.round_number == 7 or self.round_number == 14 def after_all_players_arrive(self): self.group.set_payoffs() page_sequence = [StartWaitPage, NormalWaitPage, Role, NormalWaitPage, Role_Introduction, NormalWaitPage, Point, P1_Entry, P1_Entry_Check, P1_Entry_Re, EntryWaitPage, P1_Entry_Result, P2_Sosi, P3_Sosi, P2_Sosi_Check, P3_Sosi_Check, P2_Sosi_Re, P3_Sosi_Re, SosiWaitPage, P2P3_Sosi_Result, P2_Sosi_Sannkou, P3_Sosi_Sannkou, NormalWaitPage, Decide_P2_NE, Decide_P3_NE, Decide_P2_NE_Check, Decide_P2_NE_Re, Decide_P3_NE_Check, Decide_P3_NE_Re, Decide_P3_ENY, Decide_P3_ENY_Check, Decide_P3_ENY_Re, Decide_P2_EYN, Decide_P2_EYN_Check, Decide_P2_EYN_Re, Decide_P2_EYY, Decide_P3_EYY, Decide_P2_EYY_Check, Decide_P2_EYY_Re, Decide_P3_EYY_Check, Decide_P3_EYY_Re, DecideWaitPage, Decide_P1_ENN, Decide_P2_ENN, Decide_P3_ENN, Decide_P1_ENN_Check, Decide_P1_ENN_Re, Decide_P2_ENN_Check, Decide_P2_ENN_Re, Decide_P3_ENN_Check, Decide_P3_ENN_Re, Decide_P1_ENY, Decide_P2_ENY, Decide_P1_ENY_Check, Decide_P1_ENY_Re, Decide_P2_ENY_Check, Decide_P2_ENY_Re, Decide_P1_EYN, Decide_P3_EYN, Decide_P1_EYN_Check, Decide_P1_EYN_Re, Decide_P3_EYN_Check, Decide_P3_EYN_Re, Decide_P1_EYY, Decide_P1_EYY_Check, Decide_P1_EYY_Re, ResultsWaitPage, Result_P1_NE, Result_P2_NE, Result_P3_NE, Result_P1_ENN, Result_P2_ENN, Result_P3_ENN, Result_P1_ENY, Result_P2_ENY, Result_P3_ENY, Result_P1_EYN, Result_P2_EYN, Result_P3_EYN, Result_P1_EYY, Result_P2_EYY, Result_P3_EYY, Shuffle, ShuffleWaitPage, ]