from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Part3_Survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): decision1_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision1 = models.IntegerField() decision16 = models.IntegerField() decision16_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision28 = models.IntegerField() decision28_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision29 = models.IntegerField() decision29_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision38 = models.IntegerField() decision38_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision35 = models.IntegerField() decision35_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision1_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision1_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision16_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision16_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision28_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision28_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision29_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision29_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision35_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision35_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision38_hypothetical = models.IntegerField(choices=[[1, '1'], [2, '2']], label='Please select which set of payment schedules you would rather be given to the other players, option 1 or option 2.', widget=widgets.RadioSelect) decision38_hypothetical_explanation = models.LongStringField(label='Please explain your reasoning for making this choice.') decision1_consistent = models.IntegerField() decision16_consistent = models.IntegerField() decision28_consistent = models.IntegerField() decision29_consistent = models.IntegerField() decision35_consistent = models.IntegerField() decision38_consistent = models.IntegerField() class IntroHypothetical(Page): form_model = 'player' @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.decision1=participant.vars['decision1'] player.decision16=participant.vars['decision16'] player.decision28=participant.vars['decision28'] player.decision29=participant.vars['decision29'] player.decision35=participant.vars['decision35'] player.decision38=participant.vars['decision38'] class IntroductionNotDisplayed(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return False @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.decision1=participant.vars['decision1'] player.decision16=participant.vars['decision16'] player.decision28=participant.vars['decision28'] player.decision29=participant.vars['decision29'] player.decision35=participant.vars['decision35'] player.decision38=participant.vars['decision38'] class Decision1Hypothetical(Page): form_model = 'player' form_fields = ['decision1_hypothetical', 'decision1_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision1==player.decision1_hypothetical: player.decision1_consistent=1 else: player.decision1_consistent=0 class Decision16Hypothetical(Page): form_model = 'player' form_fields = ['decision16_hypothetical', 'decision16_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision16==player.decision16_hypothetical: player.decision16_consistent=1 else: player.decision16_consistent=0 class Decision28Hypothetical(Page): form_model = 'player' form_fields = ['decision28_hypothetical', 'decision28_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision28==player.decision28_hypothetical: player.decision28_consistent=1 else: player.decision28_consistent=0 class Decision29Hypothetical(Page): form_model = 'player' form_fields = ['decision29_hypothetical', 'decision29_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision29==player.decision29_hypothetical: player.decision29_consistent=1 else: player.decision29_consistent=0 class Decision35Hypothetical(Page): form_model = 'player' form_fields = ['decision35_hypothetical', 'decision35_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision35==player.decision35_hypothetical: player.decision35_consistent=1 else: player.decision35_consistent=0 class Decision38Hypothetical(Page): form_model = 'player' form_fields = ['decision38_hypothetical', 'decision38_hypothetical_explanation'] @staticmethod def is_displayed(player: Player): return True @staticmethod def before_next_page(player: Player, timeout_happened): if player.decision38==player.decision38_hypothetical: player.decision38_consistent=1 else: player.decision38_consistent=0 class Fin(Page): form_model = 'player' page_sequence = [IntroHypothetical, IntroductionNotDisplayed, Decision1Hypothetical, Decision16Hypothetical, Decision28Hypothetical, Decision29Hypothetical, Decision35Hypothetical, Decision38Hypothetical, Fin]