from otree.api import * doc = """ survey questions """ class C(BaseConstants): NAME_IN_URL = 'survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass # Functions def make_survey_question(label): return models.LongStringField(label=label) class Player(BasePlayer): gender = models.IntegerField( choices=[ [1, 'Male'], [2, 'Female'], [3, "Other"] ], label="1. What is your gender?", widget=widgets.RadioSelect ) age = models.IntegerField(label="2. What is your age?") grade = models.IntegerField( choices=[ [1, 'Freshman'], [2, 'Sophomore'], [3, 'Junior'], [4, 'Senior'], [5, 'Graduate'] ], label="3. Which year are you in?", widget=widgets.RadioSelect ) major = models.StringField(label="4. What is your major?") reasoning = make_survey_question("5. What factors influenced your choice of the probability of action A to pick in each round?") interior = make_survey_question("6. Did you ever choose a probability of action A that was not 0 or 100? If so, why? If not, why not?") belief = models.FloatField(min=0, max=1, label="7. What do you think the average probability that others will choose as their probability of playing action A?") free_riding = models.FloatField(min=0, max=1, label="8. Suppose you knew everyone else in your group's realized action was action A. What probability would you select to play action A?") altruism = models.FloatField(min=0, max=1, label="9. Suppose you knew everyone else in your group's realized action was action B. What probability would you select to play action A?") pivotality = models.FloatField(min=0, max=1, label="10. Suppose you knew 1 other in your group's realized actions was action A and 3 others in your group's realized action was action B. What probability would you select to play action A?") clarity = models.IntegerField( choices=[ [1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Agree'], [4, 'Strongly Agree'], [5, "Don't know"] ], widget=widgets.RadioSelectHorizontal, label='11. The instructions for the experiment were clear and easy to follow.' ) feedback = make_survey_question("12. Is there anything else you would like to share with us?") # PAGES class Survey(Page): form_model = 'player' form_fields = [ 'gender', 'age', 'grade', 'major', 'reasoning', 'interior', 'belief', 'free_riding', 'altruism', 'pivotality', # <-- sliders 'clarity', 'feedback' ] page_sequence = [Survey]