from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random class Constants(BaseConstants): name_in_url = 'inst_checktest' players_per_group = None num_rounds = 1 yen_rate=0.3 participation_fee=50 instructionsCF_template = 'inst_checktest/CFInstructions.html' class Subsession(BaseSubsession): conditionGSI = models.IntegerField() def get_game(self): self.conditionGSI = self.session.config['conditionGSI'] q1_a = models.IntegerField(initial=1) q2_a = models.IntegerField(initial=30) q3_a = models.IntegerField(initial=20) q4_a = models.IntegerField(initial=40) q5_a = models.IntegerField() q6_a = models.IntegerField(initial=25) q7_a = models.IntegerField(initial=28) def question(self): if self.conditionGSI == 1: self.q5_a = 1 elif self.conditionGSI == 2: self.q5_a = 3 else: self.q5_a = 2 pass class Group(BaseGroup): pass class Player(BasePlayer): def set_payoff(self): """Calculate payoff, which is zero for the survey""" self.payoff = 0 # collect_number=models.IntegerField() q11 = models.IntegerField(initial=None, choices=[ [1, 'ずっと変わらない'], [2, '毎回変わる'], ], verbose_name='グループの3人のメンバーはずっと変わらないですか?取引ごとに変わりますか?', widget=widgets.RadioSelectHorizontal()) q21 = models.IntegerField(initial=None, choices=[ [20, '20点'], [25, '25点'], [30, '30点'], ], verbose_name='ある回でのあなたの提供額は20点でした。一方、他の2人も全員、提供額は20点でした。この時、あなたの(減額システムによる減額前の)獲得額は何点になりますか?', widget=widgets.RadioSelectHorizontal()) q31 = models.IntegerField(initial=None, choices=[ [0, '0点'], [10, '10点'], [20, '20点'], ], verbose_name='ある回でのあなたの提供額は0点でした。一方、他の2人も全員、提供額は0点でした。この時、あなたの(減額システムによる減額前の)獲得額は何点になりますか?', widget=widgets.RadioSelectHorizontal()) q41 = models.IntegerField(initial=None, choices=[ [20, '20点'], [30, '30点'], [40, '40点'], ], verbose_name='ある回でのあなたの提供額は0点でした。一方、他の2人の提供額は、それぞれ20点でした。この時、あなたの(減額システムによる減額前の)獲得額は何点になりますか?', widget=widgets.RadioSelectHorizontal()) q51 = models.IntegerField(initial=None, choices=[ [1, '誰も減額されない'], [2, '5点提供した人だけが2点減額される'], [3, '3人全員が2点ずつ減額される'], ], verbose_name='3人中2人は15点を提供し、1人だけ5点を提供しました。減額システムによる減額について、以下のどれが正しいでしょうか?', widget=widgets.RadioSelectHorizontal()) q61 = models.IntegerField(initial=None, choices=[ [20, '20点'], [23, '23点'], [25, '25点'], ], verbose_name='ある回でのあなたの提供額は10点でした。一方、他の2人も全員、提供額は10点でした。この時、あなたの減額システムによる減額後の最終獲得額は何点になりますか?', widget=widgets.RadioSelectHorizontal()) q71 = models.IntegerField(initial=None, choices=[ [25, '25点'], [28, '28点'], [30, '30点'], ], verbose_name='先ほどの場合(3人全員10点提供し、あなたの最終獲得額は25点)から、あなただけ提供額を0点にした場合を考えてみましょう。他の2人は全員、提供額は10点でした。この時、あなたの減額システムによる減額後の最終獲得額は何点になりますか?', widget=widgets.RadioSelectHorizontal())