from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'PEQ_P' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 TEMP_TEMPLATE = 'PEQ_P/temp.html' INTRO_TEMPLATE = 'PEQ_P/intro.html' MANI_TEMPLATE = 'PEQ_P/mani.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Mani_Chk = models.IntegerField(choices=[[1, 'TRUE'], [0, 'FALSE']], label='You earn points based on the amount of winning bid [TRUE or FALSE]', widget=widgets.RadioSelect) Mani_Chk2 = models.IntegerField() PEQ1 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2 '], [3, '3 '], [4, '4 - Neither Disagree Nor Agree'], [5, '5 '], [6, '6'], [7, '7 - Strongly Agree']], label='1. I intentionally made favorable predictions to make my assets appear more valuable to Buyers', widget=widgets.RadioSelectHorizontal) PEQ2 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='2. I tried to be as accurate as possible when making my predictions', widget=widgets.RadioSelectHorizontal) PEQ3 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='3. My predictions were intended to benefit me', widget=widgets.RadioSelectHorizontal) PEQ4 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='4. My predictions were intended to benefit Buyers', widget=widgets.RadioSelectHorizontal) PEQ5 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='5. I considered how accurate I was relative to other Owners when making my predictions', widget=widgets.RadioSelectHorizontal) PEQ6 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='6. My predictions were accurate', widget=widgets.RadioSelectHorizontal) PEQ7 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='7. My predictions were more accurate than the other two Owners', widget=widgets.RadioSelectHorizontal) PEQ8 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='8. I believe that Buyers will have enough information to evaluate whether my predictions were made to serve my own interests or to be accurate', widget=widgets.RadioSelectHorizontal) PEQ9 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='1. I chose a higher likelihood to maximize the asset value', widget=widgets.RadioSelectHorizontal) PEQ10 = models.IntegerField(choices=[[1, '1 - Strongly Disagree'], [2, '2'], [3, '3'], [4, '4 - Neither Disagree Nor Agree'], [5, '5'], [6, '6'], [7, '7 - Strongly Agree']], label='2. I selected the likelihoods to ensure my predictions would be accurate', widget=widgets.RadioSelectHorizontal) PEQ11 = models.IntegerField(choices=[[1, 'Strongly Unlikely '], [2, 'Unlikely'], [3, 'Somewhat Unlikely'], [4, 'Neither Likely Nor Unlikely'], [5, 'Somewhat Likely'], [6, 'Likely'], [7, 'Strongly Likely']], label='In general, how likely are you to take risks', widget=widgets.RadioSelect) Gender = models.IntegerField(choices=[[1, 'Male'], [2, 'Female'], [3, 'Other'], [4, 'Prefer not to answer']], label='What is your gender', widget=widgets.RadioSelect) Age = models.IntegerField(label='What is your age') English = models.IntegerField(choices=[[1, 'YES'], [0, 'NO']], label='Are you a native English speaker', widget=widgets.RadioSelect) English2 = models.StringField(label='If you are not a native English speaker, what is your native language') Major = models.StringField(label='What is your major') FIN_ECON = models.IntegerField(choices=[[1, 'YES'], [0, 'NO']], label='Have you ever taken a finance or an economic course in the past', widget=widgets.RadioSelect) Degree = models.IntegerField(choices=[[1, 'Less than high school degree'], [2, 'High school graduate (high school diploma or equivalent including GED)'], [3, 'Some college but no degree'], [4, 'Associate degree in college (2-year)'], [5, "Bachelor's degree in college (4-year)"], [6, "Master's degree"], [7, 'Doctoral degree (PHD)'], [8, 'Professional degree (e.g. JD, MD)']], label='What is the highest level of school you have completed or the highest degree you have received', widget=widgets.RadioSelect) Industry = models.IntegerField(choices=[[1, 'Administrative and Support Services'], [2, 'Agriculture, Forestry, Fishing, and Hunting'], [3, 'Construction'], [4, 'Educational Services'], [5, 'Finance and Insurance'], [6, 'Government'], [7, 'Health Care and Social Assistance'], [8, 'Information'], [9, 'Management of Companies and Enterprises'], [10, 'Manufacturing'], [11, 'Mining, Quarrying, and Oil and Gas Extraction'], [12, 'Other Services (Except Public Administration)'], [13, 'Professional, Scientific, and Technical Services'], [14, 'Real Estate and Rental and Leasing'], [15, 'Retail'], [16, 'Transportation and Warehousing'], [17, 'Utilities'], [18, 'Wholesale'], [19, 'Others/None of the Above'], [20, 'Unemployed']], label='What industry do you work in', widget=widgets.RadioSelect) Wage = models.IntegerField(choices=[[1, 'Top 1/3'], [2, 'Middle 1/3'], [3, 'Bottom 1/3'], [4, 'I am currently unemployed']], label='Where does your job place you in your organization? (In terms of wage)', widget=widgets.RadioSelect) Experience = models.IntegerField(choices=[[1, 'No work experience'], [2, '1 – 5 years'], [3, '5 – 10 years'], [4, 'More than 10 years']], label='How many years of working experience do you have? (Approximate) ', widget=widgets.RadioSelect) Experiment_Num = models.IntegerField(choices=[[1, 'Less than 500'], [2, '500 - 1000 '], [3, '1001 - 2000'], [4, '2001 - 5000'], [5, 'More than 5000']], label='About how many experiments/studies have you participated in the past year? (Approximate)', widget=widgets.RadioSelect) Mturk_Code = models.LongStringField() Prediction = models.IntegerField() Likelihood = models.IntegerField() Cost = models.IntegerField() AV = models.IntegerField() Pay = models.FloatField() def Data_Retrieve(player: Player): participant = player.participant player.Prediction = participant.vars["prediction"] player.Likelihood = participant.vars["likelihood"] player.Cost = participant.vars["cost"] player.AV = participant.vars["av"] player.Pay = participant.vars["pay"] def generate_mturk_code(player: Player): import random mturk_code = random.randint(1, 999999999999999) player.Mturk_Code = str(mturk_code) class PEQ_Intro(Page): form_model = 'player' @staticmethod def before_next_page(player: Player, timeout_happened): Data_Retrieve(player) class PEQ1(Page): form_model = 'player' form_fields = ['Mani_Chk'] class PEQ2(Page): form_model = 'player' form_fields = ['Mani_Chk2'] class PEQ3(Page): form_model = 'player' form_fields = ['PEQ1', 'PEQ2', 'PEQ3', 'PEQ4', 'PEQ5', 'PEQ6', 'PEQ7', 'PEQ8'] class PEQ4(Page): form_model = 'player' form_fields = ['PEQ9', 'PEQ10'] class PEQ5(Page): form_model = 'player' form_fields = ['PEQ11'] class Demo(Page): form_model = 'player' form_fields = ['Gender', 'Age', 'English', 'English2', 'Major', 'FIN_ECON', 'Degree', 'Industry', 'Wage', 'Experience', 'Experiment_Num'] @staticmethod def before_next_page(player: Player, timeout_happened): generate_mturk_code(player) class Results(Page): form_model = 'player' page_sequence = [PEQ_Intro, PEQ1, PEQ2, PEQ3, PEQ4, PEQ5, Demo, Results]