from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Instructions_Common' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 TEMP_TEMPLATE = 'Instructions_Common/temp.html' INTRODUCTION_TEMPLATE = 'Instructions_Common/introduction.html' OVERVIEW_TEMPLATE = 'Instructions_Common/overview.html' O_1_TEMPLATE = 'Instructions_Common/o_1.html' CC_TEMPLATE = 'Instructions_Common/cc.html' CC2_TEMPLATE = 'Instructions_Common/cc2.html' O_2_TEMPLATE = 'Instructions_Common/o_2.html' O_3_TEMPLATE = 'Instructions_Common/o_3.html' O_4_TEMPLATE = 'Instructions_Common/o_4.html' B_1_TEMPLATE = 'Instructions_Common/b_1.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Filter_Output = models.LongStringField() Filter_Input = models.StringField(label='Input answer here') CC1 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='The value of each asset can be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner will make a choice that influences the likelihood as to whether their asset’s value will be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC3 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner will make a prediction about whether their asset’s value will be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC_1 = models.IntegerField(initial=0) CC1_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='The value of each asset can be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC2_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner will make a choice that influences the likelihood as to whether their asset’s value will be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC3_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner will make a prediction about whether their asset’s value will be either 50 points or 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC4 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner can choose the likelihood that their asset’s value will be 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC5 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the LOW likelihood, then it is more likely that the value of the asset will be 50 points (90% chance) than 150 points (10% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC6 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the MEDIUM likelihood, then it is equally likely that the value of the asset will be 50 points (50% chance) or 150 points (50% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC7 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the HIGH likelihood, then it is more likely that the value of the asset will be 150 points (90% chance) than 50 points (10% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC_2 = models.IntegerField(initial=0) CC4_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='In each round, each Owner can choose the likelihood that their asset’s value will be 150 points [TRUE or FALSE]', widget=widgets.RadioSelect) CC5_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the LOW likelihood, then it is more likely that the value of the asset will be 50 points (90% chance) than 150 points (10% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC6_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the MEDIUM likelihood, then it is equally likely that the value of the asset will be 50 points (50% chance) or 150 points (50% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC7_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='If an Owner chooses the HIGH likelihood, then it is more likely that the value of the asset will be 150 points (90% chance) than 50 points (10% chance) [TRUE or FALSE]', widget=widgets.RadioSelect) CC8 = models.IntegerField(label='What cost will an Owner incur if they choose the LOW likelihood? [IN POINTS]') CC9 = models.IntegerField(label='What cost will an Owner incur if they choose the MEDIUM likelihood? [IN POINTS]') CC10 = models.IntegerField(label='What cost will an Owner incur if they choose the HIGH likelihood? [IN POINTS]') CC_3 = models.IntegerField(initial=0) CC8_2 = models.IntegerField(label='What cost will an Owner incur if they choose the LOW likelihood? [IN POINTS]') CC9_2 = models.IntegerField(label='What cost will an Owner incur if they choose the MEDIUM likelihood? [IN POINTS]') CC10_2 = models.IntegerField(label='What cost will an Owner incur if they choose the HIGH likelihood? [IN POINTS]') CC11 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='At the end of each round, Owners will receive the following information: (1) each Owner’s prediction of their asset’s value for that round and (2) the actual value of each Owner’s asset for that round. [TRUE or FALSE]', widget=widgets.RadioSelect) CC_4 = models.IntegerField(initial=0) CC11_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='At the end of each round, Owners will receive the following information: (1) each Owner’s prediction of their asset’s value for that round and (2) the actual value of each Owner’s asset for that round. [TRUE or FALSE]', widget=widgets.RadioSelect) CC12 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='The Buyer that makes the highest bid for a given asset will earn points equal to the value of that asset. [TRUE or FALSE]', widget=widgets.RadioSelect) CC_5 = models.IntegerField(initial=0) CC12_2 = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='The Buyer that makes the highest bid for a given asset will earn points equal to the value of that asset. [TRUE or FALSE]', widget=widgets.RadioSelect) def Filter_Code(player: Player): import random code = random.randint(1, 99999999) player.Filter_Output = str(code) def Filter_Input_error_message(player: Player, value): if value != player.Filter_Output: return "INCORRECT! Please try again." def CC_Check(player: Player): if player.CC1 != 1: player.CC_1 += 1 else: player.CC_1 += 0 if player.CC2 != 1: player.CC_1 += 1 else: player.CC_1 += 0 if player.CC3 != 1: player.CC_1 += 1 else: player.CC_1 += 0 def CC1_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC2_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC3_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC_Check_2(player: Player): if player.CC4 != 1: player.CC_2 += 1 else: player.CC_2 += 0 if player.CC5 != 1: player.CC_2 += 1 else: player.CC_2 += 0 if player.CC6 != 1: player.CC_2 += 1 else: player.CC_2 += 0 if player.CC7 != 1: player.CC_2 += 1 else: player.CC_2 += 0 def CC4_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC5_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC6_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC7_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC_Check_3(player: Player): if player.CC8 != 15: player.CC_3 += 1 else: player.CC_3 += 0 if player.CC9 != 50: player.CC_3 += 1 else: player.CC_3 += 0 if player.CC10 != 95: player.CC_3 += 1 else: player.CC_3 += 0 def CC8_2_error_message(player: Player, value): if value != 15: return "INCORRECT! Please try again." def CC9_2_error_message(player: Player, value): if value != 50: return "INCORRECT! Please try again." def CC10_2_error_message(player: Player, value): if value != 95: return "INCORRECT! Please try again." def CC_Check_4(player: Player): if player.CC11 != 1: player.CC_4 += 1 else: player.CC_4 += 0 def CC11_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." def CC_Check_5(player: Player): if player.CC12 != 1: player.CC_5 += 1 else: player.CC_5 += 0 def CC12_2_error_message(player: Player, value): if value != 1: return "INCORRECT! Please try again." class Intro(Page): form_model = 'player' @staticmethod def before_next_page(player: Player, timeout_happened): Filter_Code(player) class Bot(Page): form_model = 'player' form_fields = ['Filter_Input'] class Ex_Overview(Page): form_model = 'player' class O_Asset(Page): form_model = 'player' class O_Asset_Check(Page): form_model = 'player' form_fields = ['CC1', 'CC2', 'CC3'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check(player) class O_Asset_Check_1(Page): form_model = 'player' form_fields = ['CC1_2'] @staticmethod def is_displayed(player: Player): return player.CC1 != 1 class O_Asset_Check_2(Page): form_model = 'player' form_fields = ['CC2_2'] @staticmethod def is_displayed(player: Player): return player.CC2 != 1 class O_Asset_Check_3(Page): form_model = 'player' form_fields = ['CC3_2'] @staticmethod def is_displayed(player: Player): return player.CC3 != 1 class O_Likelihood(Page): form_model = 'player' class O_Likelihood_Check(Page): form_model = 'player' form_fields = ['CC4', 'CC5', 'CC6', 'CC7'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_2(player) class O_Likelihood_Check_4(Page): form_model = 'player' form_fields = ['CC4_2'] @staticmethod def is_displayed(player: Player): return player.CC4 != 1 class O_Likelihood_Check_5(Page): form_model = 'player' form_fields = ['CC5_2'] @staticmethod def is_displayed(player: Player): return player.CC5 != 1 class O_Likelihood_Check_6(Page): form_model = 'player' form_fields = ['CC6_2'] @staticmethod def is_displayed(player: Player): return player.CC6 != 1 class O_Likelihood_Check_7(Page): form_model = 'player' form_fields = ['CC7_2'] @staticmethod def is_displayed(player: Player): return player.CC7 != 1 class O_Cost(Page): form_model = 'player' class O_Cost_Check(Page): form_model = 'player' form_fields = ['CC8', 'CC9', 'CC10'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_3(player) class O_Cost_Check_8(Page): form_model = 'player' form_fields = ['CC8_2'] @staticmethod def is_displayed(player: Player): return player.CC8 != 15 class O_Cost_Check_9(Page): form_model = 'player' form_fields = ['CC9_2'] @staticmethod def is_displayed(player: Player): return player.CC9 != 50 class O_Cost_Check10(Page): form_model = 'player' form_fields = ['CC10_2'] @staticmethod def is_displayed(player: Player): return player.CC10 != 95 class O_Prediction(Page): form_model = 'player' class O_Prediction_Check(Page): form_model = 'player' form_fields = ['CC11'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_4(player) class O_Prediction_Check_11(Page): form_model = 'player' form_fields = ['CC11_2'] @staticmethod def is_displayed(player: Player): return player.CC11 != 1 class B_Bid(Page): form_model = 'player' class B_Bid_Check(Page): form_model = 'player' form_fields = ['CC12'] @staticmethod def before_next_page(player: Player, timeout_happened): CC_Check_5(player) class B_Bid_Check_12(Page): form_model = 'player' form_fields = ['CC12_2'] @staticmethod def is_displayed(player: Player): return player.CC12 != 1 page_sequence = [Intro, Bot, Ex_Overview, O_Asset, O_Asset_Check, O_Asset_Check_1, O_Asset_Check_2, O_Asset_Check_3, O_Likelihood, O_Likelihood_Check, O_Likelihood_Check_4, O_Likelihood_Check_5, O_Likelihood_Check_6, O_Likelihood_Check_7, O_Cost, O_Cost_Check, O_Cost_Check_8, O_Cost_Check_9, O_Cost_Check10, O_Prediction, O_Prediction_Check, O_Prediction_Check_11, B_Bid, B_Bid_Check, B_Bid_Check_12]