from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'post_survey2' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): year_of_study = models.StringField(blank=True, choices=[['1st year undergraduate', '1st year undergraduate'], ['2nd year undergraduate', '2nd year undergraduate'], ['3rd year undergraduate', '3rd year undergraduate'], ['4th year undergraduate', '4th year undergraduate'], ['5th year+ undergraduate', '5th year+ undergraduate'], ['Masters', 'Masters'], ['Ph.D.', 'Ph.D.'], ['Post-doctoral student', 'Post-doctoral student'], ['Does not apply', 'Does not apply']], label='What is your year of study?', widget=widgets.RadioSelect) work_field = models.StringField(blank=True, label='What field do you intend to work in?') study_field = models.StringField(blank=True, label='What is/was your most recent field of study?') labour_mkt_status = models.StringField(blank=True, label='What is your current labour market status?') current_field_emp = models.StringField(blank=True, label='If you are currently employed, what field do you work in? If not, leave blank') hh_income = models.StringField(blank=True, choices=[['Less than $30,000', 'Less than $30,000'], ['$30,000 to $59,999', '$30,000 to $59,999'], ['$60,000 to $99,999', '$60,000 to $99,999'], ['$100,000 to $129,999', '$100,000 to $129,999'], ['$130,000 to $159,999', '$130,000 to $159,999'], ['$160,000 or more', '$160,000 or more'], ['Do not know', 'Do not know']], label='Which income bracket did your household fall into in 2022? ', widget=widgets.RadioSelect) counterpart_avatar = models.StringField(blank=True, choices=[['1', '1'], ['2', '2'], ['3', '3']], label='Select the avatar your counterpart used:', widget=widgets.RadioSelect) counterpart_bargaining_skill = models.StringField(blank=True, choices=[['Very well', 'Very well'], ['Well', 'Well'], ['Neither well nor poorly', 'Neither well nor poorly'], ['Poorly', 'Poorly'], ['Very Poorly', 'Very Poorly'], ['Unsure/Cannot recall', 'Unsure/Cannot recall']], label='How well did your counterpart bargain?', widget=widgets.RadioSelect) counterpart_skill_expectation = models.StringField(blank=True, choices=[['Very well', 'Very well'], ['Well', 'Well'], ['Neither well nor poorly', 'Neither well nor poorly'], ['Poorly', 'Poorly'], ['Very poorly', 'Very poorly'], ['Unsure/Cannot recall', 'Unsure/Cannot recall']], label='How well did you expect your counterpart to bargain?', widget=widgets.RadioSelect) scale_men_better = models.StringField(blank=True, choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7'], ['8', '8'], ['9', '9'], ['10', '10']], label='Do you agree with the statement “men are better at bargaining than women”? (1 is "strongly disagree" and 10 is "strongly agree")', widget=widgets.RadioSelectHorizontal) your_bargaining_skill = models.StringField(blank=True, choices=[['Very well', 'Very well'], ['Well', 'Well'], ['Neither well nor poorly', 'Neither well nor poorly'], ['Poorly', 'Poorly'], ['Very poorly', 'Very poorly'], ['Unsure/Cannot recall', 'Unsure/Cannot recall']], label='How well do you believe you bargained?', widget=widgets.RadioSelect) scale_bargaining_exp = models.StringField(blank=True, choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7'], ['8', '8'], ['9', '9'], ['10', '10']], label='What is your level of bargaining experience? (1 is "no experience" and 10 is "very experienced")', widget=widgets.RadioSelectHorizontal) scale_risk_pref = models.StringField(blank=True, choices=[['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7'], ['8', '8'], ['9', '9'], ['10', '10']], label='How willing are you to take risks, in general? (1 is "unwilling" and 10 is "very willing")', widget=widgets.RadioSelectHorizontal) econ_views = models.StringField(blank=True, choices=[['Very Liberal', 'Very Liberal'], ['Liberal', 'Liberal'], ['Moderate', 'Moderate'], ['Conservative', 'Conservative'], ['Very Conservative', 'Very Conservative'], ['Other', 'Other'], ['No Opinion', 'No Opinion']], label='In terms of your economic views, are you', widget=widgets.RadioSelect) political_views = models.StringField(blank=True, choices=[['Very Liberal', 'Very Liberal'], ['Liberal', 'Liberal'], ['Moderate', 'Moderate'], ['Conservative', 'Conservative'], ['Very Conservative', 'Very Conservative'], ['Other', 'Other'], ['No Opinion', 'No Opinion']], label='Are you politically', widget=widgets.RadioSelect) instructions_clarity = models.StringField(blank=True, choices=[['I completely understood all the instructions', 'I completely understood all the instructions'], ['I understood most of the instructions', 'I understood most of the instructions'], ['I understood some of the instructions', 'I understood some of the instructions'], ['I did not understand most of the instructions', 'I did not understand most of the instructions'], ['I did not understand the instructions at all', 'I did not understand the instructions at all']], label='Please indicate how clear the instructions in the experiment were to you.', widget=widgets.RadioSelect) comments = models.StringField(blank=True, label='Please share your feedback:') region = models.StringField(blank=True, choices=[['North America', 'North America'], ['Central/South America', 'Central/South America'], ['Africa', 'Africa'], ['Asia', 'Asia'], ['Australia/New Zealand', 'Australia/New Zealand'], ['Europe', 'Europe'], ['Other', 'Other']], label='In what region of the world did you grow up? ', widget=widgets.RadioSelect) exd_cad = models.IntegerField() is_buyer = models.BooleanField() is_seller = models.BooleanField() class DEMOGRAPHICS(Page): form_model = 'player' form_fields = ['year_of_study', 'work_field', 'current_field_emp', 'hh_income', 'region'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.is_buyer=participant.is_buyer player.is_seller=participant.is_seller class SELF_REPOERTED_SKILLS(Page): form_model = 'player' form_fields = ['counterpart_avatar', 'your_bargaining_skill', 'counterpart_bargaining_skill', 'counterpart_skill_expectation'] class BELIEFS(Page): form_model = 'player' form_fields = ['scale_men_better', 'scale_bargaining_exp', 'scale_risk_pref', 'econ_views', 'political_views', 'instructions_clarity'] class COMMENTS(Page): form_model = 'player' form_fields = ['comments'] class FINAL_PAYOFF(Page): form_model = 'player' @staticmethod def vars_for_template(player: Player): participant = player.participant payoff=((participant.quiz_payoff)/2)+10 return dict(payoff=payoff) page_sequence = [DEMOGRAPHICS, SELF_REPOERTED_SKILLS, BELIEFS, COMMENTS, FINAL_PAYOFF]