from otree.api import * c = cu doc = '' class Constants(BaseConstants): name_in_url = 'Survey1_tdcs' players_per_group = None num_rounds = 1 instructions_template = 'Survey1_tdcs/instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def set_payoff(player): participant = player.participant import random offer1 = player.participant.vars['payoff1'] offer2 = player.participant.vars['payoff2'] offer3 = player.participant.vars['payoff3'] offer4 = player.participant.vars['payoff4'] offer5 = player.participant.vars['payoff5'] offer6 = player.participant.vars['payoff6'] offer7 = player.participant.vars['payoff7'] offer8 = player.participant.vars['payoff8'] offer9 = player.participant.vars['payoff9'] offer10 = player.participant.vars['payoff10'] offer11 = player.participant.vars['payoff11'] offer12 = player.participant.vars['payoff12'] offer = [offer1,offer2,offer3,offer4,offer5,offer6,offer7,offer8,offer9,offer10,offer11,offer12] offer13 = player.participant.vars['payoff13'] offer14 = player.participant.vars['payoff14'] offer15 = player.participant.vars['payoff15'] offer16 = player.participant.vars['payoff16'] offer17 = player.participant.vars['payoff17'] offer18 = player.participant.vars['payoff18'] offer19 = player.participant.vars['payoff19'] pay = [offer13,offer14,offer15,offer16,offer17,offer18,offer19] player.payoffprofit = random.choice(offer) player.payoffcost = random.choice(pay) player.payoff = 20+ player.payoffprofit + player.payoffcost class Player(BasePlayer): age = models.IntegerField(label='1.您的年龄', max=50, min=18) gender = models.StringField(choices=[['1', '男'], ['0', '女']], label='2.您的性别', widget=widgets.RadioSelect) degree = models.StringField(label='3.您的学历') major = models.StringField(label='4.您目前所修专业') grade = models.StringField(label='5.您的年级') course = models.StringField(label='6.您学过多少门会计相关的课程') work = models.StringField(label='7.您有关会计财务的实习或工作时间约(年)') hometown = models.StringField(choices=[['1', '大城市'], ['2', '中等城市'], ['3', '小城镇'], ['4', '农村']], label='8.您来自', widget=widgets.RadioSelectHorizontal) income = models.StringField(choices=[['1', '5千元以下'], ['2', '5千-1万'], ['3', '1万-3万'], ['4', '3万-6万'], ['5', '6万以上']], label='9.您家庭年人均收入', widget=widgets.RadioSelectHorizontal) pay = models.StringField(label='10.您的收款账号(请填写支付宝账号)') lastname = models.StringField(label='11.您的姓氏(用于支付宝转账验证)') part1_report = models.LongStringField(label='12.在实验Part 1中,您对税前利润是高报还是低报,还是两者皆有?为什么高报、低报或者两边报?') part1_reason = models.LongStringField(label='13.在Part 1的税前利润报告任务中,您作为财务经理,为什么您的报告会影响利益相关者的收益?') part1_guilty = models.StringField(choices=[['1', '不内疚'], ['2', '似乎不内疚'], ['3', '似乎内疚'], ['4', '内疚']], label='14.在Part 1的税前利润报告任务中是否有不实报告,如果有,因为自己的不实报告而造成利益相关者损失的愧疚感', widget=widgets.RadioSelectHorizontal) part3_guilty = models.StringField(choices=[['1', '不内疚'], ['2', '似乎不内疚'], ['3', '似乎内疚'], ['4', '内疚']], label='15.在Part 3的成本报告任务中是否有不实报告,如果有,因为自己的不实报告而造成公司总部损失的愧疚感', widget=widgets.RadioSelectHorizontal) s1 = models.StringField(choices=[['1', 'A.自己获得480,他人获得80。'], ['2', 'B.自己获得540,他人获得280。'], ['3', 'C.自己获得480,他人获得480。']], label='1.情境1', widget=widgets.RadioSelect) s2 = models.StringField(choices=[['1', 'A.自己获得560,他人获得300。'], ['2', 'B.自己获得500,他人获得500。'], ['3', 'C.自己获得500,他人获得100。']], label='2.情境2', widget=widgets.RadioSelect) s3 = models.StringField(choices=[['1', 'A.自己获得520,他人获得520。'], ['2', 'B.自己获得520,他人获得120。'], ['3', 'C.自己获得580,他人获得320。']], label='3.情境3', widget=widgets.RadioSelect) s4 = models.StringField(choices=[['1', 'A.自己获得500,他人获得100。'], ['2', 'B.自己获得560,他人获得300。'], ['3', 'C.自己获得490,他人获得490']], label='4.情境4', widget=widgets.RadioSelect) s5 = models.StringField(choices=[['1', 'A.自己获得560,他人获得300。'], ['2', 'B.自己获得500,他人获得500。'], ['3', 'C.自己获得490,他人获得90。']], label='5.情境5', widget=widgets.RadioSelect) s6 = models.StringField(choices=[['1', 'A.自己获得500,他人获得500。'], ['2', 'B.自己获得500,他人获得100。'], ['3', 'C.自己获得570,他人获得300。']], label='6.情境6', widget=widgets.RadioSelect) s7 = models.StringField(choices=[['1', 'A.自己获得510,他人获得510。'], ['2', 'B.自己获得560,他人获得300。'], ['3', 'C.自己获得510,他人获得110。']], label='7.情境7', widget=widgets.RadioSelect) s8 = models.StringField(choices=[['1', 'A.自己获得550,他人获得300。'], ['2', 'B.自己获得500,他人获得100。'], ['3', 'C.自己获得500,他人获得500。']], label='8.情境8', widget=widgets.RadioSelect) s9 = models.StringField(choices=[['1', 'A.自己获得480,他人获得100。'], ['2', 'B.自己获得490,他人获得490。'], ['3', 'C.自己获得540,他人获得300。']], label='9.情境9', widget=widgets.RadioSelect) b1 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='1.健谈的人。', widget=widgets.RadioSelectHorizontal) b2 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='2.喜欢挑别人毛病的人。', widget=widgets.RadioSelectHorizontal) b3 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='3.做事仔细彻底的人。', widget=widgets.RadioSelectHorizontal) b4 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='4.容易忧郁沮丧的人。', widget=widgets.RadioSelectHorizontal) b5 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='5.有见解,有很多新想法的人。', widget=widgets.RadioSelectHorizontal) b6 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='6.内向的人。', widget=widgets.RadioSelectHorizontal) b7 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='7.乐于助人、不自私的人。', widget=widgets.RadioSelectHorizontal) b8 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='8.有点粗心的人。', widget=widgets.RadioSelectHorizontal) b9 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='9.心情轻松,善于处理压力的人。', widget=widgets.RadioSelectHorizontal) b10 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='10.对各种事物充满好奇心的人。', widget=widgets.RadioSelectHorizontal) b11 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='11.精力充沛的人。', widget=widgets.RadioSelectHorizontal) b12 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='12.容易和别人发生争吵的人。', widget=widgets.RadioSelectHorizontal) b13 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='13.学习、工作踏实的人。', widget=widgets.RadioSelectHorizontal) b14 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='14.会紧张的人。', widget=widgets.RadioSelectHorizontal) b15 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='15.有发明天才、思想深刻的人。', widget=widgets.RadioSelectHorizontal) b16 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='16.热情奔放的人。', widget=widgets.RadioSelectHorizontal) b17 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='17.天性宽仁的人。', widget=widgets.RadioSelectHorizontal) b18 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='18.无组织纪律性的人。', widget=widgets.RadioSelectHorizontal) b19 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='19.充满忧郁的人。', widget=widgets.RadioSelectHorizontal) b20 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='20.想象力丰富的人。', widget=widgets.RadioSelectHorizontal) b21 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='21.喜欢安静的人。', widget=widgets.RadioSelectHorizontal) b22 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='22.值得信赖的人。', widget=widgets.RadioSelectHorizontal) b23 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='23.懒惰的人。', widget=widgets.RadioSelectHorizontal) b24 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='24.情绪稳定、不易心烦的人。', widget=widgets.RadioSelectHorizontal) b25 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='25.有创造力的人。', widget=widgets.RadioSelectHorizontal) b26 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='26.做事果断的人。', widget=widgets.RadioSelectHorizontal) b27 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='27.冷漠的人。', widget=widgets.RadioSelectHorizontal) b28 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='28.坚毅的人。', widget=widgets.RadioSelectHorizontal) b29 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='29.会情绪化、忧郁的人。', widget=widgets.RadioSelectHorizontal) b30 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='30.重视艺术审美的人。', widget=widgets.RadioSelectHorizontal) b31 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='31.做事害羞、拘谨的人。', widget=widgets.RadioSelectHorizontal) b32 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='32.几乎对所有人都体贴和善的人。', widget=widgets.RadioSelectHorizontal) b33 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='33.办事效率很高的人。', widget=widgets.RadioSelectHorizontal) b34 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='34.处变不惊的人。', widget=widgets.RadioSelectHorizontal) b35 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='35.喜欢工作比较常规的人。', widget=widgets.RadioSelectHorizontal) b36 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='36.随和、好交际的人。', widget=widgets.RadioSelectHorizontal) b37 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='37.有时对别人粗鲁无礼的人。', widget=widgets.RadioSelectHorizontal) b38 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='38.严格按照计划行事的人。', widget=widgets.RadioSelectHorizontal) b39 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='39.容易神经紧张的人。', widget=widgets.RadioSelectHorizontal) b40 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='40.喜欢沉思的人。', widget=widgets.RadioSelectHorizontal) b41 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='41.没有什么艺术爱好的人。', widget=widgets.RadioSelectHorizontal) b42 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='42.喜欢和别人合作的人。', widget=widgets.RadioSelectHorizontal) b43 = models.StringField(choices=[['5', '5'], ['4', '4'], ['3', '3'], ['2', '2'], ['1', '1']], label='43.容易分心的人。', widget=widgets.RadioSelectHorizontal) b44 = models.StringField(choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5']], label='44.擅长艺术、音乐或文学的人。', widget=widgets.RadioSelectHorizontal) payoffprofit = models.FloatField() payoffcost = models.FloatField() set_payoff = set_payoff class Start(Page): form_model = 'player' class BFI_1(Page): form_model = 'player' form_fields = ['b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'b10', 'b11', 'b12', 'b13', 'b14', 'b15', 'b16', 'b17', 'b18', 'b19', 'b20', 'b21', 'b22'] class BFI_2(Page): form_model = 'player' form_fields = ['b23', 'b24', 'b25', 'b26', 'b27', 'b28', 'b29', 'b30', 'b31', 'b32', 'b33', 'b34', 'b35', 'b36', 'b37', 'b38', 'b39', 'b40', 'b41', 'b42', 'b43', 'b44'] class SVO(Page): form_model = 'player' form_fields = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9'] class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'degree', 'major', 'grade', 'course', 'work', 'hometown', 'income', 'pay', 'lastname', 'part1_report', 'part1_reason', 'part1_guilty', 'part3_guilty'] class Payoff(Page): form_model = 'player' @staticmethod def vars_for_template(player): return set_payoff(player) page_sequence = [Start, BFI_1, BFI_2, SVO, Demographics, Payoff]