from otree.api import * c = cu doc = '' class Constants(BaseConstants): name_in_url = 'demographics_pilot_Chinese' players_per_group = None num_rounds = 1 finish_button_template = 'demographics_pilot_Chinese/finish_button.html' slider_alex_erin_template = 'demographics_pilot_Chinese/slider_alex_erin.html' slider_maybe_like_this_template = 'demographics_pilot_Chinese/slider_maybe_like_this.html' group_attachment_slider_template = 'demographics_pilot_Chinese/group_attachment_slider.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): female = models.BooleanField(blank=True, choices=[[True, '女性'], [False, '男性']], label='您的性别是', widget=widgets.RadioSelectHorizontal) age = models.IntegerField(blank=True, label='您的年龄是', min=0) major = models.StringField(blank=True, label='您的专业是') province = models.StringField(blank=True, label='您的家乡属于哪个省份') urban = models.BooleanField(blank=True, choices=[[True, '城市'], [False, '乡村']], label='您的家乡是', widget=widgets.RadioSelectHorizontal) father_education = models.IntegerField(blank=True, choices=[[1, '小学及以下'], [2, '初中'], [3, '高中'], [4, '大专'], [5, '大学本科'], [6, '研究生']], label='您父亲的受教育程度是', widget=widgets.RadioSelectHorizontal) mother_education = models.IntegerField(blank=True, choices=[[1, '小学及以下'], [2, '初中'], [3, '高中'], [4, '大专'], [5, '大学本科'], [6, '研究生']], label='您母亲的受教育程度是', widget=widgets.RadioSelectHorizontal) income = models.IntegerField(blank=True, choices=[[1, '小于2000元'], [2, '2000-5000元'], [3, '5000-10000元'], [4, '10000-20000元'], [5, '大于20000元']], label='您家庭的人均月收入是', widget=widgets.RadioSelectHorizontal) sibling = models.IntegerField(blank=True, choices=[[0, '没有'], [1, '1个'], [2, '2个'], [3, '3个及以上']], label='您有多少个亲兄弟姐妹', widget=widgets.RadioSelectHorizontal) ethnicity = models.IntegerField(blank=True, choices=[[0, '汉族'], [1, '回族'], [2, '维吾尔族'], [3, '藏族'], [4, '其它']], label='您的民族是', widget=widgets.RadioSelectHorizontal) religion = models.IntegerField(blank=True, choices=[[0, '没有'], [1, '佛教'], [2, '基督教'], [3, '伊斯兰教'], [4, '其它']], label='您的宗教信仰是', widget=widgets.RadioSelectHorizontal) party = models.BooleanField(blank=True, choices=[[True, '是'], [False, '否']], label='您是否为党员或预备党员', widget=widgets.RadioSelectHorizontal) in_relationship = models.BooleanField(blank=True, choices=[[True, '是'], [False, '否']], label='您是否正处于一段恋爱关系中', widget=widgets.RadioSelectHorizontal) num_friends = models.IntegerField(blank=True, label='您有多少个好朋友', min=0) help_stranger = models.BooleanField(blank=True, choices=[[True, '是'], [False, '否']], label='在过去一个月中,您是否帮助过需要帮助的陌生人', widget=widgets.RadioSelectHorizontal) help_individual = models.BooleanField(blank=True, choices=[[True, '是'], [False, '否']], label='在过去一年中,您是否向别人提供过金钱或财物的帮助', widget=widgets.RadioSelectHorizontal) subjective_order = models.BooleanField(blank=True, choices=[[True, '是'], [False, '否']], label='在过去一年中,您和家人是否有财物被盗', widget=widgets.RadioSelectHorizontal) subjective_health = models.IntegerField(blank=True, choices=[[1, '不好'], [2, '比较不好'], [3, '不确定'], [4, '比较好'], [5, '好']], label='请评价您的身体健康状况', widget=widgets.RadioSelectHorizontal) comments = models.LongStringField(blank=True, label='您对这份问卷有什么评论和建议') alipay = models.LongStringField(label='请输入您的支付宝账号,我们很快会将报酬打入您的账户') class Demographics(Page): form_model = 'player' form_fields = ['female', 'age', 'major', 'province', 'urban', 'income', 'sibling', 'ethnicity', 'religion', 'party', 'comments'] class Finish(Page): form_model = 'player' form_fields = ['alipay'] page_sequence = [Demographics, Finish]