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 """Description of the game: How to play and returns expected""" pass class Test(Page): form_model = "player" form_fields = ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6", "test_7" ] def is_displayed(self): return self.round_number == 1 def test_1_error_message(self, test_1): if test_1 != True: return '※ この実験は2人組で行います。' def test_2_error_message(self, test_2): if test_2 != True: return '※ この実験は実験1を10ラウンド、実験2を10ラウンドの合計20ラウンド行います。' def test_3_error_message(self, test_3): if test_3 != True: return '※ 初期保有量は100ポイントです' def test_4_error_message(self, test_4): if test_4 != True : return '※ ペアはラウンドが変わるごとに入れ替わります。' def test_5_error_message(self, test_5): if test_5 != True : return '※ 実験1の時のリターンの式は、(自分の投資額+相手の投資額)×1.5÷2ですので、(50+50)×1,5÷2で、75となります。' def test_6_error_message(self, test_6): if test_6 != True : return '※ 実験1の時の獲得利得の式は、(自分の投資額+相手の投資額)×1.5÷2+(100-自分の投資額)ですので、(50+50)×1,5÷2+(100-50)で、125となります。' def test_7_error_message(self, test_7): if test_7 != True : return '※ 実験2の時の獲得利得の式は、(自分の投資額+相手の投資額)×1.9÷2+(100-自分の投資額)ですので、(100+50)×1.9÷2+(100-100)で、143となります。' class Start(Page): def is_displayed(self): return self.round_number == 1 class Contribute(Page): """Player: Choose how much to contribute""" form_model = 'player' form_fields = ['contribution'] class ResultsWaitPage(WaitPage): after_all_players_arrive = 'set_payoffs' body_text = "他のプレイヤーを待ってください" class Results(Page): """Players payoff: How much each has earned""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) page_sequence = [Test,Start, Contribute, ResultsWaitPage, Results]