from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'my_test' players_per_group = None num_rounds = 1 total_capacity = 150 instructions_template = 'my_test/instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): test_1 = models.BooleanField( label="解答", choices=[ [False, "〇"], [True, "×"], [False, "わからない"], ], ) test_2 = models.BooleanField( label="解答", choices=[ [False, "〇"], [True, "×"], [False, "わからない"], ], ) test_3 = models.BooleanField( label="解答", choices=[ [True, "〇"], [False, "×"], [False, "わからない"], ], ) test_4 = models.BooleanField( label="解答", choices=[ [True, "〇"], [False, "×"], [False, "わからない"], ], ) test_5 = models.BooleanField( label="解答", choices=[ [False, "100"], [True, "130"], [False, "90"], [False, "80"], ], ) test_6 = models.BooleanField( label="解答", choices=[ [False, "2000"], [False, "2400"], [False, "1400"], [True, "1800"], ], ) test_7 = models.BooleanField( label="解答", choices=[ [False, "300"], [True, "400"], [False, "500"], [False, "700"], ], ) def test_1_error_message(player, test_1): if test_1!=True: return '※ 実験は2人1組で行います。' def test_2_error_message(player, test_2): if test_2 != True: return '※ この実験は実験1を10ラウンド、実験2を10ラウンドの合計20ラウンド行います。' def test_3_error_message(player, test_3): if test_3 != True: return '※ペアはラウンドごとに変わります。' def test_4_error_message(player, test_4): if test_4 != True: return '*※市場価格を求める式は'\ '[150-あなたの生産量―相手の生産量]です。' def test_5_error_message(player, test_5): if test_5 != True: return '※市場価格は130です。' def test_6_error_message(player, test_6): if test_6 != True: return '※あなたの利得は1800です。' def test_7_error_message(player, test_7): if test_7 != True: return '※あなたの利得は400です。' # PAGES class Introduction(Page): pass class Test(Page): form_model = 'player' form_fields = ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6", "test_7"] page_sequence = [Introduction, Test]