from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Instructions_ND_P' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 TEMP_TEMPLATE = 'Instructions_ND_P/temp.html' CC_TEMPLATE = 'Instructions_ND_P/cc.html' CC2_TEMPLATE = 'Instructions_ND_P/cc2.html' B_2_TEMPLATE = 'Instructions_ND_P/b_2.html' O_5_TEMPLATE = 'Instructions_ND_P/o_5.html' PROCEDURES_TEMPLATE = 'Instructions_ND_P/procedures.html' BEFORE_EXP_TEMPLATE = 'Instructions_ND_P/before_exp.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): CC13 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='Before deciding how much to bid on each asset in each round, Buyers will view each Owner’s prediction of their asset’s value. [TRUE or FALSE]', widget=widgets.RadioSelect) CC_6 = models.IntegerField(initial=0) CC13_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='Before deciding how much to bid on each asset in each round, Buyers will view each Owner’s prediction of their asset’s value. [TRUE or FALSE]', widget=widgets.RadioSelect) CC14 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='Regardless of how much the asset is actually worth, Owners earn more points as the amount of the highest bid for their asset increases. [TRUE or FALSE]', widget=widgets.RadioSelect) CC_7 = models.IntegerField(initial=0) CC14_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='Regardless of how much the asset is actually worth, Owners earn more points as the amount of the highest bid for their asset increases. [TRUE or FALSE]', widget=widgets.RadioSelect) def CC_Check_6(player: Player): if player.CC13 != 1: player.CC_6 += 1 else: player.CC_6 += 0 def CC13_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC_Check_7(player: Player): if player.CC14 != 1: player.CC_7 += 1 else: player.CC_7 += 0 def CC14_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." class B_Info(Page): form_model = 'player' class B_Info_Check(Page): form_model = 'player' form_fields = ['CC13'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_6(player) class B_Info_Check_13(Page): form_model = 'player' form_fields = ['CC13_2'] @staticmethod def is_displayed(player: Player): return player.CC13 != 1 class O_Pay(Page): form_model = 'player' class O_Pay_Check(Page): form_model = 'player' form_fields = ['CC14'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_7(player) class O_Pay_Check_14(Page): form_model = 'player' form_fields = ['CC14_2'] @staticmethod def is_displayed(player: Player): return player.CC14 != 1 class Procedure(Page): form_model = 'player' class BeforeExp(Page): form_model = 'player' page_sequence = [B_Info, B_Info_Check, B_Info_Check_13, O_Pay, O_Pay_Check, O_Pay_Check_14, Procedure, BeforeExp]