from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = '' class Constants(BaseConstants): name_in_url = 'term_paper_copy' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): import itertools t = itertools.cycle(['T1', 'T2', 'C']) e = itertools.cycle([0, 1]) for p in self.get_players(): p.treatment_group = next(t) for p in self.get_players(): p.experimenter_effects = next(e) class Group(BaseGroup): pass class Player(BasePlayer): covid_positive = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Have you been infected by the coronavirus? ', widget=widgets.RadioSelect) age = models.StringField(choices=[['Below 18', 'Below 18'], ['18-35', '18-35'], ['36-55', '36-55'], ['56 above', '56 above']], label='Age (in years)', widget=widgets.RadioSelectHorizontal) gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female'], ['Other', 'Other']], label='Gender', widget=widgets.RadioSelectHorizontal) marital_status = models.StringField(choices=[['Married (or has partners)', 'Married (or has partners)'], ['Single (or divorced)', 'Single (or divorced)']], label='Marital status', widget=widgets.RadioSelectHorizontal) religion = models.StringField(choices=[['Christian ', 'Christian '], ['Buddhist ', 'Buddhist '], ['Hindu', 'Hindu'], ['Muslim', 'Muslim'], ['Others', 'Others'], ['No religion', 'No religion'], ['Prefer not to say', 'Prefer not to say']], label='Religious identity', widget=widgets.RadioSelectHorizontal) family_members = models.IntegerField(label='Number of family members', min=0) income = models.FloatField(label='Monthly family income after tax (in US dollars)', min=0) education = models.StringField(choices=[['Class X', 'Class X'], ['Class XII', 'Class XII'], ['Bachelor degree', 'Bachelor degree'], ['Master degree and above', 'Master degree and above']], label='Highest education level', widget=widgets.RadioSelectHorizontal) health_insurance = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Do you have health insurance?', widget=widgets.RadioSelectHorizontal) knowledge_symptoms1 = models.StringField(blank=True, choices=[['Cough', 'Cough']], label='1.', widget=widgets.RadioSelect) knowledge_symptoms2 = models.StringField(blank=True, choices=[['shortness of breath', 'shortness of breath']], label='2.', widget=widgets.RadioSelect) knowledge_symptoms3 = models.StringField(blank=True, choices=[['fever', 'fever']], label='3.', widget=widgets.RadioSelect) knowledge_symptoms4 = models.StringField(blank=True, choices=[['loss of taste and smell', 'loss of taste and smell']], label='4.', widget=widgets.RadioSelect) knowledge_symptoms5 = models.StringField(blank=True, choices=[['Watching movies', 'Watching movies']], label='5.', widget=widgets.RadioSelect) knowledge_symptoms6 = models.StringField(blank=True, choices=[["rashes on one's feet or body", "rashes on one's feet or body"]], label='6.', widget=widgets.RadioSelect) knowledge_symptoms7 = models.StringField(blank=True, choices=[['runny nose', 'runny nose']], label='7.', widget=widgets.RadioSelect) knowledge_symptoms8 = models.StringField(blank=True, choices=[['vomiting ', 'vomiting ']], label='8.', widget=widgets.RadioSelect) knowledge_symptoms9 = models.StringField(blank=True, choices=[['Dizziness', 'Dizziness']], label='9.', widget=widgets.RadioSelect) knowledge_symptoms10 = models.StringField(blank=True, choices=[['swelling in legs and feet', 'swelling in legs and feet']], label='10.', widget=widgets.RadioSelect) information_aversion = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Does the statement "I dislike bad news more than I like good news" apply to you?', widget=widgets.RadioSelect) chronic1 = models.StringField(blank=True, choices=[['Cardiovascular diseases (heart attacks and strokes)', 'Cardiovascular diseases (heart attacks and strokes)']], label='1.', widget=widgets.RadioSelect) chronic2 = models.StringField(blank=True, choices=[['Respiratory diseases (Obstructed pulmonary diseases and asthma)', 'Respiratory diseases (Obstructed pulmonary diseases and asthma)']], label='2.', widget=widgets.RadioSelect) chronic3 = models.StringField(blank=True, choices=[['Cancer', 'Cancer']], label='3.', widget=widgets.RadioSelect) chronic4 = models.StringField(blank=True, choices=[['Diabetes', 'Diabetes']], label='4.', widget=widgets.RadioSelect) chronic5 = models.StringField(blank=True, choices=[['Kidney', 'Kidney']], label='5.', widget=widgets.RadioSelect) chronic6 = models.StringField(blank=True, choices=[['Brain/Nervous system (Alzheimer, Parkinson, Dementia, Multiple sclerosis)', 'Brain/Nervous system (Alzheimer, Parkinson, Dementia, Multiple sclerosis)']], label='6.', widget=widgets.RadioSelect) chronic7 = models.StringField(blank=True, choices=[['Arthritis', 'Arthritis']], label='7.', widget=widgets.RadioSelect) chronic8 = models.StringField(blank=True, choices=[['HIV/AIDS', 'HIV/AIDS']], label='8.', widget=widgets.RadioSelect) chronic9 = models.StringField(blank=True, label='Other') compliance1 = models.IntegerField(label='Not going to work', max=5, min=1) compliance2 = models.IntegerField(label='Avoiding social gatherings', max=5, min=1) compliance3 = models.IntegerField(label="Maintaining a meter's distance while interacting with people", max=5, min=1) compliance4 = models.IntegerField(label='Wearing a mask', max=5, min=1) compliance5 = models.IntegerField(label='Washing hands frequently', max=5, min=1) compliance6 = models.IntegerField(label='Using hand sanitizer', max=5, min=1) compliance7 = models.IntegerField(label='Wearing gloves', max=5, min=1) compliance8 = models.IntegerField(label='Avoid spitting in public places', max=5, min=1) compliance9 = models.IntegerField(label='Traditional herbal remedies', max=5, min=1) compliance10 = models.IntegerField(label='Drinking hot water', max=5, min=1) compliance11 = models.IntegerField(label='Taking antibiotics', max=5, min=1) compliance12 = models.IntegerField(label='Drinking alcohol', max=5, min=1) country = models.StringField(choices=[['USA', 'USA'], ['India', 'India'], ['Brazil', 'Brazil'], ['Russia', 'Russia'], ['Peru', 'Peru'], ['Colombia', 'Colombia'], ['Mexico', 'Mexico'], ['South Africa', 'South Africa'], ['Spain', 'Spain'], ['Argentina', 'Argentina'], ['Others', 'Others']], label='Select the country you currently lived in.', widget=widgets.RadioSelect) knowledge_symptoms11 = models.StringField(blank=True, choices=[], label='11.', widget=widgets.RadioSelect) report_mild_symptoms = models.IntegerField(label='I will take treatment if I have mild symptoms.', max=5, min=1) report_severe_symptoms = models.IntegerField(label='I will take treatment if I have severe symptoms.', max=5, min=1) survey_key = models.IntegerField(label='Please enter the survey key here.') self_medication = models.IntegerField(label='I will not rely on self medication based on peer advice or other sources.', max=5, min=1) do_nothing = models.IntegerField(label='I will not do anything. ', max=5, min=1) nc1 = models.IntegerField(blank=True, label='I am going for regular checkups as earlier.', max=5, min=1) nc2 = models.IntegerField(blank=True, label='I did not postpone any scheduled surgery/ treatment. ', max=5, min=1) nc3 = models.IntegerField(blank=True, label="I am willing to take treatment but can't due to travel barriers during lockdown.", max=5, min=1) nc4 = models.IntegerField(blank=True, label='I am willing to take treatment but my hospital refused service. ', max=5, min=1) nc5 = models.IntegerField(blank=True, label='I am willing to switch to a new hospital if my previous hospital denied service.', max=5, min=1) nc6 = models.IntegerField(blank=True, label="I am willing to take treatment but my hospital has abruptly increased prices which I can't afford.", max=5, min=1) cf1 = models.StringField(choices=[['Strongly disagree', 'Strongly disagree'], ['Disagree', 'Disagree'], ['Neutral', 'Neutral'], ['Agree', 'Agree'], ['Strongly agree', 'Strongly agree']], label='I am very worried about the coronavirus outbreak. ', widget=widgets.RadioSelect) cf2 = models.StringField(choices=[['Strongly disagree', 'Strongly disagree'], ['Disagree', 'Disagree'], ['Neutral', 'Neutral'], ['Agree', 'Agree'], ['Strongly agree', 'Strongly agree']], label='For my personal health, I find coronavirus to be much more dangerous than the seasonal flu. ', widget=widgets.RadioSelect) cf3 = models.StringField(choices=[['Strongly disagree', 'Strongly disagree'], ['Disagree', 'Disagree'], ['Neutral', 'Neutral'], ['Agree', 'Agree'], ['Strongly agree', 'Strongly agree']], label='I feel health authorities are not doing enough or our healthcare system is unable to deal with the virus. ', widget=widgets.RadioSelect) cf4 = models.StringField(choices=[['Strongly disagree', 'Strongly disagree'], ['Disagree', 'Disagree'], ['Neutral', 'Neutral'], ['Agree', 'Agree'], ['Strongly agree', 'Strongly agree']], label="I am worried that I won't be able to keep my family safe from coronavirus. ", widget=widgets.RadioSelect) cf5 = models.StringField(choices=[['Strongly disagree', 'Strongly disagree'], ['Disagree', 'Disagree'], ['Neutral', 'Neutral'], ['Agree', 'Agree'], ['Strongly agree', 'Strongly agree']], label='I am worried that basic hygiene and social distancing are not enough to keep me safe from the virus. ', widget=widgets.RadioSelect) treatment_group = models.StringField() experimenter_effects = models.BooleanField()