from otree.api import * # This section concerns the HUMAN CONDITION class C(BaseConstants): NAME_IN_URL = 'thesis_eng_alg' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age?', min=13, max=125) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Other', 'Other']], label='What is your gender?', widget=widgets.RadioSelect, ) studylevel = models.StringField( choices=[['1', 'High school degree'], ['2', 'Associate degree'],['3', 'Bachelor\'s degree'], ['5', 'Master\'s degree'], ['8', 'Doctorate'],['0', 'Other']], label='What is your level of education?', widget=widgets.RadioSelect, ) workenv = models.StringField( choices=[['1', 'Literature, languages, art history, etc.'], ['2', 'Psychology, sociology, economics, political science, law, etc.'], ['3', 'Biology, medicine, etc.'], ['4', 'Physics, chemistry, etc.'], ['5', 'Computer science, civil engineering, mathematics, electronics, etc.'], ['0', 'Other']], label='In which field do you work/study?', widget=widgets.RadioSelect, ) trustalgo = models.StringField( choices=[['1', '1 - No trust at all'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Extreme trust']], label='In general, how confident are you about recommendation algorithms?', widget=widgets.RadioSelect ) # Work assignment Task wa_fairness = models.StringField( choices=[['1', '1 - Very unfair'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Very fair']], label='How fair or unfair is it for Chris that the algorithm assigns him to the maintenance work?', widget=widgets.RadioSelect, ) wa_trust = models.StringField( choices=[['1', '1 - No trust at all'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Extreme trust']], label='How much do you trust that the algorithm makes good-quality work assignment?', widget=widgets.RadioSelect, ) wa_happy = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Happy?', widget=widgets.RadioSelect, ) wa_joyful = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Joyful?', widget=widgets.RadioSelect, ) wa_proud = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Proud?', widget=widgets.RadioSelect, ) wa_disappointed = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Disappointed?', widget=widgets.RadioSelect, ) wa_angry = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Angry?', widget=widgets.RadioSelect, ) wa_frustrated = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Frustrated?', widget=widgets.RadioSelect, ) # Work scheduling task ws_fairness = models.StringField( choices=[['1', '1 - Very unfair'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Very fair']], label='How fair or unfair is it for Riley that the algorithm takes this work scheduling decision?', widget=widgets.RadioSelect, ) ws_trust = models.StringField( choices=[['1', '1 - No trust at all'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Extreme trust']], label='How much do you trust that the algorithm makes good-quality work scheduling?', widget=widgets.RadioSelect, ) ws_happy = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Happy?', widget=widgets.RadioSelect, ) ws_joyful = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Joyful?', widget=widgets.RadioSelect, ) ws_proud = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Proud?', widget=widgets.RadioSelect, ) ws_disappointed = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Disappointed?', widget=widgets.RadioSelect, ) ws_angry = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Angry?', widget=widgets.RadioSelect, ) ws_frustrated = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Frustrated?', widget=widgets.RadioSelect, ) # Hiring task hi_fairness = models.StringField( choices=[['1', '1 - Very unfair'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Very fair']], label='How fair or unfair is it for Alex that the algorithm reviews his application?', widget=widgets.RadioSelect, ) hi_trust = models.StringField( choices=[['1', '1 - No trust at all'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Extreme trust']], label='How much do you trust that the algorithm makes good-quality hiring?', widget=widgets.RadioSelect, ) hi_happy = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Happy?', widget=widgets.RadioSelect, ) hi_joyful = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Joyful?', widget=widgets.RadioSelect, ) hi_proud = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Proud?', widget=widgets.RadioSelect, ) hi_disappointed = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Disappointed?', widget=widgets.RadioSelect, ) hi_angry = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Angry?', widget=widgets.RadioSelect, ) hi_frustrated = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Frustrated?', widget=widgets.RadioSelect, ) # Evaluation task ev_fairness = models.StringField( choices=[['1', '1 - Very unfair'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Very fair']], label='How fair or unfair is it for Jayln that the algorithm evaluates his performance?', widget=widgets.RadioSelect, ) ev_trust = models.StringField( choices=[['1', '1 - No trust at all'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Extreme trust']], label='How much do you trust that the algorithm makes good-quality work evaluation?', widget=widgets.RadioSelect, ) ev_happy = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Happy?', widget=widgets.RadioSelect, ) ev_joyful = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Joyful?', widget=widgets.RadioSelect, ) ev_proud = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Proud?', widget=widgets.RadioSelect, ) ev_disappointed = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Disappointed?', widget=widgets.RadioSelect, ) ev_angry = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Angry?', widget=widgets.RadioSelect, ) ev_frustrated = models.StringField( choices=[['1', '1 - Strongly disagree'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7 - Strongly agree']], label='Frustrated?', widget=widgets.RadioSelect, ) attention_check = models.StringField( choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7']], label='Attention Check', widget=widgets.RadioSelect, ) # FUNCTIONS # PAGES class Demographics(Page): form_model = 'player' form_fields = ['trustalgo','age', 'gender','studylevel','workenv'] class Work_assignment_tf(Page): form_model = 'player' form_fields = ['wa_fairness', 'wa_trust'] class Work_assignment_emo(Page): form_model = 'player' form_fields = ['wa_happy', 'wa_joyful', 'wa_proud', 'wa_disappointed', 'wa_angry', 'wa_frustrated'] class Work_scheduling_tf(Page): form_model = 'player' form_fields = ['ws_fairness','ws_trust'] class Work_scheduling_emo(Page): form_model = 'player' form_fields = ['ws_happy','ws_joyful','ws_proud','ws_disappointed','ws_angry','ws_frustrated'] class Hiring_tf(Page): form_model = 'player' form_fields = ['hi_fairness','hi_trust'] class Hiring_emo(Page): form_model = 'player' form_fields = ['hi_happy','hi_joyful','hi_proud','hi_disappointed','hi_angry','hi_frustrated'] class Eva_tf(Page): form_model = 'player' form_fields = ['ev_fairness','ev_trust'] class Eva_emo(Page): form_model = 'player' form_fields = ['ev_happy','ev_joyful','ev_proud','ev_disappointed','ev_angry','ev_frustrated'] class First_scenario(Page): form_model='player' class Second_scenario(Page): form_model='player' class Third_scenario(Page): form_model='player' class Fourth_scenario(Page): form_model='player' class PresentationPage(Page): form_model = 'player' class AlgorithmPage(Page): form_model = 'player' class Attention_check(Page): form_model = 'player' form_fields = ['attention_check'] class ThankYou(Page): form_model='player' page_sequence = [PresentationPage, AlgorithmPage, First_scenario, Work_assignment_tf,Work_assignment_emo, Second_scenario, Work_scheduling_tf,Work_scheduling_emo, Attention_check, Third_scenario, Hiring_tf,Hiring_emo, Fourth_scenario, Eva_tf,Eva_emo, Demographics, ThankYou]