from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'intro_and_check' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 ANSWERS = ('C', 'A', 'C', 'B', 'B') class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): q1_answer = models.StringField(choices=[['A', 'Base revenue = Your data * revenue factor'], ['B', 'Base revenue = Data shared with you * revenue factor'], ['C', 'Base revenue = (Your data + data shared with you) * revenue factor'], ['D', 'Base revenue = Average base revenue of rivals * competition factor']], label='How is the base revenue calculated in the experiment?', widget=widgets.RadioSelect) q1_e_counter = models.IntegerField(initial=1) q2_answer = models.StringField(choices=[['A', 'The number of rounds played'], ['B', 'The competition factor'], ['C', 'The data units shared'], ['D', 'The revenue factor']], label='Which factor does NOT influence the profit calculation in the experiment?', widget=widgets.RadioSelect) q2_e_counter = models.IntegerField(initial=1) q3_answer = models.StringField(choices=[['A', 'You > Rival 1 > Rival 2'], ['B', 'You > Rival 2 > Rival 1'], ['C', 'Rival 1 > You > Rival 2'], ['D', 'Rival 2 > You > Rival 1']], label='If you receive 70 data units in total, while Rival 1 receives 80 and Rival 2 receives 60, what is the correct order of payouts? (assume that all players have the same revenue factor)', widget=widgets.RadioSelect) q3_e_counter = models.IntegerField(initial=1) q4_answer = models.StringField(choices=[['A', 'You'], ['B', 'Rival 1'], ['C', 'Rival 2'], ['D', 'You all profit equally']], label='If Rival 1 has a higher revenue factor than you do (e.g. you have 1, and they have 1.25) and you share the same amount of data with each other who receives more profits in the round? (assume that Rival 2 shares and receives the same amount too)', widget=widgets.RadioSelect) q4_e_counter = models.IntegerField(initial=1) q5_answer = models.StringField(choices=[['A', 'Less risk'], ['B', 'More risk'], ['C', 'Same risk']], label='If you face a higher competition (factor), then is it more or less risk involved to share data with others? (assume that all players have the same revenue factor)', widget=widgets.RadioSelect) q5_e_counter = models.IntegerField(initial=1) consent = models.BooleanField(choices=[[True, 'Yes, I agree to take part'], [False, 'No, I refuse to take part']], widget=widgets.RadioSelectHorizontal) def q1_answer_error_message(player: Player, value): if value != C.ANSWERS[0]: player.q1_e_counter = player.q1_e_counter + 1 return 'Incorrect answer, please try again. Remember, “You and your rivals make extra revenue for every unit of data received in the sharing decision. All units of data you have access to will be added up and will be multiplied by a certain revenue factor giving you your base revenue.”' def q2_answer_error_message(player: Player, value): if value != C.ANSWERS[1]: player.q2_e_counter = player.q2_e_counter + 1 return 'Incorrect answer, please try again. Remember, “The underlying mechanics on revenue generation are exactly the same for all rivals. You will play 7 rounds, every round is a clean slate, no profit or data is carried over.”' def q3_answer_error_message(player: Player, value): if value != C.ANSWERS[2]: player.q3_e_counter = player.q3_e_counter + 1 return 'Incorrect answer, please try again. Remember, “You and your rivals make extra revenue for every unit of data received in the sharing decision. All units of data you have access to will be added up and will be multiplied by a certain revenue factor giving you your base revenue.”' def q4_answer_error_message(player: Player, value): if value != C.ANSWERS[3]: player.q4_e_counter = player.q4_e_counter + 1 return 'Incorrect answer, please try again. Remember, "You may face scenarios where you and your rivals have different revenue factors, so that for the same amount of data, you will make different revenues.""' def q5_answer_error_message(player: Player, value): group = player.group if value != C.ANSWERS[4]: player.q5_e_counter = player.q5_e_counter + 1 return 'Incorrect answer, please try again. Remember, "Some markets are more competitive than others. You may be grouped in a market where the competition factor will be lower (...) or in a market where the competition factor will be higher (...). Therefore, it in the latter case, it is much riskier to share data compared to a scenario with a low competition factor."' class Consent(Page): form_model = 'player' form_fields = ['consent'] class Consent_Refused(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return not player.consent class General_Description(Page): form_model = 'player' class Q1_Revenue_Formula(Page): form_model = 'player' form_fields = ['q1_answer'] class Q2_Factors(Page): form_model = 'player' form_fields = ['q2_answer'] class Q3_Data(Page): form_model = 'player' form_fields = ['q3_answer'] class Q4_Revenue_Factor(Page): form_model = 'player' form_fields = ['q4_answer'] class Q5_Competition(Page): form_model = 'player' form_fields = ['q5_answer'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant import time player.participant.wait_page_arrival = time.time() page_sequence = [Consent, Consent_Refused, General_Description, Q1_Revenue_Formula, Q2_Factors, Q3_Data, Q4_Revenue_Factor, Q5_Competition]