from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Alexander Schneeberger' doc = """ Concluding Questionaire and Results """ class Constants(BaseConstants): name_in_url = 'End' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): p.experiment = self.session.config['experiment'] p.participation_fee = c(self.session.config['participation_fee']) # For the Behavioral Experiment if p.experiment == 'BE': p.RFT_blue_bonus = c(self.session.config['RFT_blue_bonus']) p.RFT_yellow_bonus = c(self.session.config['RFT_yellow_bonus']) # For the Norm Elicitation Experiment if p.experiment == 'NEE': p.NE_bonus = c(self.session.config['NE_bonus']) class Group(BaseGroup): pass class Player(BasePlayer): # Questions - Page 2 age = models.IntegerField(blank=True) gender = models.StringField(blank=True, choices=['Male', 'Female', 'Other'], ) ethnicity = models.StringField(blank=True, choices=['White', 'Black', 'Hispanic', 'Asian', 'Other'], ) degree = models.StringField(blank=True, choices=['None', 'High school diploma', 'Bachelor’s degree', 'Master’s degree', 'Doctorate degree'], ) employment_status = models.StringField(blank=True, choices=['Full time employed', 'Part time employed', 'Unemployed', 'Self-employed', 'Student', 'Housewife / ' 'husband', 'Retired'], ) income = models.StringField(blank=True, choices=['$0 - $10,000', '$10,000 - $25,000', '$25,000 - $50,000', '$50,000 - $75,000', '$75,000 - $100,000', '$100,000 - $150,000', 'More than $150,000'], ) community = models.StringField(blank=True, choices=['Urban', 'Suburban', 'Rural'] ) religion = models.StringField(blank=True, choices=['Christian', 'Jew', 'Buddhist', 'Muslim', 'Hindu', 'Atheist', 'Other'], ) politics = models.StringField(blank=True, choices=['Very liberal', 'Liberal', 'Moderate', 'Conservative', 'Very conservative'], ) # Questions - Page 3 alternative_identification = models.IntegerField( choices=range(1, 11, 1) ) reason_rule_following = models.StringField() # Questions - Page 3 device = models.StringField(choices=['Desktop PC', 'Notebook', 'Tablet', "Cellphone", "Other"]) browser = models.StringField(choices=['Chrome', 'Safari', 'Firefox', "Other", "Unknown"]) understanding_problems = models.StringField(blank=True) technical_problems = models.StringField(blank=True) comments = models.StringField(blank=True) # For the Results Page experiment = models.StringField() participation_fee = models.CurrencyField() RFT_blue_bonus = models.CurrencyField() RFT_yellow_bonus = models.CurrencyField() NE_bonus = models.CurrencyField()