from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from django.forms.widgets import CheckboxSelectMultiple doc = '' class Constants(BaseConstants): name_in_url = 'Questionaire_emc' players_per_group = None num_rounds = 1 risk_choices = [ [1, '1. I am willing to take no risks or minimal risks'], [2, '2. I am willing to take low risks'], [3, '3. I am willing to take moderate risks'], [4, '4. I am willing to take high risks'], [5, '5. I am willing to take very high risks'] ] class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): p.is_mcf = p.participant.vars['is_mcf'] class Group(BaseGroup): pass def make_01field(label, init): if (init == 0 or init == 1): return models.BooleanField( label=label, widget=widgets.RadioSelect, initial = init) else: return models.BooleanField( label=label, widget=widgets.RadioSelect) def make_radiofield(label, choices): return models.IntegerField( label = label, choices= choices, widget=widgets.RadioSelect) def make_likert5(label): return models.IntegerField( choices=[1,2,3,4,5], label=label, widget=widgets.RadioSelectHorizontal, ) def make_likert10(label): return models.IntegerField( choices=[0,1,2,3,4,5,6,7,8,9,10], label=label, widget=widgets.RadioSelectHorizontal, ) class Player(BasePlayer): is_mcf = models.BooleanField() # def set_MCF(self): # self.ismcf = self.participant.vars.get('ismcf') # MCFScholar = models.IntegerField( # choices=[[1, 'Yes'], [0, 'No']], # label='Are you a MasterCard Foundation Scholar?', # widget=widgets.RadioSelect) OtherScholar = models.IntegerField( choices=[[1, 'Yes'], [0, 'No']], label='Before joining MCF, were you a member of another scholarship program or group that engaged its members to participate in different activities?', widget=widgets.RadioSelect) Group_on_campus = models.IntegerField( choices=[[1, 'Yes'], [0, 'No']], label='On campus, do you belong to any formal or informal group? Group can be e.g. Academic and educational, Political & culture, Recreation & sports, Religious, Student government, Community service etc.', widget=widgets.RadioSelect) Question_3 = models.IntegerField( choices=[ [1, 'Academic and educational'], [2, 'Political'], [3, 'Recreation & sports'], [4, 'Student governance'], [5, 'Community service'], [6, 'Cultural'] , [7, "Ethnic or linguistic"], [8, 'Religious'], [9, 'Other']], label='Please choose the type of group you feel most associated with: ', widget=widgets.RadioSelect) Question_3_other = models.StringField(blank=True, label= 'If you chose Other, please specify' ) # Q4_religion = make_01field(label="Religion", init = "") # Q4_country = make_01field("Country", init="") # Q4_gender = make_01field("Gender", init="") # Q4_ethnic = make_01field("Ethnic or linguistic background/ race/caste/tribe", init="") Question_5 = models.IntegerField( label='Does your group work with or interact with other groups within the campus?', choices=[[0, "No"],[1, "Yes, occasionally"],[2, "Yes, frequently"]], widget=widgets.RadioSelect, ) Question_6 = models.IntegerField( label='Can you easily make new friends in your group?', choices=[[0, "No"],[1, "Yes"]], widget=widgets.RadioSelect, ) Question_7 = models.IntegerField( label='About how many close friends do you have in your group? These are people you feel at ease with, can talk to about private matters, or call on for help.', choices=[[0, "0"], [1, "1"], [2, "2"], [3, "3"], [4, "4"], [5, "5"], [6, "More than 5"]], widget=widgets.RadioSelect, ) Question_8 = models.IntegerField( label='If you suddenly needed to borrow a small amount of money, are there people in your group to whom you could turn and who would be willing and able to provide this money?', choices=[[0, "No"],[1, "Yes"]], widget=widgets.RadioSelect, ) # Question_9 differences = models.IntegerField( choices=[ [1, 'Very few such differences exist in my group'], [2, 'Few such differences exist in my group'], [3, 'Neither many nor few differences exist in my group'], [4, 'Many such differences exist in my group'], [5, 'Very many such differences exist in my group.']], label = "", widget=widgets.RadioSelect) #Question_10 diff_hinder = models.IntegerField( choices=[[1, 'Yes'], [0, 'No']], label = "", widget=widgets.RadioSelect) Q11_education = make_01field(label="Differences in the level of education", init= "") Q11_wealth = make_01field("Differences in wealth/material possessions", init= "") Q11_status = make_01field("Differences in social status", init= "") Q11_gender = make_01field("Differences between genders", init= "") Q11_young = make_01field(label="Differences between younger and older scholars", init= "") # Q11_junior = make_01field("Differences between senior and junior scholars", init= "") Q11_political = make_01field("Differences in political party affiliations", init= "") Q11_religion = make_01field("Differences in religious beliefs ", init= "") Q11_ethnic = make_01field(label="Differences in ethnic or linguistic background/ race/caste/tribe", init= "") # Q11_notsay = make_01field("Prefer not to say", init= 0) # Question_12 communicated = models.IntegerField( choices=[[0, '0 times'], [1, 'Once'], [2, 'Twice'], [3, '3-5 times'], [4, 'More than 5 times']], label='How often have you communicated in the past month with people in your group via online platform e.g. Zoom, Google meet, WhatsApp call/video call and other related mediums?', widget=widgets.RadioSelect) # Question_13 # risk1 = make_radiofield( # label = "Generally speaking, would you say that you are a person willing to take risks or you are rather someone that avoids risks? Rank yourself on a 5-point scale.", # choices = Constants.risk_choices # ) risk1 = models.IntegerField( label = "How do you see yourself? Are you generally a person who is fully willing to take risks or do you try to avoid taking risks? Please tick a box on the scale below, where 0 means 'risk averse/try to avoid taking risks' and 10 means 'fully prepared to take risks':", choices= [0,1,2,3,4,5,6,7,8,9,10], widget= widgets.RadioSelectHorizontal) # Questions Likert - Other risks risk2 = make_likert10(label = " - while driving?") risk3 = make_likert10(label = " - in financial matters?") risk4 = make_likert10(label = " - during leisure and sport? ") risk5 = make_likert10(label = " - in your occupation? ") risk6 = make_likert10(label = " - with other people? ") risk7 = make_likert10(label = " - your faith in other people? ") # trust other students questions using the slider trust_people = make_likert10(label="") trust_scale_general = make_likert10(label = "- In general") trust_scale_family = make_likert10(label = "- With family members") trust_scale_students = make_likert10(label = "- With other students") # Questions Likert Trust trust1 = make_likert5(label = "Most people who are in your group can be generally trusted") trust2 = make_likert5(label = "In your group, one must be alert or someone is likely to take advantage of you.") trust3 = make_likert5(label = "Most people in your group are willing to help if you need it") trust4 = make_likert5(label = "In your group, people generally do not trust each other in matters of lending and borrowing money") trust_group = models.IntegerField( choices=[ [1, 'I do not trust them'], [2, 'I have minimal trust for them'], [3, 'I have moderate trust for them'], [4, 'I have high trust for them'], [5, 'I have very high trust for them' ]], label='How much do you trust people in your group?', widget=widgets.RadioSelect) reciproc1 = make_likert5(label = "If someone does me a favour, I am prepared to return it") reciproc2 = make_likert5(label = "If somebody puts me in a difficult position, I will do the same to him/her") reciproc3 = make_likert5(label = "I go out of my way to help somebody who has been kind to me before") reciproc4 = make_likert5(label = "I am ready to undergo personal costs to help somebody who helped me before") covid_help = models.IntegerField( choices=[ [1, 'People never help'], [2, 'People rarely help'], [3, 'People help sometimes'], [4, 'People help most of the time'], [5, 'People always help'] ], label='How well do people in your group help each other out during these days, under the covid-19 pandemic?' , widget=widgets.RadioSelect) you_helped = models.IntegerField( choices=[ [0, '0 times'], [1, 'Once'], [2, 'Twice'], [3, '3-5 times'], [4, 'More than 5 times']], label='In the past 5 months did you voluntarily participate in any activity within or outside your group, in which you assisted with something for the benefit of others? E.g. mentoring, tutoring, counselling, or donations.', widget=widgets.RadioSelect) group_cooperate = models.IntegerField( choices=[ [1, 'People are very unlikely to cooperate'], [2, 'People are somewhat unlikely to cooperate'], [3, 'People are neither likely nor unlikely to cooperate'], [4, 'People are somewhat likely to cooperate'], [5, 'People are very likely to cooperate'] ], label='Are people in your group willing to cooperate and come together to work for a common purpose? For example, working voluntarily for a community orphanage or when there is a problem in your group.', widget=widgets.RadioSelect) contribute_time = models.IntegerField( choices=[ [0, 'Will not contribute time'], [1, 'Will contribute time'] ], label='If a campus project does not directly benefit you but has benefits for many others on campus, would you contribute time to the project? ', widget=widgets.RadioSelect) contribute_material = models.IntegerField( choices=[ [0, 'Will not contribute money/material things'], [1, 'Will contribute money/material things']], label='If a campus project does not directly benefit you but has benefits for many others on campus, would you contribute money/material things to the project?', widget=widgets.RadioSelect) ## Demographic questions age = models.IntegerField(label='What is your age? ', min=0, max=70) gender = models.IntegerField( choices=[[1, 'Male '], [2, 'Female'], [3, 'Other'], [4, 'Prefer not to say']], label='What gender do you identify as?', widget=widgets.RadioSelectHorizontal ) ethnicity = models.IntegerField( choices=[[1, 'Black'], [2, 'Coloured'], [3, 'White'], [4, 'Indian/Asian'], [5, 'Other'], [6, 'Prefer not to say']], label='What is your ethnicity.', widget=widgets.RadioSelectHorizontal) country = models.StringField(label='What is your country of origin?') society = models.IntegerField( choices=[[1, 'Rural'], [2, 'Semi-urban'], [3, 'Urban']], label='Please specify the description of the society you come from in your country of origin.', widget=widgets.RadioSelectHorizontal) size_family = models.IntegerField(label='What is the size of your parental family?') education = models.IntegerField( choices=[[1, 'Undergraduate'], [2, 'Honours'], [3, 'Masters'], [4, 'PhD or higher']], label='What is your level of study?', widget=widgets.RadioSelectHorizontal) status = models.IntegerField( choices=[[1, 'Single'], [2, 'Married'], [3, 'Divorced'], [4, 'Widowed/widower'], [5, 'separate/entanglement'], [6, 'Cohabiting'], [7, 'Prefer not to say']], label='What is your marital status?', widget=widgets.RadioSelectHorizontal) elections = models.IntegerField( label='Do you participate in the national elections of your country? e.g., taking part in voting for new leaders.', choices=[[0, "No"],[1, "Yes"]], widget=widgets.RadioSelect, ) political = models.IntegerField( choices=[[1, 'Very conservative'], [2, 'Slightly conservative'], [3, 'Slightly liberal'], [4, 'Very liberal'], [5, 'Prefer not to say']], label='How would you describe your political view?', widget=widgets.RadioSelectHorizontal) religion = models.IntegerField( choices=[[1, 'Christianity'], [2, 'Judaism'], [3, 'Islam'], [4, 'Buddhism'], [5, 'Hinduism'], [6, 'Other'], [7, 'None'], [8, 'Prefer not to say']], label='If applicable, please specify your religion.', widget=widgets.RadioSelect)