from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = 'Mask reluctance survey for ABE assignment' class Constants(BaseConstants): name_in_url = 'MaskOn' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): treatment = models.StringField() treatments = models.StringField() def creating_session(self): import itertools treatments = itertools.cycle(['T','C']) for p in self.get_players(): p.treatment = next(treatments) class Group(BaseGroup): def my_method(self): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age', max=125, min=13) gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female']], label='What is your gender', widget=widgets.RadioSelect) RecentMaskUse = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Did you wear a mask the last time you went outside your house?', widget=widgets.RadioSelect) MaskFeedback = models.LongStringField(blank=True, label='What are the places where you feel that there is no direct impact of mask use on your health status?') GovtSatisfaction = models.IntegerField(choices=[[5, 'Extremely Satisfied'], [4, 'Somewhat Satisfied'], [3, 'Neutral'], [2, 'Somewhat Dissatisfied'], [1, 'Extremely Dissatisfied']], label='How satisfied are you with the overall performance of the Indian government since 2014?', widget=widgets.RadioSelect) MaskSafety = models.IntegerField(choices=[[5, 'Very safe'], [4, 'Somewhat safe'], [3, 'Neutral'], [2, 'Somewhat unsafe'], [1, 'Very unsafe']], label='How safe do you feel while wearing a face-mask in public?', widget=widgets.RadioSelect) MaskEffectiveness = models.IntegerField(choices=[[5, 'Very effective'], [4, 'Somewhat effective'], [3, 'Neutral'], [2, 'Not that effective'], [1, 'Not effective at all']], label='How effective do you think are facemasks in preventing the spread of coronavirus?', widget=widgets.RadioSelect) treatment = models.StringField() SatisfactionWithStateGovt = models.LongStringField(choices=[['5', 'Very satisfied'], ['4', '4']], label='How satisfied are you with the state govt?', widget=widgets.RadioSelect) def randomize_round(self): pass