from otree.api import * c = cu doc = '' class Constants(BaseConstants): name_in_url = 'demographics_pilot' players_per_group = None num_rounds = 1 finish_button_template = 'demographics_pilot/finish_button.html' slider_alex_erin_template = 'demographics_pilot/slider_alex_erin.html' slider_maybe_like_this_template = 'demographics_pilot/slider_maybe_like_this.html' group_attachment_slider_template = 'demographics_pilot/group_attachment_slider.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): female = models.BooleanField(blank=True, choices=[[True, 'female'], [False, 'male']], label='What is your gender?', widget=widgets.RadioSelectHorizontal) age = models.IntegerField(blank=True, label='What is your age?', min=0) major = models.StringField(blank=True, label='What is your major?') province = models.StringField(blank=True, label='Which province do you come from?') urban = models.BooleanField(blank=True, choices=[[True, 'city'], [False, 'countryside']], label='Do you come from city or countryside?', widget=widgets.RadioSelectHorizontal) father_education = models.IntegerField(blank=True, choices=[[1, 'primary school or below'], [2, 'middle school'], [3, 'high school'], [4, 'junior college'], [5, "bachelor's degree"], [6, "over bachelor's degree"]], label="What is your father's education level?", widget=widgets.RadioSelectHorizontal) mother_education = models.IntegerField(blank=True, choices=[[1, 'primary school or below'], [2, 'middle school'], [3, 'high school'], [4, 'junior college'], [5, "bachelor's degree"], [6, "over bachelor's degree"]], label="What is your mother's education?", widget=widgets.RadioSelectHorizontal) income = models.IntegerField(blank=True, choices=[[1, 'less than ¥2000'], [2, '¥2000 -¥5000'], [3, '¥5000 -¥10000'], [4, '¥10000 -¥15000'], [5, '¥15000 -¥20000'], [6, '¥20000 -¥50000'], [7, 'more than ¥50000']], label='What is your household’s monthly income per capita?', widget=widgets.RadioSelectHorizontal) sibling = models.IntegerField(blank=True, choices=[[0, '0'], [1, '1'], [2, '2'], [3, '3 and above']], label='How many siblings do you have?', widget=widgets.RadioSelectHorizontal) ethnicity = models.IntegerField(blank=True, choices=[[0, 'Han'], [1, 'Hui'], [2, 'Uyghur'], [3, 'Zang'], [4, 'other']], label='What is your ethnicity?', widget=widgets.RadioSelectHorizontal) religion = models.IntegerField(blank=True, choices=[[0, 'none'], [1, 'Buddhism'], [2, 'Christianity'], [3, 'Islam'], [4, 'other']], label='What is your religion?', widget=widgets.RadioSelectHorizontal) party = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='Are you a party member or a probationary party member?', widget=widgets.RadioSelectHorizontal) in_relationship = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='Are you in a relationship?', widget=widgets.RadioSelectHorizontal) num_friends = models.IntegerField(blank=True, label='How many good friends do you have?', min=0) help_stranger = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='Did you help a stranger who needed help in the previous month?', widget=widgets.RadioSelectHorizontal) help_individual = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='Did you send help (money or goods) to another individual in the previous year?', widget=widgets.RadioSelectHorizontal) subjective_order = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='Within the last 12 months, have you had money or property stolen from you or another household member?', widget=widgets.RadioSelectHorizontal) subjective_health = models.IntegerField(blank=True, choices=[[1, 'Very bad'], [2, 'Bad'], [3, 'Neutral'], [4, 'Good'], [5, 'Very good']], label='How do you assess your physical health?', widget=widgets.RadioSelectHorizontal) comments = models.LongStringField(blank=True, label='Do you have any comment on this questionnaire?') 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' page_sequence = [Demographics, Finish]