from otree.api import * doc = """ A few questions """ class C(BaseConstants): NAME_IN_URL = 'survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age?', min=16, max=99) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Other', 'Other']], label='What is your gender?', widget=widgets.RadioSelect, ) education = models.StringField( choices=[['High School', 'High School'], ['Bachelor', 'Bachelor'], ['Master', 'Master'], ['PhD', 'PhD'], ['Other', 'Other']], label='What is your highest level of education? (If currently enrolled, please choose the highest' ' degree received)', widget=widgets.RadioSelect, ) fairness = models.StringField( choices=[['Not at all important', 'Not at all important'], ['Slightly important', 'Slightly important'], ['Important', 'Important'], ['Fairly important', 'Fairly important'], ['Very important', 'Very important']], label='How important was fairness in your decision-making?', widget=widgets.RadioSelect, ) fair = models.BooleanField( label='Do you consider the other country‘s decision to be fair?', choices=[[True, 'Yes'], [False, 'No']] ) expectation = models.BooleanField( label='Did you expect the other country to contribute its points?', choices=[[True, 'Yes'], [False, 'No']] ) different = models.BooleanField( label='If given the chance, would you choose differently in a second round?', choices=[[True, 'Yes'], [False, 'No']] ) motives = models.StringField( choices=[['Fairness', 'Fairness'], ['Profit-Maximization', 'Profit-Maximization'], ['Revenge', 'Revenge'], ['Guilt', 'Guilt'], ['Responsibility', 'Responsibility'], ['Empathy', 'Empathy'], ['Regret', 'Regret'], ['None ot the above', 'None of the above']], label='What motive was most present in your decision-making?', widget=widgets.RadioSelect, ) class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'education', 'fairness', 'fair', 'expectation', 'different'] page_sequence = [Demographics]