from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Survey2' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): s2_new = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, '']], label='No matter how much money one makes, life is unsatisfactory without a strong sense of duty and character. ', widget=widgets.RadioSelectHorizontal) s6_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='The true test of character is a willingness to stand by one’s principles, no matter what price one has to pay. ', widget=widgets.RadioSelectHorizontal) s8_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='It is important to me to feel that I have not compromised my principles. ', widget=widgets.RadioSelectHorizontal) s9_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='If one believes something is right, one must stand by it, even if it means losing friends or missing out on profitable opportunities.', widget=widgets.RadioSelectHorizontal) s10_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='Compromising one’s principles is always wrong, regardless of the circumstances or the amount that can be personally gained. ', widget=widgets.RadioSelectHorizontal) s11_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='Universal ethical principles exist and should be applied under all circumstances, with no exceptions.', widget=widgets.RadioSelectHorizontal) s13_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='Integrity is more important than financial gain. ', widget=widgets.RadioSelectHorizontal) s14_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='It is important to fulfill one’s obligations at all times, even when nobody will know if one doesn’t.', widget=widgets.RadioSelectHorizontal) s17_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='One’s principles should not be compromised regardless of the possible gain.', widget=widgets.RadioSelectHorizontal) s18_new = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='Some transgressions are wrong and cannot be legitimately justified or defended regardless of how much one tries. ', widget=widgets.RadioSelectHorizontal) h6_new = models.IntegerField(choices=[[5, 'Never'], [4, 'One or two times'], [3, 'Three to six times'], [2, 'Six to ten times'], [1, 'More than ten time']], label='In your life, how many times have you stolen something?', widget=widgets.RadioSelectHorizontal) h5_new = models.IntegerField(choices=[[5, 'More than once a week'], [4, 'About once a week'], [3, 'About once a month'], [2, 'About once every other month'], [1, 'Once a year or less']], label='How often do you lend personal possessions to your friends (e.g., tools, clothes, bicycle, etc....)?\u2028\u2028', widget=widgets.RadioSelectHorizontal) h4_new = models.IntegerField(choices=[[5, 'More than once a week'], [4, 'About once a week'], [3, 'About once a month'], [2, 'About once every other month'], [1, 'Once a year or less']], label='How often do you lend money to your friends?\u2028\u2028', widget=widgets.RadioSelectHorizontal) h7_new = models.IntegerField(choices=[[1, 'Very often'], [2, 'Often'], [3, 'Sometimes'], [4, 'Rarely'], [5, 'Never']], label='How often do you lie to your parents?', widget=widgets.RadioSelectHorizontal) h8_new = models.IntegerField(choices=[[1, 'Very often'], [2, 'Often'], [3, 'Sometimes'], [4, 'Rarely'], [5, 'Never']], label='How often do you lie to close friends?\u2028\u2028', widget=widgets.RadioSelectHorizontal) h9_new = models.IntegerField(choices=[[1, 'Very often'], [2, 'Often'], [3, 'Sometimes'], [4, 'Rarely'], [5, 'Never']], label='When you are working for pay, how often do you slack off?', widget=widgets.RadioSelectHorizontal) emailadress = models.StringField(label='E-mail address') class AI_lottery_info(Page): form_model = 'player' class Softfacts(Page): form_model = 'player' form_fields = ['s2_new', 's6_new', 's8_new', 's9_new', 's10_new', 's11_new', 's13_new', 's14_new', 's17_new', 's18_new', 'h6_new', 'h5_new', 'h4_new', 'h7_new', 'h8_new', 'h9_new'] @staticmethod def vars_for_template(player: Player): import json answers = json.loads(player.participant.answers) s2_answer = answers[0] s6_answer = answers[1] s8_answer = answers[2] s9_answer = answers[3] s10_answer = answers[4] s11_answer = answers[5] s13_answer = answers[6] s14_answer = answers[7] s17_answer = answers[8] s18_answer = answers[9] h6_answer = answers[10] h5_answer = answers[11] h4_answer = answers[12] h7_answer = answers[13] h8_answer = answers[14] h9_answer = answers[15] return dict(answers=answers, s2_answer=s2_answer, s6_answer=s6_answer, s8_answer=s8_answer, s9_answer=s9_answer, s10_answer=s10_answer, s11_answer=s11_answer, s13_answer=s13_answer, s14_answer=s14_answer, s17_answer=s17_answer, s18_answer=s18_answer, h6_answer=h6_answer, h5_answer=h5_answer, h4_answer=h4_answer, h7_answer=h7_answer, h8_answer=h8_answer, h9_answer=h9_answer) class E_Mail_adress(Page): form_model = 'player' form_fields = ['emailadress'] class Seeyou(Page): form_model = 'player' page_sequence = [AI_lottery_info, Softfacts, E_Mail_adress, Seeyou]