from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from otreeutils.surveys import create_player_model_for_survey, generate_likert_field, generate_likert_table author = 'Huanren Zhang' doc = """ survey questions """ class Constants(BaseConstants): name_in_url = 'dasgahea' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass # define a Likert 5-point scale with its labels likert_5_labels = ( 'Strongly disagree', 'Disagree', 'Neither agree nor disagree', 'Agree', 'Strongly agree' ) likert_7_labels = ( 'Strongly Disagree', 'Moderately Disagree', 'Slightly Disagree', 'Neutral', 'Slightly Agree', 'Moderately Agree', 'Strongly Agree' ) likert_5point_field = generate_likert_field(likert_5_labels) likert_7point_field = generate_likert_field(likert_7_labels) # define survey questions per page # for each page define a page title and a list of questions # the questions have a field name, a question text (input label), and a field type (model field class) SURVEY_DEFINITIONS = ( { 'page_title': '', 'survey_fields': [ generate_likert_table(('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'), [('barnum', '')], form_help_initial="""
Based on your responses to the previous questions and big data analysis, the computer has generated the following description of your personality:
You have a great need for other people to like and admire you. You have a tendency to be critical of yourself. You have a great deal of unused capacity which you have not turned to your advantage. While you have some personality weaknesses, you are generally able to compensate for them. Your sexual adjustment has presented problems for you. Disciplined and self-controlled outside, you tend to be worrisome and insecure inside. At times you have serious doubts as to whether you have made the right decision or done the right thing. You prefer a certain amount of change and variety and become dissatisfied when hemmed in by restrictions and limitations. You pride yourself as an independent thinker and do not accept others' statements without satisfactory proof. You have found it unwise to be too frank in revealing yourself to others. At times you are extroverted, affable, sociable, while at other times you are introverted, wary, reserved. Some of your aspirations tend to be pretty unrealistic. Security is one of your major goals in life.
On a scale of 1 (very poor) to 10 (excellent), how accurate do you consider the above statement as a description of your personality?
""", # HTML to be placed on top of form form_help_final='', # HTML to be placed below form table_row_header_width_pct=0, ), ] }, ) # now dynamically create the Player class from the survey definitions # we can also pass additional (non-survey) fields via `other_fields` Player = create_player_model_for_survey('barnum.models', SURVEY_DEFINITIONS, other_fields={ })