from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class Introduction(Page): def is_displayed(self): return self.round_number == 1 class seisan_decide(Page): timeout_seconds = 30 def is_displayed(self): return self.player.id_in_group == Constants.A_List[self.round_number - 1] form_model = 'group' form_fields = ['seisanSelect'] class chaba_decide(Page): timeout_seconds = 30 def is_displayed(self): return self.player.id_in_group == Constants.B_List[self.round_number - 1] form_model = 'group' form_fields = ['chabaSelect'] class quantity_decide1(Page):#企業一の決断 timeout_seconds = 90 def is_displayed(self): return self.player.id_in_group == Constants.A_List[self.round_number - 1] form_model = 'group' form_fields = ['seisan_units'] class quantity_decide2(Page):#企業2の決断 timeout_seconds = 90 def is_displayed(self): return self.player.id_in_group == Constants.B_List[self.round_number - 1] form_model = 'group' form_fields = ['chaba_units'] class first_WaitPage(WaitPage): body_text = "相手の準備が整うまでお待ちください" class ChoiceWaitPage(WaitPage): body_text = "相手の選択をお待ちください" class ResultsWaitPage(WaitPage): body_text = "相手が生産量を決定するまでお待ちください" after_all_players_arrive = 'set_payoffs' class seisan_Results(Page): def is_displayed(self): return self.player.id_in_group == Constants.A_List[self.round_number - 1] class chaba_Results(Page): def is_displayed(self): return self.player.id_in_group == Constants.B_List[self.round_number - 1] page_sequence = [ Introduction, first_WaitPage, seisan_decide, chaba_decide, ChoiceWaitPage, quantity_decide1, quantity_decide2, ResultsWaitPage, seisan_Results, chaba_Results ]