from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'Survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): #name = models.StringField() #questionnaire 1 #1-1 rule = models.LongStringField( blank=False, widget=widgets.TextInput ) #1-2 fair1 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) fair2 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) fair3 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) fair4 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) #1-3 difficulty = models.StringField( choices=['Very Easy', 'Easy', 'Neither Easy nor Difficult', 'Difficult', 'Very Difficult'], widget=widgets.RadioSelectHorizontal ) zero = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) #1-4 demand1 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) demand2 = models.StringField( choices=['Yes', 'A was higher than B', 'B was higher than A'], widget=widgets.RadioSelectHorizontal ) price1 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) price2 = models.StringField( choices=['Yes', 'A was higher than B', 'B was higher than A'], widget=widgets.RadioSelectHorizontal ) #1-5 change1 = models.StringField( choices=['Strongly agree', 'Agree', 'Neutral', 'Disagree', 'Strongly disagree'], widget=widgets.RadioSelectHorizontal ) change2 = models.LongStringField( widget=widgets.TextInput ) # questionnaire 2 # questionnaire 3 age = models.IntegerField() def age_error_message(self, value): if value < 1900 or value > 2022: return "Please revise your number as a value between 1900 and 2022." gender = models.StringField( blank=True, choices=['Male', 'Female','Other'], widget=widgets.RadioSelect ) edu = models.StringField( blank=True, choices=['No schooling completed', 'Nursery school to 8th grade','9th-12th grade, no diploma','High school graduate-high school diploma or the equivalent (for example: GED)', 'Some collage credit, no degree', 'Associate degree (for example: AA, AS)', 'Bachelor\'s degree (for example: BA, AB, BS)', 'Master\'s degree (for example: MA, MS, MEng, Med, MSW, MBA)', 'Professional degree (for example: MD, DDS, DVM, LLB, JD)', 'Doctorate degree (for example: Phd, EdD)'], widget=widgets.RadioSelect ) job = models.StringField( blank=True, choices=['Employed for wages', 'Self-employed','Out of work and looking for work','Out of work but not currently looking for worker','A homemaker','A student','Retired','Unable to work'], widget=widgets.RadioSelect ) income = models.StringField( blank=True, choices=['Less than $20,000', '$20,000 to $40,000','$40,000 to $60,000','$60,000 to $80,000','$80,000 to $100,000','$100,000 or more'], widget=widgets.RadioSelect ) exp = models.IntegerField( blank=True ) ethnic = models.StringField( blank=True, choices=['White', 'Mixed/Multiple ethnic groups','Asian', 'Black/African','Other ethnic group'], widget=widgets.RadioSelect )