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 ) 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 ) size = models.StringField( label='What is the size of your main employer based on total number of employees?', choices=["<10", "10-49", "50-249", "250-499", "500-999", ">1000"], widget=widgets.RadioSelect ) sector = 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', ], ) 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'] ) contract_hours = models.IntegerField( label='How many hours do you contractually work for your main employer over a week?') 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") 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 ) issue = models.StringField( label='Are there any specific issues that you feel are particularly important for your company to address?' ) 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.") 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.") pass # PAGES class Questionnairep1(Page): form_model = "player" form_fields = ["education", "size", "sector", "hierarchy", "income", "contract_hours", "issue"] 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 = ["voice1", "voice2", "voice3", "voice4", "voice5", "voice6"] pass class Questionnairep4(Page): form_model = "player" form_fields = ["trust1", "trust2", "trust3"] pass page_sequence = [Questionnairep1, Questionnairep2, Questionnairep3, Questionnairep4]