from otree.api import * import random c = Currency doc = """ Rot Prac vs Comp - Replenish """ class Constants(BaseConstants): name_in_url = 'expf_rp' players_per_group = None num_rounds = 15 class Subsession(BaseSubsession): pass class Group(BaseGroup): red_message = models.StringField() blue_decision = models.StringField() accurate = models.BooleanField() reveal = models.StringField(initial='abc') end_reveal = models.StringField() replace_defense = models.StringField() disclosure = models.StringField() no_replace = models.StringField() class Player(BasePlayer): current_block = models.IntegerField() block_round = models.IntegerField() decision_points = models.IntegerField() verify_cost = models.IntegerField() end_verify_cost = models.IntegerField(initial=0) replace_cost = models.IntegerField(initial=0) def role(self): if self.id_in_group == 1: return 'blue' gender = models.StringField( widget=widgets.RadioSelectHorizontal, choices=['Male', 'Female'] ) age = models.StringField() race = models.StringField( widget=widgets.RadioSelectHorizontal, choices=['White', 'Black/African American', 'Hispanic/Latino', 'Asian', 'Alaskan or Native American', 'Pacific Islander', 'Other'] ) nationality = models.StringField() response = models.StringField( widget=widgets.RadioSelectHorizontal, choices= ['Believe','Insure','Risk-Avert'] ) verification_choice = models.StringField( widget = widgets.RadioSelect, choices = ['Partner Red Player - 90% accuracy (cost: 2 points)', 'Partner Red Player - 100% accuracy (cost: 6 points)', 'I do NOT want to know'] ) end_verification_choice = models.StringField( widget = widgets.RadioSelect, choices = ['Yes (cost: 2 points)', 'No'] ) replace_option = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Replace (cost 8 points)','Do not Replace'] ) replace_option2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Replace (cost 8 points)','Do not Replace'] ) trust1Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust1Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust1Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust1Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability1Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity1Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect1Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect1Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect1Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect1Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect1Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect1Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust2Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust2Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust2Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust2Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability2Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity2Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect2Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect2Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect2Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect2Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect2Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect2Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust3Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ability3Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity3Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) believe3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) futureQuestion1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) futureQuestion2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) man_check1Question1 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_check1Question2 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_task_q1 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_task_q2 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_task_q3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Believe' , 'Insure' , 'Avert-Risk'] ) man_task_q4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Believe' , 'Insure' , 'Avert-Risk'] ) man_task_q5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Accurate' , 'Inaccurate'] ) man_process_q1 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q2 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q3 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q4 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q5 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q6 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q7 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q8 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) ptt_q1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ptt_q2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ptt_q3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ptt_q4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) ptt_q5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect_b1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect_b2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) pos_affect_b3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect_b1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect_b2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) neg_affect_b3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) #Functions def creating_session(subsession): message = random.randint(0,1) group = subsession.get_groups() for g in group: if message == 0: g.red_message = "The number is EVEN" else: g.red_message = "The number is ODD" for g in group: if subsession.round_number != 6: g.accurate = True else: g.accurate = False players = subsession.get_players() for p in players: if p.round_number < 6: p.current_block = 1 elif p.round_number > 10: p.current_block = 3 else: p.current_block = 2 for p in players: if p.round_number not in [5,10,15]: p.block_round = p.round_number % 5 elif p.round_number in [5, 10, 15]: p.block_round = 5 #Pages class consent_form(Page): def is_displayed(player): return player.round_number in [1] class baseline(Page): form_model = 'player' form_fields = ['gender','age', 'race', 'nationality', 'ptt_q1', 'ptt_q2', 'ptt_q3', 'ptt_q4', 'ptt_q5', 'neg_affect_b1', 'neg_affect_b2', 'neg_affect_b3', 'pos_affect_b1', 'pos_affect_b2', 'pos_affect_b3'] def is_displayed(player): return player.round_number in [1] class task_rules(Page): form_model = 'player' form_fields = ['man_task_q1', 'man_task_q2', 'man_task_q3', 'man_task_q4', 'man_task_q5'] def is_displayed(player): return player.round_number in [1] class process_rules(Page): form_model = 'player' form_fields = ['man_process_q1', 'man_process_q2', 'man_process_q3', 'man_process_q4', 'man_process_q5', 'man_process_q6', 'man_process_q7', 'man_process_q8'] def is_displayed(player): return player.round_number in [1] class receiver(Page): form_model = 'player' def is_displayed(self): return self.round_number in [1,6,11] class receiver_2(Page): form_model = 'player' form_fields = ['verification_choice'] def is_displayed(self): return self.round_number not in [1,6,11] class survey_1(Page): form_model = 'player' form_fields = ['trust1Question1', 'trust1Question2', 'trust1Question3' ,'trust1Question4', 'integrity1Question1', 'integrity1Question2', 'integrity1Question3', 'integrity1Question4', 'integrity1Question5', 'integrity1Question6', 'pos_affect1Question1', 'pos_affect1Question2', 'pos_affect1Question3', 'neg_affect1Question1', 'neg_affect1Question2', 'neg_affect1Question3'] class survey_2(Page): form_model = 'player' form_fields = ['trust2Question1', 'trust2Question2', 'trust2Question3' ,'trust2Question4', 'integrity2Question1', 'integrity2Question2', 'integrity2Question3', 'integrity2Question4', 'integrity2Question5', 'integrity2Question6', 'pos_affect2Question1', 'pos_affect2Question2', 'pos_affect2Question3', 'neg_affect2Question1', 'neg_affect2Question2', 'neg_affect2Question3'] class survey_3(Page): form_model = 'player' form_fields = ['believe3Question1', 'trust3Question1', 'trust3Question2', 'trust3Question3' ,'trust3Question4', 'integrity3Question1', 'integrity3Question2', 'integrity3Question3', 'integrity3Question4', 'integrity3Question5', 'integrity3Question6', 'pos_affect3Question1', 'pos_affect3Question2', 'pos_affect3Question3', 'neg_affect3Question1', 'neg_affect3Question2', 'neg_affect3Question3'] def is_displayed(player): return player.round_number in [6] class survey_4(Page): form_model = 'player' form_fields = ['futureQuestion1', 'futureQuestion2'] def is_displayed(player): return player.round_number in [5,10,15] class manipulation_check1(Page): form_model = 'player' form_fields = ['man_check1Question1', 'man_check1Question2'] def is_displayed(player): return player.round_number in [1,6,11] class verification_wait(WaitPage): form_model = 'group' def after_all_players_arrive(group): players = group.get_players() for p in players: if p.verification_choice == 'Partner Red Player - 90% accuracy (cost: 2 points)': group.reveal = 'The Partner Red Player sent an ACCURATE message' p.payoff -= 2 p.verify_cost = 2 elif p.verification_choice == 'Partner Red Player - 100% accuracy (cost: 6 points)': group.reveal = 'The Partner Red Player sent an ACCURATE message' p.payoff -= 6 p.verify_cost = 6 else: group.reveal= 'pass' p.payoff += 0 p.verify_cost = 0 def is_displayed(player): return player.round_number not in [1,6,11] class verification(Page): def is_displayed(player): return player.round_number not in [1,6,11] and player.group.reveal != 'pass' class rd_6_defense(Page): def is_displayed(player): return player.round_number not in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] class receiver_choice(Page): form_model = 'player' form_fields = ['response'] class disclose_wait(WaitPage): form_model = 'player' def after_all_players_arrive(group): if group.round_number in [5]: group.disclosure = 'I do not wish to disclose anything at this point' elif group.round_number in [10]: group.disclosure = 'I want to inform you that I did send an inaccurate message in this block and felt ' \ 'extremely guilty about it right away. I am really sorry for doing that and I assure ' \ 'you it would not be repeated again.' elif group.round_number in [15] + Yes for replace1 in rd 10 + No for replace2 in round 10: group.disclosure = 'I do not wish to disclose anything for this block' else: pass def is_displayed(self): return self.round_number in [5,10,15] class self_disclose(Page): form_model = 'player' def is_displayed(self): return self.round_number in [5,10,15] class end_verification_choice(Page): form_model = 'player' form_fields = ['end_verification_choice'] def is_displayed(self): return self.round_number in [5,10,15] class end_verification_wait(WaitPage): def after_all_players_arrive(group): players = group.get_players() for p in players: if p.end_verification_choice == 'Yes (cost: 2 points)' and group.round_number in [5,15]: group.end_reveal = "Your partner Red Player sent you ACCURATE information in round 1 of the block" elif p.end_verification_choice == 'Yes (cost: 2 points)' and group.round_number in [10]: group.end_reveal = "The partner Red Player sent INACCURATE information in round 1 of the block" else: pass for p in players: if p.end_verification_choice == 'Yes (cost: 2 points)': p.payoff -= 2 p.end_verify_cost = 2 elif p.end_verification_choice == 'No': p.payoff += 0 p.end_verify_cost = 0 def is_displayed(player): return player.round_number in [5,10,15] and player.end_verification_choice == 'Yes (cost: 2 points)' class end_verification(Page): def is_displayed(player): return player.round_number in [5,10,15] and player.end_verification_choice == 'Yes (cost: 2 points)' class replace_choice(Page): form_model = 'player' form_fields = ['replace_option'] def is_displayed(player): return player.round_number in [5,10,15] class replace_choice2(Page): form_model = 'player' form_fields = ['replace_option2'] def is_displayed(player): return player.round_number in [5,10,15] and player.replace_option == 'Replace (cost 8 points)' class replace_defense_wait(WaitPage): form_model = 'player' def after_all_players_arrive(group): players= group.get_players() for p in players: if p.replace_option == 'Replace (cost 8 points)': group.replace_defense = 'If you continue the relationship, I will mention in the next disclosure' \ 'that 20 points from my continuation bonus be passed to you' else: group.replace_defense = 'abc' p.replace_option2 = 'Do not Replace' def is_displayed(player): return player.round_number in [5,10,15] class replace_defense(Page): form_model = 'player' def is_displayed(player): return player.round_number in [5,10,15] and player.replace_option == 'Replace (cost 8 points)' class no_replace_wait(WaitPage): def after_all_players_arrive(group): players = group.get_players() for p in players: if p.replace_option2 == 'Replace (cost 8 points)': group.no_replace = 'Your partner Red Player has been replaced. You have now been assigned a new Red Player partner' p.payoff -= 8 p.replace_cost = 8 else: group.no_replace = 'abc' p.replace_cost = 0 def is_displayed(player): return player.round_number in [5,10,15] and player.replace_option2 == 'Replace (cost 8 points)' class message_no_replace(Page): def is_displayed(player): return player.round_number in [5,10,15] and player.replace_option2 == 'Replace (cost 8 points)' class ResultsWaitPage(WaitPage): def after_all_players_arrive(group): players = group.get_players() for p in players: if p.role() == "blue": if p.response == "Believe": group.blue_decision = "Believe" elif p.response == "Insure": group.blue_decision = "Insure" else: group.blue_decision = "Risk-Avert" for p in players: if group.accurate == True and group.blue_decision == 'Believe': p.payoff += 12 p.decision_points = 12 elif group.accurate == True and group.blue_decision == 'Insure': p.payoff += 9 p.decision_points = 9 elif group.accurate == True and group.blue_decision == 'Risk-Avert': p.payoff += 6 p.decision_points = 6 elif group.accurate == False and group.blue_decision == 'Believe': p.payoff += 0 p.decision_points = 0 elif group.accurate == False and group.blue_decision == 'Insure': p.payoff += 3 p.decision_points = 3 else: p.payoff += 6 p.decision_points = 6 class Results(Page): def is_displayed(group): return group.round_number in [1,2,3,4,5,11,12,13,14] class final_page(Page): def is_displayed(group): return group.round_number in [15] class start_wait_time(Page): sec = random.randint(6,8) timeout_seconds = sec def is_displayed(player): return player.round_number in [1,6,11] class start_waittime(Page): sec1 = random.randint(2,4) timeout_seconds = sec1 def is_displayed(player): return player.round_number not in [1,6,11] class disclosure_wait_time(Page): sec2 = random.randint(10,15) timeout_seconds = sec2 def is_displayed(player): return player.round_number in [5,10,15] class replacement_wait_time(Page): sec3 = random.randint(10,15) timeout_seconds = sec3 def is_displayed(player): return player.replace_option2 == 'Replace (cost 8 points)' class explain_replace_wait_time(Page): sec4 = random.randint(10,15) timeout_seconds = sec4 def is_displayed(player): return player.replace_option == 'Replace (cost 8 points)' class explain_inaccurate_wait_time(Page): sec = random.randint(10,15) timeout_seconds = sec def is_displayed(player): return player.round_number in [6] class replace_correction_wait(WaitPage): def after_all_players_arrive(group): players = group.get_players() for p in players: if p.round_number not in [5,10,15]: p.replace_option = 'Do not Replace' p.replace_option2 = 'Do not Replace' def is_displayed(group): return group.round_number not in [5,10,15] page_sequence = [consent_form, baseline, task_rules, process_rules, start_waittime, start_wait_time, receiver, receiver_2, manipulation_check1, verification_wait, verification, replace_correction_wait, survey_1, explain_inaccurate_wait_time, rd_6_defense, survey_3, receiver_choice, disclosure_wait_time, disclose_wait, self_disclose, end_verification_choice, end_verification_wait, end_verification, replace_choice, replace_defense_wait, explain_replace_wait_time, replace_defense, replace_choice2, no_replace_wait, replacement_wait_time, message_no_replace, survey_4, ResultsWaitPage, Results, final_page ]