from otree.api import * import random c = Currency doc = """ Rot Part vs Comp Redirect """ class Constants(BaseConstants): name_in_url = 'expf_rd' players_per_group = 1 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' control_option = models.StringField( widget=widgets.RadioSelectHorizontal, choices=['Yes, I still want to continue with my partner Red Player', 'No, I want to replace my partner Red Player (cost 8pts)'] ) 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 = ['Info. correct mostly but NOT every time (cost 2pts)', 'Info. correct every time (cost 6pts)', 'I do NOT want to know'] ) end_verification_choice = models.StringField( widget = widgets.RadioSelect, choices = ['Yes (cost 2pts)', 'No'] ) replace_option = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Replace (cost 8pts)','Do not Replace'] ) replace_option2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['Replace (cost 8pts)','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'] ) believe3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) believe3Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Yes', '2. No'] ) trust4Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust4Question3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trust4Question4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity4Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity4Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) integrity4Question6 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) future3Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) future3Question2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) future4Question1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) future4Question2 = 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'] ) man_process_q9 = models.BooleanField( widget = widgets.RadioSelectHorizontal, choices = ['True' , 'False'] ) man_process_q10 = 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'] ) trait_forg_b1 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trait_forg_b2 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trait_forg_b3 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trait_forg_b4 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) trait_forg_b5 = models.StringField( widget = widgets.RadioSelectHorizontal, choices = ['1. Strongly Disagree', '2. Disagree', '3. Neither Agree Nor Disagree', '4. Agree', '5. Strongly Agree'] ) id_num = models.StringField() #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 = ['id_num', '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', 'trait_forg_b1', 'trait_forg_b2', 'trait_forg_b3', 'trait_forg_b4', 'trait_forg_b5'] def is_displayed(player): return player.round_number in [1] class task_rules(Page): form_model = 'player' form_fields = ['man_task_q1', 'man_task_q3', 'man_task_q4', 'man_task_q5'] def is_displayed(player): return player.round_number in [1] @staticmethod def error_message(player, values): solutions = dict( man_task_q1=False, man_task_q3='Believe', man_task_q4='Avert-Risk', man_task_q5='Inaccurate' ) error_messages = dict() for field_name in solutions: if values[field_name] != solutions[field_name]: error_messages[field_name] = 'This response is incorrect. Please try again.' return error_messages class process_rules1(Page): form_model = 'player' form_fields = ['man_process_q1', 'man_process_q2', 'man_process_q3', 'man_process_q4', 'man_process_q5'] def is_displayed(player): return player.round_number in [1] @staticmethod def error_message(player, values): solutions = dict( man_process_q1=True, man_process_q2=False, man_process_q3=False, man_process_q4=False, man_process_q5=True ) error_messages = dict() for field_name in solutions: if values[field_name] != solutions[field_name]: error_messages[field_name] = 'This response is incorrect. Please try again.' return error_messages class process_rules2(Page): form_model = 'player' form_fields = ['man_process_q10'] def is_displayed(player): return player.round_number in [1] @staticmethod def error_message(player, values): solutions = dict( man_process_q10=False, ) error_messages = dict() for field_name in solutions: if values[field_name] != solutions[field_name]: error_messages[field_name] = 'This response is incorrect. Please try again.' return error_messages class process_rules3(Page): form_model = 'player' form_fields = ['man_process_q6', 'man_process_q7', 'man_process_q8', 'man_process_q9'] def is_displayed(player): return player.round_number in [1] @staticmethod def error_message(player, values): solutions = dict( man_process_q6=True, man_process_q7=False, man_process_q8=True, man_process_q9=True ) error_messages = dict() for field_name in solutions: if values[field_name] != solutions[field_name]: error_messages[field_name] = 'This response is incorrect. Please try again.' return error_messages 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', 'trust1Question3' ,'trust1Question4', 'integrity1Question1', 'integrity1Question2', 'integrity1Question6'] 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 = ['trust3Question1', 'trust3Question3' ,'trust3Question4', 'integrity3Question1', 'integrity3Question2', 'integrity3Question6', 'believe3Question1', 'believe3Question2', 'believe3Question3'] def is_displayed(player): return player.round_number in [6] class survey_4(Page): form_model = 'player' form_fields = ['trust4Question1', 'trust4Question3' ,'trust4Question4', 'integrity4Question1', 'integrity4Question2', 'integrity4Question6', 'future4Question1', 'future4Question2'] 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] class verification_wait(WaitPage): form_model = 'group' sec100 = random.randint(3,4) timeout_seconds = sec100 def after_all_players_arrive(group): players = group.get_players() for p in players: if p.verification_choice == 'Info. correct mostly but NOT every time (cost 2pts)': group.reveal = 'Red Player sent an ACCURATE message' p.payoff -= 2 p.verify_cost = 2 elif p.verification_choice == 'Info. correct every time (cost 6pts)': group.reveal = '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 in [6] 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 want to share any points with the Blue Player.' elif group.round_number in [10]: group.disclosure = 'I do not want to share any points with the Blue Player.' elif group.round_number in [15]: group.disclosure = 'I do not want to share any points with the Blue Player.' 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 2pts)' and group.round_number in [5,15]: group.end_reveal = "The Red Player only sent ACCURATE messages in this block" elif p.end_verification_choice == 'Yes (cost 2pts)' and group.round_number in [10]: group.end_reveal = "The Red Player sent at least one INACCURATE message in this block" p.payoff += 12 else: pass for p in players: if p.end_verification_choice == 'Yes (cost 2pts)': 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 2pts)' class end_verification(Page): def is_displayed(player): return player.round_number in [5,10,15] and player.end_verification_choice == 'Yes (cost 2pts)' 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] and player.replace_option == 'Replace (cost 8pts)' 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 8pts)': group.replace_defense = 'If you continue the relationship with me, I ask the researcher to automatically transfer 4 points in the next golden opportunity window for each inaccurate message I send you in the next block. It will provide you 12 points for each inaccurate message I send, so you would not lose anything.' else: group.replace_defense = 'abc' p.replace_option2 = 'Do not Replace' p.control_option = 'Yes, I still want to continue with my partner Red Player' def is_displayed(player): return player.round_number in [5,10] class replace_defense(Page): form_model = 'player' def is_displayed(player): return player.round_number in [5,10] and player.replace_option == 'Replace (cost 8pts)' class control_choice(Page): form_model = 'player' form_fields = ['control_option'] def is_displayed(player): return player.round_number in [15] and player.replace_option == 'Do not Replace' and player.in_round(10).replace_option == 'Replace (cost 8pts)' and player.in_round(10).replace_option2 == 'Do not Replace' 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 8pts)': 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] and player.replace_option2 == 'Replace (cost 8pts)' class message_no_replace(Page): def is_displayed(player): return player.round_number in [5,10] and player.replace_option2 == 'Replace (cost 8pts)' 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] 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(5,7) timeout_seconds = sec2 def is_displayed(player): return player.round_number in [5,10,15] class replacement_wait_time(Page): sec3 = random.randint(15,20) timeout_seconds = sec3 def is_displayed(player): if player.round_number != 15: return player.replace_option2 == 'Replace (cost 8pts)' else: return False class explain_replace_wait_time(Page): sec4 = random.randint(10,15) timeout_seconds = sec4 def is_displayed(player): return player.replace_option == 'Replace (cost 8pts)' 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 = [baseline, task_rules, process_rules1, process_rules2, process_rules3, start_waittime, start_wait_time, receiver, receiver_2, 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, control_choice, survey_4, ResultsWaitPage, Results, final_page ]