from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Wei Lu - luwei.here@gmail.com' doc = """ Socio-emotional preferences and skills survey """ def get_slider_widget(step=0.1): return widgets.Slider(attrs={"step": step}) class Constants(BaseConstants): name_in_url = 'report_survey' players_per_group = None num_rounds = 1 frequency_choices = ['Never', 'Less than once a month', 'Once a month', 'Once a week', 'Once a day'] importance_choices = ['Not important at all', 'Not very important', 'Important', 'Very important'] discussed_with_choices = ['Friends', 'Family', 'Teachers',' No discussion '] class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): widgets.Slider.show_value = False # Risk avg_open = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_open_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_open_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_open = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_open_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_open_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) # Present avg_invest = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) avg_invest_girls = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) avg_invest_boys = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_invest = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_invest_girls = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_invest_boys = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) # Grit avg_grit = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) avg_grit_girls = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) avg_grit_boys = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_grit = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_grit_girls = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_grit_boys = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) # Altruism avg_altruism_give = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_altruism_give_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_altruism_give_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_altruism_give = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_altruism_give_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_altruism_give_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) # Trust avg_trust_give = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) avg_trust_give_girls = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) avg_trust_give_boys = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_trust_give = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_trust_give_girls = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) should_trust_give_boys = models.IntegerField(label='', min=0, max=5, widget=widgets.Slider) # Redistribution avg_redistribution_give = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_redistribution_give_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) avg_redistribution_give_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_redistribution_give = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_redistribution_give_girls = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) should_redistribution_give_boys = models.IntegerField(label='', min=0, max=10, widget=widgets.Slider) # Cooperation avg_coop_give = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) avg_coop_give_girls = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) avg_coop_give_boys = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) should_coop_give = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) should_coop_give_girls = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) should_coop_give_boys = models.FloatField(label='', min=0, max=1, widget=get_slider_widget()) # Competition avg_competitiveness = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) avg_competitiveness_girls = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) avg_competitiveness_boys = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_competitiveness = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_competitiveness_girls = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) should_competitiveness_boys = models.IntegerField(label='', min=0, max=100, widget=widgets.Slider) # Trait rating risk_rating = models.StringField(label='Risk tolerance', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) present_rating = models.StringField(label='Patience', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) grit_rating = models.StringField(label='Perseverance', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) altruism_rating = models.StringField(label='Altruism', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) trust_rating = models.StringField(label='Trust in others', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) redistribution_rating = models.StringField(label='Preference for redistribution', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) cooperation_rating = models.StringField(label='Cooperation', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) competition_rating = models.StringField(label='Comfort with a competitive environment', choices=['Lower', 'Average', 'Higher'], widget=widgets.RadioSelectHorizontal) # Trait change risk_change = models.StringField(label='Risk tolerance', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) present_change = models.StringField(label='Patience', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) grit_change = models.StringField(label='Perseverance', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) altruism_change = models.StringField(label='Altruism', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) trust_change = models.StringField(label='Trust in others', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) redistribution_change = models.StringField(label='Preference for redistribution', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) cooperation_change = models.StringField(label='Cooperation', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) competition_change = models.StringField(label='Comfort with a competitive environment', choices=['Decrease', 'Keep constant', 'Increase'], widget=widgets.RadioSelectHorizontal) # Trait change confidence risk_change_confidence = models.StringField(label='Risk tolerance', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) present_change_confidence = models.StringField(label='Patience', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) grit_change_confidence = models.StringField(label='Perseverance', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) altruism_change_confidence = models.StringField(label='Altruism', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) trust_change_confidence = models.StringField(label='Trust in others', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) redistribution_change_confidence = models.StringField(label='Preference for redistribution', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) cooperation_change_confidence = models.StringField(label='Cooperation', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) competition_change_confidence = models.StringField(label='Comfort with a competitive environment', choices=['Yes', 'No', 'No change'], widget=widgets.RadioSelectHorizontal) # Trait change at home risk_change_home = models.StringField(label='Risk tolerance', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) present_change_home = models.StringField(label='Patience', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) grit_change_home = models.StringField(label='Perseverance', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) altruism_change_home = models.StringField(label='Altruism', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) trust_change_home = models.StringField(label='Trust in others', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) redistribution_change_home = models.StringField(label='Preference for redistribution', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) cooperation_change_home = models.StringField(label='Cooperation', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) competition_change_home = models.StringField(label='Comfort with a competitive environment', choices=['Yes', 'No'], widget=widgets.RadioSelectHorizontal) risk_change_home_comment = models.StringField(label='', blank=True) present_change_home_comment = models.StringField(label='', blank=True) grit_change_home_comment = models.StringField(label='', blank=True) altruism_change_home_comment = models.StringField(label='', blank=True) trust_change_home_comment = models.StringField(label='', blank=True) redistribution_change_home_comment = models.StringField(label='', blank=True) cooperation_change_home_comment = models.StringField(label='', blank=True) competition_change_home_comment = models.StringField(label='', blank=True) # Trait discussed with risk_discussed_with = models.StringField(label='Risk tolerance', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) present_discussed_with = models.StringField(label='Patience', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) grit_discussed_with = models.StringField(label='Perseverance', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) altruism_discussed_with = models.StringField(label='Altruism', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) trust_discussed_with = models.StringField(label='Trust in others', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) redistribution_discussed_with = models.StringField(label='Preference for redistribution', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) cooperation_discussed_with = models.StringField(label='Cooperation', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) competition_discussed_with = models.StringField(label='Comfort with a competitive environment', choices=Constants.discussed_with_choices, widget=widgets.RadioSelectHorizontal) # Trait frequency risk_frequency = models.StringField(label='Risk tolerance', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) present_frequency = models.StringField(label='Patience', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) grit_frequency = models.StringField(label='Perseverance', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) altruism_frequency = models.StringField(label='Altruism', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) trust_frequency = models.StringField(label='Trust in others', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) redistribution_frequency = models.StringField(label='Preference for redistribution', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) cooperation_frequency = models.StringField(label='Cooperation', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) competition_frequency = models.StringField(label='Comfort with a competitive environment', choices=Constants.frequency_choices, widget=widgets.RadioSelectHorizontal) # Trait importance risk_importance = models.StringField(label='Risk tolerance', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) present_importance = models.StringField(label='Patience', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) grit_importance = models.StringField(label='Perseverance', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) altruism_importance = models.StringField(label='Altruism', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) trust_importance = models.StringField(label='Trust in others', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) redistribution_importance = models.StringField(label='Preference for redistribution', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) cooperation_importance = models.StringField(label='Cooperation', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal) competition_importance = models.StringField(label='Comfort with a competitive environment', choices=Constants.importance_choices, widget=widgets.RadioSelectHorizontal)