from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'questionnaire' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): def likert1(label): return models.IntegerField( choices=[ [1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Undecided'], [4, 'Disagree'], [5, 'Strongly disagree']], label=label, widget=widgets.RadioSelectHorizontal ) def likert2(label): return models.IntegerField( choices=[ [1, 'Very likely'], [2, 'Likely'], [3, 'Neutral'], [4, 'Unlikely'], [5, 'Very likely']], label=label, widget=widgets.RadioSelectHorizontal ) # Control variables (firm size, firm industry, education, occupation, hierarchy, income, tenure, work hours) size = models.StringField( label='What is the size of your main employer based on total number of employees?', choices=["Less than 10", "10 to 49", "50 to 249", "250 to 499", "500 to 999", "More than 1000"], widget=widgets.RadioSelect ) industry = models.StringField( label='In what industry is your main employer situated?', choices=[ 'Agriculture, Forestry, Fishing and Hunting (NAICS 11)', 'Mining, Quarrying, and Oil and Gas Extraction (NAICS 21)', 'Utilities (NAICS 22)', 'Construction (NAICS 23)', 'Manufacturing (NAICS 31-33)', 'Wholesale Trade (NAICS 42)', 'Retail Trade (NAICS 44-45)', 'Transportation and Warehousing (NAICS 48-49)', 'Information (NAICS 51)', 'Finance and Insurance (NAICS 52)', 'Real Estate and Rental and Leasing (NAICS 53)', 'Professional, Scientific, and Technical Services (NAICS 54)', 'Management of Companies and Enterprises (NAICS 55)', 'Administrative and Support and Waste Management and Remediation Services (NAICS 56)', 'Educational Services (NAICS 61)', 'Health Care and Social Assistance (NAICS 62)', 'Arts, Entertainment, and Recreation (NAICS 71)', 'Accommodation and Food Services (NAICS 72)', 'Other Services (except Public Administration) (NAICS 81)', ] ) education = models.StringField( label='What is your level of education?', choices=["High school diploma", "Associate's degree", "Bachelor's degree", "Master's degree", "Ph.D. or advanced professional degree", "Don't know or not applicable"], widget=widgets.RadioSelect ) occupation = models.StringField( label='In which kind of occupation are you employed?', choices=[ 'Management occupation', 'Business and financial operations occupation', 'Computer and mathematical occupation', 'Architecture and engineering occupation', 'Life, Physical, and Social Science Occupations', 'Community and Social Service Occupations', 'Legal Occupations', 'Educational Instruction and Library Occupations', 'Arts, Design, Entertainment, Sports, and Media Occupations', 'Healthcare Practitioners and Technical Occupations', 'Healthcare Support Occupations', 'Protective Service Occupations', 'Food Preparation and Serving Related Occupations', 'Building and Grounds Cleaning and Maintenance Occupations', 'Personal Care and Service Occupations', 'Sales and Related Occupations', 'Office and Administrative Support Occupations', 'Farming, Fishing, and Forestry Occupations', 'Construction and Extraction Occupations', 'Installation, Maintenance, and Repair Occupations', 'Production Occupations', 'Transportation and Material Moving Occupations', ], ) hierarchy = models.StringField( label='Which role do you have in your main occupation?', choices=["Employee", "Independent contractor", "Supervisor", "Manager", "Director", "Top management"], widgets=widgets.RadioSelect ) income = models.StringField( label='What is your annual income?', choices=['Less than $15,000', '$15,000 to $34,999', '$35,000 to $49,999', '$50,000 to $74,999', '$75,000 to $99,999', '$100,000 or more', 'Rather not say'] ) tenure = models.StringField( label='How many years have you been employed at your main employer?', ) hours = models.IntegerField( label='How many hours do you contractually work for your main employer over a week?' ) # Attention checks check1 = models.StringField( label='Thank you for your answers thus far. To see if you are paying attention, please fill in ' '"attention" in the box below' ) check2 = models.StringField( label='Choose your favorite online job board you are/were using during your job search. We want you to take ' 'the time to read the directions carefully. To demonstrate that you read the instructions, please ignore ' 'the listed below and instead select the box marked with "Rather not say".', choices=['LinkedIn', 'Glassdoor', 'Nexxt', 'Indeed', 'CareerBuilder', 'Job2Careers', 'Monster', 'ZipRecruiter', 'Snagajob', 'Other', 'Rather not say'] ) # Values issue = models.StringField( label='Are there any specific issues that you feel are particularly important for your company to address?' ) motivation1 = likert1("Illness or other health or medical limitations") motivation2 = likert1("Childcare") motivation3 = likert1("Family or personal obligations") motivation4 = likert1("Being in school or training") motivation5 = likert1("Retirement or Social Security limits on earnings") motivation6 = likert1("Having a job where full-time work is less than 35 hours") motivation7 = likert1("Slack work conditions") motivation8 = likert1("Unfavorable business conditions") motivation9 = likert1("Inability to find full-time work") motivation10 = likert1("Seasonal declines in demand") # Predictors/Intention (Trust, Openness, Commitment, Mobility aspirations, Psychological safety) trust1 = likert1("I feel confident that management will always try to treat me fairly.") trust2 = likert1("Management is sincere in its attempts to listen to my ideas and suggestions.") trust3 = likert1("Management can be trusted to make sensible decisions for this organization’s future.") open1 = likert1("The management is interested in ideas and suggestions from employees.") open2 = likert1("Good ideas get serious considerations from the management.") open3 = likert1("When suggestions are made to the management, they receive fair consideration.") open4 = likert1("The management takes action on recommendations made by employees.") open5 = likert1("The management rejects some ideas and suggestions.") commitment1 = likert1("When someone criticizes my organization it feels like a personal insult.") commitment2 = likert1("When I talk about the organization, I usually say 'we' rather than 'they'.") commitment3 = likert1("The organization's successes are my successes.") commitment4 = likert1("When someone praises the organization, it feels like a personal compliment.") commitment5 = likert1("If a story in the media criticizes the organization, I would feel embarrassed.") commitment6 = likert1("I am interested in what others think about the organization.") mobility1 = likert1("As a part of my present job plans, I want a promotion to a higher position at some" "point in the future.") mobility2 = likert1("It is important for me to progress in my present organization") safety1 = likert1("In this team, it is easy to discuss difficult issues and problems.") safety2 = likert1("I won't receive retaliation or criticism if I admit to an error or mistake.") safety3 = likert1("It is easy to ask a member of this team for help.") safety4 = likert1("I feel safe offering new ideas, even if they aren't fully informed plans.") team_safety1 = likert1("In this team, people are accepted for being different.") team_safety2 = likert1("My teammates welcome my ideas and give them time and attention.") team_safety3 = likert1("Members of this team could easily describe the value of other's contribution.") # Behavior voice1 = likert2("I develop and make recommendations concerning issues that affect my work group.") voice2 = likert2("I speak up and encourage others in my group to get involved in issues that affect the group.") voice3 = likert2("I communicate my opinions about work issues to others in my group even " "if my opinion is different and others in the group disagree with me.") voice4 = likert2("I keep well informed about issues where my opinion might be useful to my work group.") voice5 = likert2("I get involved in issues that affect the quality of work life here in my group.") voice6 = likert2("I speak up in my group with ideas for new projects or changes in procedures.") pass # PAGES class Questionnairep1(Page): form_model = "player" form_fields = ["size", "industry", "education", "check2", "occupation", "hierarchy", "income", "tenure", "hours", "issue", "check1"] pass class Questionnairep2(Page): form_model = "player" form_fields = ["motivation1", "motivation2", "motivation3", "motivation4", "motivation5", "motivation6", "motivation7", "motivation8", "motivation9", "motivation10"] pass class Questionnairep3(Page): form_model = "player" form_fields = ["commitment1", "commitment2", "commitment3", "commitment4", "commitment5", "commitment6", "mobility1", "mobility2"] pass class Questionnairep4(Page): form_model = "player" form_fields = ["trust1", "trust2", "trust3", "open1", "open2", "open3", "open4", "open5"] pass class Questionnairep5(Page): form_model = "player" form_fields = ["safety1", "safety2", "safety3", "safety4", "team_safety1", "team_safety2", "team_safety3"] pass class Questionnairep6(Page): form_model = "player" form_fields = ["voice1", "voice2", "voice3", "voice4", "voice5", "voice6"] pass page_sequence = [Questionnairep1, Questionnairep2, Questionnairep3, Questionnairep4, Questionnairep5, Questionnairep6]