from otree.api import * author = 'Marte Abts' doc = """ Post Experimental Questionnaire """ class Constants(BaseConstants): name_in_url = 'a_peq' players_per_group = None num_rounds = 1 progress_template = 'a_peq/progress_bar.html' class Subsession(BaseSubsession): pass def creating_session(subsession: Subsession): for player in subsession.get_players(): player.progress = 1 class Group(BaseGroup): pass class Player(BasePlayer): #define all the variables you want to measure in PEQ total_payoff = models.FloatField() confrontation1 = models.IntegerField( label='I kept in mind that I also needed to communicate the performance rating to Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) confrontation2 = models.IntegerField( label='I felt nervous about the face-to-face meeting.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) confrontation3 = models.IntegerField( label='I worried about communicating the performance rating to Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) confrontation4 = models.IntegerField( label='I do not like being potentially confronted with Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) accountability1 = models.IntegerField( label='I felt that I had to justify my performance rating for Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) accountability2 = models.IntegerField( label='I was expected to consider the actual performance and the self-rating of Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) accountability3 = models.IntegerField( label='I felt that I had to demonstrate that my performance rating was valid.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) reason1 = models.IntegerField( label='was aimed at making a good impression on me.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) reason2 = models.IntegerField( label='was intentionally misguiding.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) reason3 = models.IntegerField( label='was completed with minimal effort.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) reason4 = models.IntegerField( label='was informative about his underlying performance.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) alternative1 = models.IntegerField( label='I was concerned about the compensation and ranking among the top 25% of Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) alternative2 = models.IntegerField( label='I think I can offset a poor rating through my communication with Player B.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) alternative3 = models.IntegerField( label='I think my performance rating for Player B was important.', choices=[[1, 'Totally unimportant'], [2, ''], [3, ''], [4, 'Neutral'], [5, ''],[6,''],[7, 'Extremely important']], widget=widgets.RadioSelectHorizontal ) confident1 = models.IntegerField( label="", choices=[ [1, "Underconfident"], [2, ""], [3, ""], [4, "Accurately confident"], [5, ""], [6, ""], [7, "Overconfident"], ], widget=widgets.RadioSelect, ) accurate1 = models.IntegerField( label="", choices=[ [1, "Accurately reflects performance"], [2, ""], [3, ""], [4, "Equally important"], [5, ""], [6, ""], [7, "Leads to bonus for Player B"], ], widget=widgets.RadioSelect, ) age = models.IntegerField(label="What is your age?", min=18, max=99) experience = models.IntegerField(label="How many years of work experience do you have?", min=0, max=60) occupation = models.IntegerField(label='What is your current occupation?', choices=[[1, 'Management (e.g., director, manager)'], [2, 'Professional (e.g., doctor, lawyer, engineer)'], [3, 'Technical (e.g., technician, IT specialist)'], [4, 'Caring and Personal Service (e.g., nurse, childcare, hairdresser)'],[5, 'Administrative/Clerical'],[6, 'Sales/Customer Service'],[7, 'Skilled Trades (e.g., Electrician, Plumber)'], [8, 'Unskilled Labor (e.g., Cleaner, Warehouse Worker'], [9, 'Education (e.g., Teacher, Professor)'],[10, 'Other']],widget=widgets.RadioSelect) educationlevel = models.IntegerField(label='What is your highest obtained degree?', choices=[[1, 'High School'], [2, 'Bachelor'], [3, 'Master'], [4, 'PhD']], widget=widgets.RadioSelect) gender = models.IntegerField(label='What is your gender?', choices=[[1, 'Male'], [2, 'Female'], [3, 'Non-binary'], [4, 'Prefer not to say']], widget=widgets.RadioSelect) #def payoffs(player: Player): # if (player.participant.vars['treatment'] == 'Flat_Acc' or player.participant.vars['treatment'] == 'Flat_NotAcc' or player.participant.vars['treatment'] == 'Flat_Refl'): # player.total_payoff = 8 # if (player.participant.vars['treatment'] == 'Pfp_Acc' or player.participant.vars['treatment'] == 'Pfp_NotAcc' or player.participant.vars['treatment'] == 'Pfp_Refl'): # player.total_payoff = (6 + player.participant.total_correct * 0.15) # PAGES class Page1PEQ(Page): form_model = 'player' form_fields = ['confrontation1','confrontation2','confrontation3','confrontation4'] def is_displayed(player): return player.round_number == 1 and player.participant.vars['type'] == 'manager' class Page2PEQ(Page): form_model = 'player' form_fields = ['accountability1','accountability2','accountability3'] def is_displayed(player): return player.round_number == 1 and player.participant.vars['type'] == 'manager' class Page3PEQ(Page): form_model = 'player' form_fields = ['reason1','reason2','reason3', 'reason4'] def is_displayed(player): return player.round_number == 1 and player.participant.vars['type'] == 'manager' class Page4PEQ(Page): form_model = 'player' form_fields = ['alternative1','alternative2', 'alternative3'] def is_displayed(player): return player.round_number == 1 and player.participant.vars['type'] == 'manager' class Page5PEQ(Page): form_model = 'player' form_fields = ['confident1','accurate1'] def is_displayed(player): return player.round_number == 1 and player.participant.vars['type'] == 'manager' class Demographics(Page): form_model = 'player' form_fields = ['age','gender','experience','occupation','educationlevel'] page_sequence = [Page1PEQ,Page2PEQ, Page3PEQ, Page4PEQ, Page5PEQ, Demographics]