from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import itertools doc = """ One player decides how to divide a certain amount between himself and the other player. See: Kahneman, Daniel, Jack L. Knetsch, and Richard H. Thaler. "Fairness and the assumptions of economics." Journal of business (1986): S285-S300. """ # verbesserung: Organisation auf UNICEF fixieren DONE; In Donation - Results: Bezug auf Lottery! DONE; # Noch eine Seite für die leute, die nicht gespendet haben nach dem WARUM (Radioselect mit einer # offenen Antwortmöglichkeit) mit "Don't Know / Prefer not to say" DONE_ALMOST; # Daueraufträge bei Part2:Survey miteinbeziehen --> Specific Donation zu Last Donation Payment ändern und dann den # Dauerauftrag miteinbeziehen (Abschluss des Dauerauftrags) DONE; # Questions about the strongest influence on donating behaviour als RadioSelect + offenes RadioSelect (freifeld) # welches "Event" und wer hat schlussendlich motiviert: Trennung von Situation und Person # klein schreiben und 'I feel a sense of ...' plus dann ändern auf "strongly agree", "partially agree", etc. DONE; # bei i want to change the next donation zu "Checkbox": Change Organisation, Change Amount of donation, change type # of donation (sachspende instead of monetary), change duration of dauerauftrag # (from one time donation to Dauerauftrag) DONE; # bei allgemein: Herkunftsland, Bildung DONE; # variablennamen ändern DONE; # felder mit enthalten überall einfügen DONE; # aus Integerfelder Stringfelder machen und Logiken anpassen DONE # moderately agree - Skalierung ändern evtl. (zu negativ) zu slightly agree # Wording der Fragen mit Markus besprechen DONE # currencyField = with .split(',') DONE (Testen) # das gleiche für countryField DONE class Constants(BaseConstants): name_in_url = 'dictator_altered' players_per_group = None num_rounds = 1 with open('dictator_altered/currency_list.csv') as currency_list_file: currencyList = currency_list_file.read().split('\n') with open('dictator_altered/country_list.csv') as country_list_file: countryList = country_list_file.read().split('\n') instructions_template = 'This template is a changed version of the dictator game.' # Initial amount allocated to the dictator endowment = c(20.00) class Subsession(BaseSubsession): def creating_session(self): color = itertools.cycle(['red', 'blue']) for p in self.get_players(): p.color = next(color) if p.color == 'red': # TreatmentGroupRED p.given = c(20) #NUDGE else: # ControlGroupBLUE p.given = None class Group(BaseGroup): pass class Player(BasePlayer): color=models.StringField() given=models.CurrencyField(min=0, max=Constants.endowment) def set_payoffs(self): player = self.get_player_by_id(1) organisation = Constants.endowment player.payoff = Constants.endowment - self.given organisation.payoff = self.given #Part11: Fixed to UNICEF #Part21 donation = models.StringField( choices=['Yes', 'No', 'Prefer not to say'], label='Have you already donated money to an organisation in the past?', widget=widgets.RadioSelect ) no_donation = models.StringField( choices=['I did not have the time to think about my donating behaviour', 'I mistrust the organisations I know', 'I avoid monetary donations in general', 'I can not afford monetary donations', 'Other reason', 'Prefer not to say'], label='What is the main reason for not having donated?', widget=widgets.RadioSelect ) #logik: other no_donation_reason = models.StringField( label='Please further specify the main reason for not having donated:' ) #logik: no donation no_donation_event = models.StringField( choices=['At street fairs, festivals, etc.', 'Being talked to while walking on the streets', 'Friends / Family asking me to donate money', 'Other (not specifically named here)', 'I would not make my donating decision dependent on any circumstance', 'Prefer not to say' ], label='Under which of the following circumstances would you consider making a monetary donation?', widget=widgets.RadioSelect ) #logik: other no_donation_event_other = models.StringField( label='Please specify the event where you would be inclined to make a monetary donation:' ) currency = models.StringField( choices=Constants.currencyList, label='Please select the currency of your last monetary donation:', ) amount_donation = models.IntegerField( label='What was the amount of the last donation payment / donation standing order (approximately)', min=0, max=5000 ) trust_organisation = models.StringField( choices=['Yes', 'No', 'Prefer not to say'], label='Do you generally trust the organisation this specific donation went to?', widget=widgets.RadioSelect ) #support_cause = models.StringField( # choices=['Yes', 'No', 'Prefer not to say'], # label='Do you trust that this specific donation will help the cause to which it was donated for?', # widget=widgets.RadioSelect #) # zuerst strongest_influence_event, dann level of influence #level_influence = models.StringField( # choices=['Strong influence', 'Moderate influence', 'Little influence', 'No influence', 'Prefer not to say'], # label='How strong do you think you were influenced to carry out this specific donation?', # widget=widgets.RadioSelectHorizontal #) strongest_influence_event = models.StringField( choices=['Yes, I was talked to at a social event such as a street fair, a festival, etc.', 'Yes, I was talked to while walking on the streets', 'Yes, other (not specifically named here)', 'No, my donating decision did not depend on a specific event', 'Prefer not to say' ], label='Did you finalize your donating decision at such an event?', widget=widgets.RadioSelect ) #logik: falls 'other' strongest_influence_event_other = models.StringField( label='Where/On what event were you influenced to carry out your donation:' ) strongest_influence_person = models.StringField( choices=['Yes, I was influenced by my family', 'Yes, I was influenced by friends', 'Yes, I was influenced by person/s who I did not know personally', 'Yes, I was influenced by the image of the organisation itself', 'Yes, other (not specifically named here)', 'No, I was mainly inherently motivated to donate', 'Prefer not to say' ], label='Do you think you were influenced by another person/group of persons to carry out your donation?' ' (please pick the strongest influence)', widget=widgets.RadioSelect ) #logik: falls 'other' strongest_influence_person_other = models.StringField( label='What person/group of persons influenced you the most to carry out the donation:' ) satisfaction = models.StringField( choices=['Totally agree', 'Moderately agree', 'Slightly agree', 'Disagree', 'Prefer not to say'], label='I felt a sense of satisfaction after donating money.', widget=widgets.RadioSelectHorizontal ) purpose = models.StringField( choices=['Totally agree', 'Moderately agree', 'Slightly agree', 'Disagree', 'Prefer not to say'], label='I believe that my donation helped the cause it was donated for.', widget=widgets.RadioSelectHorizontal ) #sozial erwünschtes verhalten? DONE social_acceptance = models.StringField( choices=['Totally agree', 'Moderately agree', 'Slightly agree', 'Disagree', 'Prefer not to say'], label='I feel that donating money is a desired social behaviour.', widget=widgets.RadioSelectHorizontal ) regret = models.StringField( choices=['Totally agree', 'Moderately agree', 'Slightly agree', 'Disagree', 'Prefer not to say'], label='In hindsight, I regret my decision of donating money.', widget=widgets.RadioSelectHorizontal ) change_donation = models.StringField( choices=['Yes', 'No', 'Prefer not to say'], label='Will you change something about your donating behaviour the next time you donate?', widget=widgets.RadioSelect ) #logik specific_change_donation = models.StringField( choices=[ 'The organisation I will donate to', 'The amount of money I will donate', 'The duration of the donation (for example swap from a "standing order donation" to a "one time donation")', 'The type of donation (for example clothes instead of money)', 'Other reason', 'Prefer not to say' ], label='I want to change:', widget=widgets.RadioSelect ) specific_change_donation_other = models.StringField( label='What will you change about your next donation?' ) #logik: Sprung zurück zu allen #Frage mit "Would you donate in following events: # multiple antworten möglich # motivation: Einordnung der leute (spende vs. nicht spende) beeinflussbar sind bzgl. Nudging age = models.IntegerField( label='What is your age?', min=10, max=125) gender = models.StringField( choices=['Male', 'Female', 'Other', 'Prefer not to say'], label='What is your gender?', widget=widgets.RadioSelect ) education = models.StringField( choices=['No schooling completed', 'Some high school, no diploma', 'High school graduate, diploma or the equivalent', 'Some college credit, no degree', 'Trade/technical/vocational training', 'Associate degree', "Bachelor's degree", "Master's degree", 'Professional degree', 'Doctorate degree', 'Prefer not to say'], label='What is the highest degree or level of school you have completed? ' 'If currently enrolled, highest degree already completed.' ) country = models.StringField( choices=Constants.countryList, label='Please select the country of your residency:', ) lottery = models.StringField( choices=['Yes', 'No'], label='Do you want to participate in the lottery?', widget=widgets.RadioSelect ) email = models.EmailField( label='Please enter your email-address to participate in the lottery:' )