from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = '' class Constants(BaseConstants): name_in_url = 'pre_test' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): import itertools t = itertools.cycle(['T', 'C']) for p in self.get_players(): p.treatment_group = next(t) class Group(BaseGroup): pass class Player(BasePlayer): treatment_group = models.StringField() prevention_promotion_focus1 = models.StringField(choices=[['If I get into an accident, it is not necessary that I was at fault. And so, I must be extra cautious. ', 'If I get into an accident, it is not necessary that I was at fault. And so, I must be extra cautious. '], ['If I get into an accident, insurance will cover the damages. But I cannot stop going about my work. ', 'If I get into an accident, insurance will cover the damages. But I cannot stop going about my work. ']], label='There is a 0.02% chance of getting into a road accident (worldwide). ', widget=widgets.RadioSelect) prevention_promotion_focus2 = models.StringField(choices=[['So, I will be very cautious about what I eat or do. ', 'So, I will be very cautious about what I eat or do. '], ['However, I cannot do much about it, and I continue with my regular life. ', 'However, I cannot do much about it, and I continue with my regular life. ']], label='One in 5 men (6 women) worldwide develop cancer in their lifetime. If I develop cancer, it is a serious health problem and will impact me and my family adversely. ', widget=widgets.RadioSelect) prevention_promotion_focus3 = models.StringField(choices=[['So, I will take all possible precautions to avoid any respiratory problems while deciding on my travel plans. ', 'So, I will take all possible precautions to avoid any respiratory problems while deciding on my travel plans. '], ['I cannot control the air pollution levels. And I want to live life to the fullest, so I cannot consider this for my travel plans. ', 'I cannot control the air pollution levels. And I want to live life to the fullest, so I cannot consider this for my travel plans. ']], label='Levels of Air pollution have been increasing more than earlier. Deaths due to air-pollution related complexities are about 5 million (i.e. about 0.07% of world population) annually. ', widget=widgets.RadioSelect) loss_gain_perception1 = models.StringField(choices=[['Not following these precautionary steps will cause harm to me and my family.', 'Not following these precautionary steps will cause harm to me and my family.'], ['Following these precautionary steps will keep me and my family safe ', 'Following these precautionary steps will keep me and my family safe ']], label='Choose one of the two options which is more applicable to you:', widget=widgets.RadioSelect) loss_gain_perception2 = models.StringField(choices=[['Not following these precautionary steps will increase the workload on hospitals and someone might not get medical help. ', 'Not following these precautionary steps will increase the workload on hospitals and someone might not get medical help. '], ['Following these precautionary steps will decrease the workload on hospitals and medical help will always be available. ', 'Following these precautionary steps will decrease the workload on hospitals and medical help will always be available. ']], label='Choose one of the two options which is more applicable to you:', widget=widgets.RadioSelect) loss_gain_perception3 = models.StringField(choices=[['Not following these precautionary steps will increase the spread of the virus and the number of deaths will increase.', 'Not following these precautionary steps will increase the spread of the virus and the number of deaths will increase.'], ['Following these precautionary steps will stop the spread of the virus, and people will recover sooner. ', 'Following these precautionary steps will stop the spread of the virus, and people will recover sooner. ']], label='Choose one of the two options which is more applicable to you:', widget=widgets.RadioSelect) gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female'], ['Others', 'Others'], ['Prefer not to specify', 'Prefer not to specify']], label='Gender', widget=widgets.RadioSelect) age = models.StringField(choices=[['0-18', '0-18'], ['19-25', '19-25'], ['26-35', '26-35'], ['36-45', '36-45'], ['46-55', '46-55'], ['55 and above', '55 and above']], label='Age (in years)', widget=widgets.RadioSelect) geography = models.StringField(choices=[['Asian (Indian)', 'Asian (Indian)'], ['Asian (others)', 'Asian (others)'], ['European', 'European'], ['North American', 'North American'], ['South American', 'South American'], ['Australia-New Zealand', 'Australia-New Zealand']], label='Geography:', widget=widgets.RadioSelect) survey_code = models.IntegerField(label='Please enter the survey code here.')