from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'instructions' PLAYERS_PER_GROUP = 1 # used to be "None" NUM_ROUNDS = 1 Barg1_w_INSTRUCTIONS = 'I01_Barg1_w.html', Barg1_w_SUMMARY = 'S01_Barg1_w.html', Barg1_w_MAIN = 'Imagine you accepted an offer of 76 objects. Your outside option is 86 objects.' Barg1_w_Q01_LABEL = 'How many ECU do you earn in this round?' Barg1_w_Q02_LABEL = 'How many ECU does your opponent earn in this round?' Barg1_w_Q03_LABEL = 'How many ECU would you have earned if you rejected the offer and stopped negotiations?' Barg1_w_Q04_LABEL = 'How many ECU would your opponent have earned if you rejected the offer and stopped negotiations?' Barg1_w_Q01_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_w_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_w_Q03_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_w_Q04_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_w_CORRECT = [3, 2, 4, 5] Barg1_s_INSTRUCTIONS = 'I02_Barg1_s.html', Barg1_s_SUMMARY = 'S02_Barg1_s.html', Barg1_s_MAIN = 'Imagine you accepted an offer of 76 points. Your outside option is 86 points.' Barg1_s_Q01_LABEL = 'How many ECU do you earn in this round?' Barg1_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' Barg1_s_Q03_LABEL = 'How many ECU would you have earned if you rejected the offer and then clicked ‘Abandon negotiations’?' Barg1_s_Q04_LABEL = 'How many ECU would your opponent have earned if you rejected the offer and then clicked ‘Abandon negotiations’?' Barg1_s_Q01_CHOICES = ['0', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_s_Q02_CHOICES = ['0', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_s_Q03_CHOICES = ['0', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_s_Q04_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg1_s_CORRECT = [3, 2, 4, 5] Barg2_w_INSTRUCTIONS = 'I03_Barg2_w.html', Barg2_w_SUMMARY = 'S03_Barg2_w.html', Barg2_w_MAIN = 'Imagine you accepted an offer of 76 objects A and 20 object B. Your outside option is 86 objects and your multiplier is 1. Imagine multiplier of opponent is also 1.' Barg2_w_Q01_LABEL = 'How many ECU you will earn in this round?' Barg2_w_Q02_LABEL = 'How many ECU your opponent will earn in this round?' Barg2_w_Q03_LABEL = 'How many ECU would you have earned if you rejected the offer and stopped negotiations?' Barg2_w_Q04_LABEL = 'How many ECU would your opponent have earned if you rejected the offer and stopped negotiations?' Barg2_w_Q01_CHOICES = ['14', '104', '96', '86', 'Outside option of opponent which is unknown to me'] Barg2_w_Q02_CHOICES = ['14', '104', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_w_Q03_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_w_Q04_CHOICES = ['14', '34', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_w_CORRECT = [3, 2, 4, 5] Barg2_s_INSTRUCTIONS = 'I04_Barg2_s.html', Barg2_s_SUMMARY = 'S04_Barg2_s.html', Barg2_s_MAIN = 'Imagine you accepted an offer of 76 objects A and 20 object B. Your outside option is 86 objects and your multiplier is 1. Imagine multiplier of opponent is also 1.' Barg2_s_Q01_LABEL = 'How many ECU you will earn in this round?' Barg2_s_Q02_LABEL = 'How many ECU your opponent will earn in this round?' Barg2_s_Q03_LABEL = 'How many ECU would you have earned if you rejected the offer and stopped negotiations?' Barg2_s_Q04_LABEL = 'How many ECU would your opponent have earned if you rejected the offer and stopped negotiations?' Barg2_s_Q01_CHOICES = ['0', '104 or 0, depending on opponent’s outside option', '96', '86', 'Outside option of opponent which is unknown to me'] Barg2_s_Q02_CHOICES = ['0', '104 or 0, depending on opponent’s outside option', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_s_Q03_CHOICES = ['0', '24', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_s_Q04_CHOICES = ['0', '34', '76', '86', 'Outside option of opponent which is unknown to me'] Barg2_s_CORRECT = [1, 2, 4, 5] ODR1_w_INSTRUCTIONS = 'I05_ODR1_w.html', ODR1_w_SUMMARY = 'S05_ODR1_w.html', ODR1_w_MAIN = 'Your outside option is 51 points. You submitted to mechanism 62. Your opponent submitted to mechanism 40.' ODR1_w_Q01_LABEL = 'How many ECU do you earn in this round?' ODR1_w_Q02_LABEL = 'How many ECU does your opponent earn in this round?' ODR1_w_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism?' ODR1_w_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism?' ODR1_w_Q01_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] ODR1_w_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] ODR1_w_Q03_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] ODR1_w_Q04_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] ODR1_w_CORRECT = [3, 5, 2, 1] ODR1_s_INSTRUCTIONS = 'I06_ODR1_s.html', ODR1_s_SUMMARY = 'S06_ODR1_s.html', ODR1_s_MAIN = 'Your outside option is 51 points. You submitted to mechanism 62. Your opponent submitted to mechanism 40.' ODR1_s_Q01_LABEL = 'How many ECU do you earn in this round?' ODR1_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' ODR1_s_Q03_LABEL = 'How many ECU would you have earned if you had submitted 52 to the mechanism? Assume that your opponent kept their submission at 40 and that both players accepted the recommendation.' ODR1_s_Q04_LABEL = 'How many ECU would your opponent have earned if you had submitted 52 to the mechanism? Assume that your opponent kept their submission at 40 and that both players accepted the recommendation.' ODR1_s_Q01_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] ODR1_s_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] ODR1_s_Q03_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] ODR1_s_Q04_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] ODR1_s_CORRECT = [3, 5, 2, 1] OpaODR1_s_INSTRUCTIONS = 'I15_OpaODR1_s.html', OpaODR1_s_SUMMARY = 'S15_OpaODR1_s.html', OpaODR1_s_MAIN = 'Your outside option is 51 points. You submitted 52 to the mechanism. Your opponent submitted 40. The mechanism recommends that you receive 56 points.' OpaODR1_s_Q01_LABEL = 'If both players accept this recommendation, how many ECU do you earn in this round?' OpaODR1_s_Q02_LABEL = 'If both players accept this recommendation, how many ECU does your opponent earn in this round?' OpaODR1_s_Q03_LABEL = 'How many ECU would you earn if you reject the recommendation?' OpaODR1_s_Q04_LABEL = 'How many ECU would your opponent earn if you reject the recommendation?' OpaODR1_s_Q01_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] OpaODR1_s_Q02_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] OpaODR1_s_Q03_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] OpaODR1_s_Q04_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] OpaODR1_s_CORRECT = [2, 1, 3, 5] ODR2_w_INSTRUCTIONS = 'I07_ODR2_w.html', ODR2_w_SUMMARY = 'S07_ODR2_w.html', ODR2_w_MAIN = 'Your outside option for object A is 51 objects. You submitted to mechanism 62. Your opponent submitted to mechanism 40. Your multiplier for objects B is 1. The multiplier for objects B of your opponent is 1.' ODR2_w_Q01_LABEL = 'How many ECU do you earn in this round?' ODR2_w_Q02_LABEL = 'How many ECU does your opponent earn in this round?' ODR2_w_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism?' ODR2_w_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism?' ODR2_w_Q01_CHOICES = ['56', '100', '51', '62', 'Outside option of opponent which is unknown to me'] ODR2_w_Q02_CHOICES = ['56', '100', '76', '86', 'Outside option of opponent which is unknown to me'] ODR2_w_Q03_CHOICES = ['40', '100', '51', '62', 'Outside option of opponent which is unknown to me'] ODR2_w_Q04_CHOICES = ['40', '100', '76', '86', 'Outside option of opponent which is unknown to me'] ODR2_w_CORRECT = [3, 5, 2, 2] ODR2_s_INSTRUCTIONS = 'I08_ODR2_s.html', ODR2_s_SUMMARY = 'S08_ODR2_s.html', ODR2_s_MAIN = 'Your outside option for object A is 51 objects. You submitted to mechanism 62. Your opponent submitted to mechanism 40. Your multiplier for objects B is 1. The multiplier for objects B of your opponent is 1.' ODR2_s_Q01_LABEL = 'How many ECU do you earn in this round?' ODR2_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' ODR2_s_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism?' ODR2_s_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism' ODR2_s_Q01_CHOICES = ['0', '100', '51', '62', 'Outside option of opponent which is unknown to me'] ODR2_s_Q02_CHOICES = ['0', '100', '76', '86', 'Outside option of opponent which is unknown to me'] ODR2_s_Q03_CHOICES = ['0', '100', '51', '62', 'Outside option of opponent which is unknown to me'] ODR2_s_Q04_CHOICES = ['0', '100', '76', '86', 'Outside option of opponent which is unknown to me'] ODR2_s_CORRECT = [3, 5, 2, 2] SeqODR1_w_INSTRUCTIONS = 'I09_SeqODR1_w.html', SeqODR1_w_SUMMARY = 'S09_SeqODR1_w.html', SeqODR1_w_MAIN = 'Your outside option is 51 objects. You submitted to mechanism 62. Your opponent submitted to mechanism 40. Mechanism suggested to revise the submissions, but you and your opponent submitted the same bids.' SeqODR1_w_Q01_LABEL = 'How many ECU do you earn in this round?' SeqODR1_w_Q02_LABEL = 'How many ECU does your opponent earn in this round?' SeqODR1_w_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism? Assume that your opponent does not change her submission and accepted the mechanism\'s allocation.' SeqODR1_w_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism? Assume that your opponent does not change her submission and accepted the mechanism\'s allocation.' SeqODR1_w_Q01_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR1_w_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR1_w_Q03_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR1_w_Q04_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR1_w_CORRECT = [3, 5, 2, 1] SeqODR1_s_INSTRUCTIONS = 'I10_SeqODR1_s.html', SeqODR1_s_SUMMARY = 'S10_SeqODR1_s.html', SeqODR1_s_MAIN = 'Your outside option is 51 points. You submitted 62 to the mechanism. Your opponent submitted 40. The mechanism asked both players to revise their submissions, but both of you submitted the same numbers again.' SeqODR1_s_Q01_LABEL = 'How many ECU do you earn in this round?' SeqODR1_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' SeqODR1_s_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism? Assume that your opponent does not change their submission and accepts the recommendation.' SeqODR1_s_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism? Assume that your opponent does not change their submission and accepts the recommendation.' SeqODR1_s_Q01_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR1_s_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR1_s_Q03_CHOICES = ['40', '56', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR1_s_Q04_CHOICES = ['44', '34', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR1_s_CORRECT = [3, 5, 2, 1] SeqODR2_w_INSTRUCTIONS = 'I11_SeqODR2_w.html', SeqODR2_w_SUMMARY = 'S11_SeqODR2_w.html', SeqODR2_w_MAIN = 'Your outside option for object A is 51 objects. You submitted to mechanism 62. Your opponent submitted to mechanism 40. Your multiplier for objects B is 1. The multiplier for objects B of your opponent is 1. Mechanism suggested to revise the submissions, but you and your opponent submitted the same bids.' SeqODR2_w_Q01_LABEL = 'How many ECU do you earn in this round?' SeqODR2_w_Q02_LABEL = 'How many ECU does your opponent earn in this round?' SeqODR2_w_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism?' SeqODR2_w_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism?' SeqODR2_w_Q01_CHOICES = ['56', '100', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR2_w_Q02_CHOICES = ['56', '100', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR2_w_Q03_CHOICES = ['40', '100', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR2_w_Q04_CHOICES = ['40', '100', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR2_w_CORRECT = [3, 5, 2, 2] SeqODR2_s_INSTRUCTIONS = 'I12_SeqODR2_s.html', SeqODR2_s_SUMMARY = 'S12_SeqODR2_s.html', SeqODR2_s_MAIN = 'Your outside option for object A is 51 objects. You submitted to mechanism 62. Your opponent submitted to mechanism 40. Your multiplier for objects B is 1. The multiplier for objects B of your opponent is 1. Mechanism suggested to revise the submissions, but you and your opponent submitted the same bids.' SeqODR2_s_Q01_LABEL = 'How many ECU do you earn in this round?' SeqODR2_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' SeqODR2_s_Q03_LABEL = 'How many ECU would you have earned if you submitted 52 to the mechanism?' SeqODR2_s_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 52 to the mechanism?' SeqODR2_s_Q01_CHOICES = ['56', '100', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR2_s_Q02_CHOICES = ['56', '100', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR2_s_Q03_CHOICES = ['40', '100', '51', '62', 'Outside option of opponent which is unknown to me'] SeqODR2_s_Q04_CHOICES = ['40', '100', '76', '86', 'Outside option of opponent which is unknown to me'] SeqODR2_s_CORRECT = [3, 5, 2, 2] AIODR1_s_INSTRUCTIONS = 'I13_AIODR1_s.html', AIODR1_s_SUMMARY = 'S13_AIODR1_s.html', AIODR1_s_MAIN = 'Your outside option is 31 points. You submitted 62 to the mechanism. Your opponent submitted 60. No alternative suggestion was made, so bargaining broke down.' AIODR1_s_Q01_LABEL = 'How many ECU do you earn in this round?' AIODR1_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' AIODR1_s_Q03_LABEL = 'How many ECU would you have earned if you submitted 36 to the mechanism? Assume that your opponent does not change their submission and accepts the recommendation.' AIODR1_s_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 36 to the mechanism? Assume that your opponent does not change their submission and accepts the recommendation.' AIODR1_s_Q01_CHOICES = ['40', '62', '31', '56', 'Outside option of opponent which is unknown to me'] AIODR1_s_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] AIODR1_s_Q03_CHOICES = ['36', '38', '51', '62', 'Outside option of opponent which is unknown to me'] AIODR1_s_Q04_CHOICES = ['44', '34', '62', '86', 'Outside option of opponent which is unknown to me'] AIODR1_s_CORRECT = [3, 5, 2, 3] AIODRsoph1_s_INSTRUCTIONS = 'I14_AIODRsoph1_s.html', AIODRsoph1_s_SUMMARY = 'S14_AIODRsoph1_s.html', AIODRsoph1_s_MAIN = 'Your outside option is 31 points. You submitted to mechanism 52. Your opponent submitted to mechanism 60. Mechanism suggested bargaining failure.' AIODRsoph1_s_Q01_LABEL = 'How many ECU do you earn in this round?' AIODRsoph1_s_Q02_LABEL = 'How many ECU does your opponent earn in this round?' AIODRsoph1_s_Q03_LABEL = 'How many ECU would you have earned if you submitted 36 to the mechanism? Assume that your opponent does not change her submission and accepted the mechanism\'s allocation.' AIODRsoph1_s_Q04_LABEL = 'How many ECU would your opponent have earned if you submitted 36 to the mechanism? Assume that your opponent does not change her submission and accepted the mechanism\'s allocation.' AIODRsoph1_s_Q01_CHOICES = ['40', '62', '31', '56', 'Outside option of opponent which is unknown to me'] AIODRsoph1_s_Q02_CHOICES = ['14', '24', '76', '86', 'Outside option of opponent which is unknown to me'] AIODRsoph1_s_Q03_CHOICES = ['36', '38', '51', '62', 'Outside option of opponent which is unknown to me'] AIODRsoph1_s_Q04_CHOICES = ['44', '34', '62', '86', 'Outside option of opponent which is unknown to me'] AIODRsoph1_s_CORRECT = [3, 5, 2, 3] class Subsession(BaseSubsession): treatment_name = models.StringField(initial="") treatment_rep = models.IntegerField(initial=0) exchange_rate = models.FloatField(initial=0.0) show_up_fee = models.FloatField(initial=0.0) objects_A = models.IntegerField(initial=0) objects_B = models.IntegerField(initial=0) bargaining_breakdown = models.IntegerField(initial=0) outside_option_type = models.StringField(initial="") group_order = models.StringField(initial="") outside_type = models.StringField(initial="") class Group(BaseGroup): pass class Player(BasePlayer): T01_Q01 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T01_Q02 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T01_Q03 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T01_Q04 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T01_correct = models.IntegerField(initial=0) T02_Q01 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T02_Q02 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T02_Q03 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T02_Q04 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T02_correct = models.IntegerField(initial=0) T03_Q01 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T03_Q02 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T03_Q03 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T03_Q04 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T03_correct = models.IntegerField(initial=0) T04_Q01 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T04_Q02 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T04_Q03 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T04_Q04 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T04_correct = models.IntegerField(initial=0) T05_Q01 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T05_Q02 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T05_Q03 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T05_Q04 = models.IntegerField(widget=widgets.RadioSelect, choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='', initial=0) T05_correct = models.IntegerField(initial=0) test_passed = models.IntegerField(initial=0) # PAGES class P00_Instructions(Page): def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) class P01_Quiz1(Page): form_model = 'player' def get_form_fields(player): return ['T01_Q01', 'T01_Q02', 'T01_Q03', 'T01_Q04'] def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) def before_next_page(player, timeout_happened): corrects = get_correct_answers(player) if corrects[0] == player.T01_Q01 and corrects[1] == player.T01_Q02 and corrects[2] == player.T01_Q03 and \ corrects[3] == player.T01_Q04: player.T01_correct = 1 player.test_passed = 1 else: player.T01_correct = 0 class P02_Feedback1(Page): def vars_for_template(player): return get_vars_for_template(player, [player.T01_Q01, player.T01_Q02, player.T01_Q03, player.T01_Q04]) class P03_Quiz2(Page): form_model = 'player' def get_form_fields(player): return ['T02_Q01', 'T02_Q02', 'T02_Q03', 'T02_Q04'] def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) def before_next_page(player, timeout_happened): corrects = get_correct_answers(player) if corrects[0] == player.T02_Q01 and corrects[1] == player.T02_Q02 and corrects[2] == player.T02_Q03 and \ corrects[3] == player.T02_Q04: player.T02_correct = 1 player.test_passed = 1 else: player.T02_correct = 0 def is_displayed(player): return player.test_passed == 0 class P04_Feedback2(Page): def vars_for_template(player): return get_vars_for_template(player, [player.T02_Q01, player.T02_Q02, player.T02_Q03, player.T02_Q04]) def is_displayed(player): return player.test_passed == 0 class P05_Quiz3(Page): form_model = 'player' def get_form_fields(player): return ['T03_Q01', 'T03_Q02', 'T03_Q03', 'T03_Q04'] def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) def before_next_page(player, timeout_happened): corrects = get_correct_answers(player) if corrects[0] == player.T03_Q01 and corrects[1] == player.T03_Q02 and corrects[2] == player.T03_Q03 and \ corrects[3] == player.T03_Q04: player.T03_correct = 1 player.test_passed = 1 else: player.T03_correct = 0 def is_displayed(player): return player.test_passed == 0 class P06_Feedback3(Page): def vars_for_template(player): return get_vars_for_template(player, [player.T03_Q01, player.T03_Q02, player.T03_Q03, player.T03_Q04]) def is_displayed(player): return player.test_passed == 0 class P07_Quiz4(Page): form_model = 'player' def get_form_fields(player): return ['T04_Q01', 'T04_Q02', 'T04_Q03', 'T04_Q04'] def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) def before_next_page(player, timeout_happened): corrects = get_correct_answers(player) if corrects[0] == player.T04_Q01 and corrects[1] == player.T04_Q02 and corrects[2] == player.T04_Q03 and \ corrects[3] == player.T04_Q04: player.T04_correct = 1 player.test_passed = 1 else: player.T04_correct = 0 def is_displayed(player): return player.test_passed == 0 class P08_Feedback4(Page): def vars_for_template(player): return get_vars_for_template(player, [player.T04_Q01, player.T04_Q02, player.T04_Q03, player.T04_Q04]) def is_displayed(player): return player.test_passed == 0 class P09_Quiz5(Page): form_model = 'player' def get_form_fields(player): return ['T05_Q01', 'T05_Q02', 'T05_Q03', 'T05_Q04'] def vars_for_template(player): return get_vars_for_template(player, [0, 0, 0, 0]) def before_next_page(player, timeout_happened): corrects = get_correct_answers(player) if corrects[0] == player.T05_Q01 and corrects[1] == player.T05_Q02 and corrects[2] == player.T05_Q03 and \ corrects[3] == player.T05_Q04: player.T05_correct = 1 player.test_passed = 1 else: player.T05_correct = 0 def is_displayed(player): return player.test_passed == 0 class P10_Feedback5(Page): def vars_for_template(player): return get_vars_for_template(player, [player.T05_Q01, player.T05_Q02, player.T05_Q03, player.T05_Q04]) def is_displayed(player): return player.test_passed == 0 class P11_Finished(Page): def is_displayed(player): return player.test_passed == 0 page_sequence = [ P00_Instructions, P01_Quiz1, P02_Feedback1, P03_Quiz2, P04_Feedback2, P05_Quiz3, P06_Feedback3, P07_Quiz4, P08_Feedback4, P09_Quiz5, P10_Feedback5, P11_Finished, ] # Functions def creating_session(subsession): set_treatment_vars(subsession) def set_treatment_vars(subsession): subsession.treatment_name = subsession.session.config['treatment_name'] subsession.treatment_rep = subsession.session.config['treatment_rep'] subsession.exchange_rate = subsession.session.config['exchange_rate'] subsession.show_up_fee = subsession.session.config['show_up_fee'] subsession.objects_A = subsession.session.config['objects_A'] subsession.objects_B = subsession.session.config['objects_B'] subsession.group_order = subsession.session.config['group_order'] subsession.outside_type = subsession.session.config['outside_type'] def get_correct_answers(player): treatment_name = player.subsession.treatment_name outside_type = player.subsession.outside_type if outside_type == "Weak": if treatment_name == "Barg1": return C.Barg1_w_CORRECT if treatment_name == "Barg2": return C.Barg2_w_CORRECT if treatment_name == "ODR1": return C.ODR1_w_CORRECT if treatment_name == "ODR2": return C.ODR2_w_CORRECT if treatment_name == "SeqODR1": return C.SeqODR1_w_CORRECT if treatment_name == "SeqODR2": return C.SeqODR2_w_CORRECT if outside_type == "Strong": if treatment_name == "Barg1": return C.Barg1_s_CORRECT if treatment_name == "Barg2": return C.Barg2_s_CORRECT if treatment_name == "ODR1": return C.ODR1_s_CORRECT if treatment_name == "OpaODR1": return C.OpaODR1_s_CORRECT if treatment_name == "ODR2": return C.ODR2_s_CORRECT if treatment_name == "SeqODR1": return C.SeqODR1_s_CORRECT if treatment_name == "SeqODR2": return C.SeqODR2_s_CORRECT if treatment_name == "AIODR1": return C.AIODR1_s_CORRECT if treatment_name == "AIODRsoph1": return C.AIODRsoph1_s_CORRECT def get_vars_for_template(player, answers): treatment_name = player.subsession.treatment_name outside_type = player.subsession.outside_type if outside_type == "Weak": if treatment_name == "Barg1": return dict( instructions=C.Barg1_w_INSTRUCTIONS, summary=C.Barg1_w_SUMMARY, main=C.Barg1_w_MAIN, label_Q01=C.Barg1_w_Q01_LABEL, label_Q02=C.Barg1_w_Q02_LABEL, label_Q03=C.Barg1_w_Q03_LABEL, label_Q04=C.Barg1_w_Q04_LABEL, choices_Q01=C.Barg1_w_Q01_CHOICES, choices_Q02=C.Barg1_w_Q02_CHOICES, choices_Q03=C.Barg1_w_Q03_CHOICES, choices_Q04=C.Barg1_w_Q04_CHOICES, correct_Q01=C.Barg1_w_CORRECT[0] == answers[0], correct_Q02=C.Barg1_w_CORRECT[1] == answers[1], correct_Q03=C.Barg1_w_CORRECT[2] == answers[2], correct_Q04=C.Barg1_w_CORRECT[3] == answers[3], ) if treatment_name == "Barg2": return dict( instructions=C.Barg2_w_INSTRUCTIONS, summary=C.Barg2_w_SUMMARY, main=C.Barg2_w_MAIN, label_Q01=C.Barg2_w_Q01_LABEL, label_Q02=C.Barg2_w_Q02_LABEL, label_Q03=C.Barg2_w_Q03_LABEL, label_Q04=C.Barg2_w_Q04_LABEL, choices_Q01=C.Barg2_w_Q01_CHOICES, choices_Q02=C.Barg2_w_Q02_CHOICES, choices_Q03=C.Barg2_w_Q03_CHOICES, choices_Q04=C.Barg2_w_Q04_CHOICES, correct_Q01=C.Barg2_w_CORRECT[0] == answers[0], correct_Q02=C.Barg2_w_CORRECT[1] == answers[1], correct_Q03=C.Barg2_w_CORRECT[2] == answers[2], correct_Q04=C.Barg2_w_CORRECT[3] == answers[3], ) if treatment_name == "ODR1": return dict( instructions=C.ODR1_w_INSTRUCTIONS, summary=C.ODR1_w_SUMMARY, main=C.ODR1_w_MAIN, label_Q01=C.ODR1_w_Q01_LABEL, label_Q02=C.ODR1_w_Q02_LABEL, label_Q03=C.ODR1_w_Q03_LABEL, label_Q04=C.ODR1_w_Q04_LABEL, choices_Q01=C.ODR1_w_Q01_CHOICES, choices_Q02=C.ODR1_w_Q02_CHOICES, choices_Q03=C.ODR1_w_Q03_CHOICES, choices_Q04=C.ODR1_w_Q04_CHOICES, correct_Q01=C.ODR1_w_CORRECT[0] == answers[0], correct_Q02=C.ODR1_w_CORRECT[1] == answers[1], correct_Q03=C.ODR1_w_CORRECT[2] == answers[2], correct_Q04=C.ODR1_w_CORRECT[3] == answers[3], ) if treatment_name == "ODR2": return dict( instructions=C.ODR2_w_INSTRUCTIONS, summary=C.ODR2_w_SUMMARY, main=C.ODR2_w_MAIN, label_Q01=C.ODR2_w_Q01_LABEL, label_Q02=C.ODR2_w_Q02_LABEL, label_Q03=C.ODR2_w_Q03_LABEL, label_Q04=C.ODR2_w_Q04_LABEL, choices_Q01=C.ODR2_w_Q01_CHOICES, choices_Q02=C.ODR2_w_Q02_CHOICES, choices_Q03=C.ODR2_w_Q03_CHOICES, choices_Q04=C.ODR2_w_Q04_CHOICES, correct_Q01=C.ODR2_w_CORRECT[0] == answers[0], correct_Q02=C.ODR2_w_CORRECT[1] == answers[1], correct_Q03=C.ODR2_w_CORRECT[2] == answers[2], correct_Q04=C.ODR2_w_CORRECT[3] == answers[3], ) if treatment_name == "SeqODR1": return dict( instructions=C.SeqODR1_w_INSTRUCTIONS, summary=C.SeqODR1_w_SUMMARY, main=C.SeqODR1_w_MAIN, label_Q01=C.SeqODR1_w_Q01_LABEL, label_Q02=C.SeqODR1_w_Q02_LABEL, label_Q03=C.SeqODR1_w_Q03_LABEL, label_Q04=C.SeqODR1_w_Q04_LABEL, choices_Q01=C.SeqODR1_w_Q01_CHOICES, choices_Q02=C.SeqODR1_w_Q02_CHOICES, choices_Q03=C.SeqODR1_w_Q03_CHOICES, choices_Q04=C.SeqODR1_w_Q04_CHOICES, correct_Q01=C.SeqODR1_w_CORRECT[0] == answers[0], correct_Q02=C.SeqODR1_w_CORRECT[1] == answers[1], correct_Q03=C.SeqODR1_w_CORRECT[2] == answers[2], correct_Q04=C.SeqODR1_w_CORRECT[3] == answers[3], ) if treatment_name == "SeqODR2": return dict( instructions=C.SeqODR2_w_INSTRUCTIONS, summary=C.SeqODR2_w_SUMMARY, main=C.SeqODR2_w_MAIN, label_Q01=C.SeqODR2_w_Q01_LABEL, label_Q02=C.SeqODR2_w_Q02_LABEL, label_Q03=C.SeqODR2_w_Q03_LABEL, label_Q04=C.SeqODR2_w_Q04_LABEL, choices_Q01=C.SeqODR2_w_Q01_CHOICES, choices_Q02=C.SeqODR2_w_Q02_CHOICES, choices_Q03=C.SeqODR2_w_Q03_CHOICES, choices_Q04=C.SeqODR2_w_Q04_CHOICES, correct_Q01=C.SeqODR2_w_CORRECT[0] == answers[0], correct_Q02=C.SeqODR2_w_CORRECT[1] == answers[1], correct_Q03=C.SeqODR2_w_CORRECT[2] == answers[2], correct_Q04=C.SeqODR2_w_CORRECT[3] == answers[3], ) if outside_type == "Strong": if treatment_name == "Barg1": return dict( instructions=C.Barg1_s_INSTRUCTIONS, summary=C.Barg1_s_SUMMARY, main=C.Barg1_s_MAIN, label_Q01=C.Barg1_s_Q01_LABEL, label_Q02=C.Barg1_s_Q02_LABEL, label_Q03=C.Barg1_s_Q03_LABEL, label_Q04=C.Barg1_s_Q04_LABEL, choices_Q01=C.Barg1_s_Q01_CHOICES, choices_Q02=C.Barg1_s_Q02_CHOICES, choices_Q03=C.Barg1_s_Q03_CHOICES, choices_Q04=C.Barg1_s_Q04_CHOICES, correct_Q01=C.Barg1_s_CORRECT[0] == answers[0], correct_Q02=C.Barg1_s_CORRECT[1] == answers[1], correct_Q03=C.Barg1_s_CORRECT[2] == answers[2], correct_Q04=C.Barg1_s_CORRECT[3] == answers[3], ) if treatment_name == "Barg2": return dict( instructions=C.Barg2_s_INSTRUCTIONS, summary=C.Barg2_s_SUMMARY, main=C.Barg2_s_MAIN, label_Q01=C.Barg2_s_Q01_LABEL, label_Q02=C.Barg2_s_Q02_LABEL, label_Q03=C.Barg2_s_Q03_LABEL, label_Q04=C.Barg2_s_Q04_LABEL, choices_Q01=C.Barg2_s_Q01_CHOICES, choices_Q02=C.Barg2_s_Q02_CHOICES, choices_Q03=C.Barg2_s_Q03_CHOICES, choices_Q04=C.Barg2_s_Q04_CHOICES, correct_Q01=C.Barg2_s_CORRECT[0] == answers[0], correct_Q02=C.Barg2_s_CORRECT[1] == answers[1], correct_Q03=C.Barg2_s_CORRECT[2] == answers[2], correct_Q04=C.Barg2_s_CORRECT[3] == answers[3], ) if treatment_name == "ODR1": return dict( instructions=C.ODR1_s_INSTRUCTIONS, summary=C.ODR1_s_SUMMARY, main=C.ODR1_s_MAIN, label_Q01=C.ODR1_s_Q01_LABEL, label_Q02=C.ODR1_s_Q02_LABEL, label_Q03=C.ODR1_s_Q03_LABEL, label_Q04=C.ODR1_s_Q04_LABEL, choices_Q01=C.ODR1_s_Q01_CHOICES, choices_Q02=C.ODR1_s_Q02_CHOICES, choices_Q03=C.ODR1_s_Q03_CHOICES, choices_Q04=C.ODR1_s_Q04_CHOICES, correct_Q01=C.ODR1_s_CORRECT[0] == answers[0], correct_Q02=C.ODR1_s_CORRECT[1] == answers[1], correct_Q03=C.ODR1_s_CORRECT[2] == answers[2], correct_Q04=C.ODR1_s_CORRECT[3] == answers[3], ) if treatment_name == "OpaODR1": return dict( instructions=C.OpaODR1_s_INSTRUCTIONS, summary=C.OpaODR1_s_SUMMARY, main=C.OpaODR1_s_MAIN, label_Q01=C.OpaODR1_s_Q01_LABEL, label_Q02=C.OpaODR1_s_Q02_LABEL, label_Q03=C.OpaODR1_s_Q03_LABEL, label_Q04=C.OpaODR1_s_Q04_LABEL, choices_Q01=C.OpaODR1_s_Q01_CHOICES, choices_Q02=C.OpaODR1_s_Q02_CHOICES, choices_Q03=C.OpaODR1_s_Q03_CHOICES, choices_Q04=C.OpaODR1_s_Q04_CHOICES, correct_Q01=C.OpaODR1_s_CORRECT[0] == answers[0], correct_Q02=C.OpaODR1_s_CORRECT[1] == answers[1], correct_Q03=C.OpaODR1_s_CORRECT[2] == answers[2], correct_Q04=C.OpaODR1_s_CORRECT[3] == answers[3], ) if treatment_name == "ODR2": return dict( instructions=C.ODR2_s_INSTRUCTIONS, summary=C.ODR2_s_SUMMARY, main=C.ODR2_s_MAIN, label_Q01=C.ODR2_s_Q01_LABEL, label_Q02=C.ODR2_s_Q02_LABEL, label_Q03=C.ODR2_s_Q03_LABEL, label_Q04=C.ODR2_s_Q04_LABEL, choices_Q01=C.ODR2_s_Q01_CHOICES, choices_Q02=C.ODR2_s_Q02_CHOICES, choices_Q03=C.ODR2_s_Q03_CHOICES, choices_Q04=C.ODR2_s_Q04_CHOICES, correct_Q01=C.ODR2_s_CORRECT[0] == answers[0], correct_Q02=C.ODR2_s_CORRECT[1] == answers[1], correct_Q03=C.ODR2_s_CORRECT[2] == answers[2], correct_Q04=C.ODR2_s_CORRECT[3] == answers[3], ) if treatment_name == "SeqODR1": return dict( instructions=C.SeqODR1_s_INSTRUCTIONS, summary=C.SeqODR1_s_SUMMARY, main=C.SeqODR1_s_MAIN, label_Q01=C.SeqODR1_s_Q01_LABEL, label_Q02=C.SeqODR1_s_Q02_LABEL, label_Q03=C.SeqODR1_s_Q03_LABEL, label_Q04=C.SeqODR1_s_Q04_LABEL, choices_Q01=C.SeqODR1_s_Q01_CHOICES, choices_Q02=C.SeqODR1_s_Q02_CHOICES, choices_Q03=C.SeqODR1_s_Q03_CHOICES, choices_Q04=C.SeqODR1_s_Q04_CHOICES, correct_Q01=C.SeqODR1_s_CORRECT[0] == answers[0], correct_Q02=C.SeqODR1_s_CORRECT[1] == answers[1], correct_Q03=C.SeqODR1_s_CORRECT[2] == answers[2], correct_Q04=C.SeqODR1_s_CORRECT[3] == answers[3], ) if treatment_name == "SeqODR2": return dict( instructions=C.SeqODR2_s_INSTRUCTIONS, summary=C.SeqODR2_s_SUMMARY, main=C.SeqODR2_s_MAIN, label_Q01=C.SeqODR2_s_Q01_LABEL, label_Q02=C.SeqODR2_s_Q02_LABEL, label_Q03=C.SeqODR2_s_Q03_LABEL, label_Q04=C.SeqODR2_s_Q04_LABEL, choices_Q01=C.SeqODR2_s_Q01_CHOICES, choices_Q02=C.SeqODR2_s_Q02_CHOICES, choices_Q03=C.SeqODR2_s_Q03_CHOICES, choices_Q04=C.SeqODR2_s_Q04_CHOICES, correct_Q01=C.SeqODR2_s_CORRECT[0] == answers[0], correct_Q02=C.SeqODR2_s_CORRECT[1] == answers[1], correct_Q03=C.SeqODR2_s_CORRECT[2] == answers[2], correct_Q04=C.SeqODR2_s_CORRECT[3] == answers[3], ) if treatment_name == "AIODR1": return dict( instructions=C.AIODR1_s_INSTRUCTIONS, summary=C.AIODR1_s_SUMMARY, main=C.AIODR1_s_MAIN, label_Q01=C.AIODR1_s_Q01_LABEL, label_Q02=C.AIODR1_s_Q02_LABEL, label_Q03=C.AIODR1_s_Q03_LABEL, label_Q04=C.AIODR1_s_Q04_LABEL, choices_Q01=C.AIODR1_s_Q01_CHOICES, choices_Q02=C.AIODR1_s_Q02_CHOICES, choices_Q03=C.AIODR1_s_Q03_CHOICES, choices_Q04=C.AIODR1_s_Q04_CHOICES, correct_Q01=C.AIODR1_s_CORRECT[0] == answers[0], correct_Q02=C.AIODR1_s_CORRECT[1] == answers[1], correct_Q03=C.AIODR1_s_CORRECT[2] == answers[2], correct_Q04=C.AIODR1_s_CORRECT[3] == answers[3], ) if treatment_name == "AIODRsoph1": return dict( instructions=C.AIODRsoph1_s_INSTRUCTIONS, summary=C.AIODRsoph1_s_SUMMARY, main=C.AIODRsoph1_s_MAIN, label_Q01=C.AIODRsoph1_s_Q01_LABEL, label_Q02=C.AIODRsoph1_s_Q02_LABEL, label_Q03=C.AIODRsoph1_s_Q03_LABEL, label_Q04=C.AIODRsoph1_s_Q04_LABEL, choices_Q01=C.AIODRsoph1_s_Q01_CHOICES, choices_Q02=C.AIODRsoph1_s_Q02_CHOICES, choices_Q03=C.AIODRsoph1_s_Q03_CHOICES, choices_Q04=C.AIODRsoph1_s_Q04_CHOICES, correct_Q01=C.AIODRsoph1_s_CORRECT[0] == answers[0], correct_Q02=C.AIODRsoph1_s_CORRECT[1] == answers[1], correct_Q03=C.AIODRsoph1_s_CORRECT[2] == answers[2], correct_Q04=C.AIODRsoph1_s_CORRECT[3] == answers[3], )