from otree.api import * doc = """ Instructions for misconfidence """ class C(BaseConstants): NAME_IN_URL = 'instructions_misconfidence' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): comprehension11 = models.IntegerField( choices=[[1, '24'], [2, '21'], [3, '22'], [4, '15']], widget=widgets.RadioSelect, label='Suppose Player0 picks a price of 15. What is the average price set by the computers?', ) comprehension12 = models.IntegerField( choices=[[1, '572'], [2, '622'], [3, '542'], [4, '641']], widget=widgets.RadioSelect, label='If Player0 picks 15, then the average price set by the computers is 22. What is Player0 nominal income in this case?' ) comprehension13 = models.IntegerField( choices=[[1, '25.81'], [2, '29.13'], [3, '26.00'], [4, '27.04']], widget=widgets.RadioSelect, label=' If Player0 picks 15, then the average price set by the computers is 22. What is Player0 real income in this case?' ) comprehension21 = models.IntegerField( choices=[[1, '15'], [2, '24'], [3, '21'], [4, '25']], widget=widgets.RadioSelect, label='What is the average price set by the computers?' ) comprehension22 = models.IntegerField( choices=[[1, '27'], [2, '26'], [3, '25'], [4, '28']], widget=widgets.RadioSelect, label='What is the overall rounded (to the closest integer) average price (Player0 price and the price set by the three computers)?' ) class Instructions0(Page): pass class GeneralRules(Page): pass class Player0Game(Page): pass class InstructionsPlayer1(Page): pass class InstructionsPlayer2(Page): pass class Comprehension11(Page): form_model = 'player' form_fields = ['comprehension11'] class WrongComp11(Page): def is_displayed(self): return self.comprehension11 != 3 class RightComp11(Page): def is_displayed(self): return self.comprehension11 == 3 class Comprehension12(Page): form_model = 'player' form_fields = ['comprehension12'] class WrongComp12(Page): def is_displayed(player): return player.comprehension12 != 1 class RightComp12(Page): def is_displayed(self): return self.comprehension12 == 1 class Comprehension13(Page): form_model = 'player' form_fields = ['comprehension13'] class WrongComp13(Page): def is_displayed(player): return player.comprehension13 != 3 class RightComp13(Page): def is_displayed(self): return self.comprehension13 == 3 class Comprehension21(Page): form_model = 'player' form_fields = ['comprehension21'] class WrongComp21(Page): def is_displayed(player): return player.comprehension21 != 4 class RightComp21(Page): def is_displayed(player): return player.comprehension21 == 4 class Comprehension22(Page): form_model = 'player' form_fields = ['comprehension22'] class WrongComp22(Page): def is_displayed(player): return player.comprehension22 != 2 class RightComp22(Page): def is_displayed(player): return player.comprehension22 == 2 class BeginExperiment(Page): pass page_sequence = [GeneralRules, Instructions0, Player0Game, Comprehension11, WrongComp11, RightComp11, Comprehension12, WrongComp12, RightComp12, Comprehension13, WrongComp13, RightComp13, InstructionsPlayer1, InstructionsPlayer2, Comprehension21, WrongComp21, RightComp21, Comprehension22, WrongComp22, RightComp22, BeginExperiment ]