from otree.api import * c = cu doc = '投资者利他偏好' class Constants(BaseConstants): name_in_url = 'Altruistic_Tendency' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Donation_1 = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='您有多愿意进行慈善捐赠,而不期待任何回报?请用10 分制评分标准来评价,0 表示您“完全不愿意这么做”,10 表示您“非常愿意这么做”', widget=widgets.RadioSelectHorizontal) Donation_2 = models.IntegerField(label='想象一下,如果今天您意外地得到800元, 您会把这笔钱中的多少元用于慈善捐赠(允许0到800之间的金额)', max=800, min=0) Q1 = models.IntegerField(choices=[[1, 'A.8:00'], [2, 'B.11:00'], [3, 'C.12:00'], [4, 'D.16:00']], label='*1.下列哪个时间点可以进行股票交易', widget=widgets.RadioSelectHorizontal) Q2 = models.IntegerField(choices=[[1, 'A.熊市和牛市'], [2, 'B.牛市和熊市'], [3, 'C.红市和黑市'], [4, 'D.黑市和红市']], label='*2.股市中的上涨阶段和下跌阶段分别如何称呼', widget=widgets.RadioSelectHorizontal) Q3 = models.IntegerField(choices=[[1, 'A.10股'], [2, 'B.50股'], [3, 'C.100股'], [4, 'D.200股']], label='*3.我国规定股票一手为多少股', widget=widgets.RadioSelectHorizontal) Gender = models.FloatField(choices=[[1, '男'], [2, '女']], label='您的性别', widget=widgets.RadioSelectHorizontal) Age = models.IntegerField(label='您的年龄', max=99, min=10) Year = models.FloatField(label='您有几年投资经验(请填写整数,无投资经验填0)', max=99, min=0) SRI_yes_or_no = models.IntegerField(choices=[[1, '是'], [2, '否']], label='您是否听说过社会责任投资(即投资注重社会责任的股票、基金或债券)', widget=widgets.RadioSelectHorizontal) SRI_inv = models.IntegerField(choices=[[1, '是'], [2, '否']], label='您是否进行过社会责任投资', widget=widgets.RadioSelectHorizontal) Significance = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7']], label='在做投资决策时,您如何评价收益的重要性(1表示非常不重要,7表示非常重要)', widget=widgets.RadioSelectHorizontal) How_to_assess = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7']], label='在做投资决策时,您如何评价社会责任的重要性(1表示非常不重要,7表示非常重要)', widget=widgets.RadioSelectHorizontal) Micro = models.StringField(label='请填写您的支付宝账号,便于发放报酬') Education = models.IntegerField(choices=[[1, '本科'], [2, '硕士'], [3, '博士']], label='您的受教育程度', widget=widgets.RadioSelectHorizontal) Marriage = models.IntegerField(choices=[[1, '未婚'], [2, '已婚']], label='您的婚姻状况', widget=widgets.RadioSelectHorizontal) Revenue1 = models.IntegerField(choices=[[1, '1万元以下'], [2, '1-2万元'], [3, '2-3万元'], [4, '3-5万元'], [5, '5万元以上']], label='您的家庭月收入', widget=widgets.RadioSelectHorizontal) treatment = models.IntegerField() ESG_success = models.BooleanField() Mundane_success = models.BooleanField() outcome = models.IntegerField() revenue = models.IntegerField() price = models.IntegerField() Mundane_fund_quotes = models.IntegerField() ESG_fund_quotes = models.IntegerField() income = models.IntegerField() Divi = models.FloatField() feedback = models.LongStringField(blank=True, label='您对本问卷有什么想法和建议') wagetr = models.IntegerField() Willing_invest = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,您认为自己对该公司投资的可能性有多高(0表示非常低,10表示非常高)', widget=widgets.RadioSelectHorizontal) View_profit = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,您认为投资该公司的收益如何(0表示非常低,10表示非常高)', widget=widgets.RadioSelectHorizontal) View_risk = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,您认为投资该公司的风险如何(0表示非常低,10表示非常高)', widget=widgets.RadioSelectHorizontal) View_ratio = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,您认为该公司的内部薪酬差距如何(0表示非常小,10表示非常大)', widget=widgets.RadioSelectHorizontal) View_responsible = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,您认为该公司对社会责任的履行程度如何(0表示非常低,10表示非常高)', widget=widgets.RadioSelectHorizontal) Test = models.IntegerField(choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='假如您是该公司的潜在投资者,本题请您忽略假设,直接选择0选项(0表示非常低,10表示非常高)', widget=widgets.RadioSelectHorizontal) ratio_assess = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7']], label='在做投资决策时,您如何评价企业内部薪酬差距的重要性(1表示非常不重要,7表示非常重要)', widget=widgets.RadioSelectHorizontal) Subject = models.StringField(label='您的专业') identity = models.IntegerField(choices=[[1, '浙大学生'], [2, '浙大校友'], [3, '浙大职工'], [4, '以上都不是']], label='您的身份是(请真实作答,无论您选什么,我们都会为您发放报酬)', widget=widgets.RadioSelectHorizontal) class Donation(Page): form_model = 'player' form_fields = ['Donation_1', 'Donation_2'] @staticmethod def before_next_page(player, timeout_happened): import random player.wagetr = random.choice([1,2,3,4]) class Wage1(Page): form_model = 'player' form_fields = ['Willing_invest', 'View_profit', 'View_risk', 'View_ratio', 'View_responsible', 'Test'] class Input(Page): form_model = 'player' form_fields = ['Gender', 'Age', 'Year', 'SRI_yes_or_no', 'SRI_inv', 'Significance', 'How_to_assess', 'ratio_assess', 'Revenue1', 'Education', 'Subject', 'Marriage', 'Micro', 'identity', 'feedback'] @staticmethod def before_next_page(player, timeout_happened): participant = player.participant player.outcome = participant.vars['outcome'] player.price = participant.vars['price'] player.ESG_fund_quotes = participant.vars['ESG_fund_quotes'] player.Mundane_fund_quotes = participant.vars['Mundane_fund_quotes'] player.ESG_success = participant.vars['ESG_success'] player.Mundane_success = participant.vars['Mundane_success'] player.treatment = participant.vars['treatment'] player.revenue = participant.vars['revenue'] player.income = participant.vars['income'] player.Divi = player.income/100 class Outcome(Page): form_model = 'player' page_sequence = [Donation, Wage1, Input, Outcome]