from otree.api import * c = cu doc = 'The DOSPERT GAME' class C(BaseConstants): NAME_IN_URL = 'survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 INSTRUCTIONS_TEMPLATE = 'survey/instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female']], label='What is your gender', widget=widgets.RadioSelect) Dospert_soc_1 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will choose a career that I truly enjoy over a more secure one.', max=5, min=0, widget=widgets.RadioSelectHorizontal) Dospert_Soc_2 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I admit that my tastes are different from those of a friend.', max=5, min=1, widget=widgets.RadioSelectHorizontal) Dospert_Soc_3 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will move to a city far away from my extended family.', max=5, min=1, widget=widgets.RadioSelectHorizontal) Dospert_Soc_4 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I speak my mind about an unpopular issue in a meeting at work.', max=5, min=1, widget=widgets.RadioSelectHorizontal) Dospert_Fin_1 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will invest 10% of my annual income in a moderate growth mutual fund', max=5, min=1, widget=widgets.RadioSelectHorizontal) Dospert_Fin_2 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will invest 5% of my annual income in a very speculative stock.', max=5, min=1, widget=widgets.RadioSelectHorizontal) Dospert_Fin_3 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will invest 10% of my annual income in a new business venture.', max=5, min=1, widget=widgets.RadioSelectHorizontal) age = models.IntegerField(blank=True, label='What is your age', max=125, min=13) Dospert_Fin_4 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='I will bet a day’s income on the outcome of a sporting event.', max=5, min=1, widget=widgets.RadioSelectHorizontal) class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender'] @staticmethod def before_next_page(player: Player, timeout_happened): pass class DOSPERT_Scale(Page): form_model = 'player' form_fields = ['Dospert_soc_1', 'Dospert_Soc_2', 'Dospert_Soc_3', 'Dospert_Soc_4', 'Dospert_Fin_1', 'Dospert_Fin_2', 'Dospert_Fin_3', 'Dospert_Fin_4'] @staticmethod def is_displayed(player: Player): return True page_sequence = [Demographics, DOSPERT_Scale]