from otree.api import *
DEBUG = True #######IMPORTANT: Set to False for real experiment & controlstages working / True
doc = """
Read quiz questions from a CSV (simple version).
See also the 'complex' version of this app.
"""
class C(BaseConstants):
NAME_IN_URL = 'norms_receiver'
PLAYERS_PER_GROUP = None
NUM_ROUNDS = 1
TREATMENT = 2 ###Set 1 for Incentivized, 2 for Non-incentivized
INCENTIVE = "awesome_norms/incentive.html"
NON_INCENTIVE = "awesome_norms/noincentive.html"
COLORS = ['Weiß', 'Schwarz', 'Rot', 'Pink', 'Grün', 'Blau']
class Subsession(BaseSubsession):
pass
class Group(BaseGroup):
pass
class Player(BasePlayer):
Weiß = models.BooleanField(blank=True)
Schwarz = models.BooleanField(blank=True)
Rot = models.BooleanField(blank=True)
Pink = models.BooleanField(blank=True)
Grün = models.BooleanField(blank=True)
Blau = models.BooleanField(blank=True)
prolificID = models.StringField(
label="Please enter your Prolific ID here:",
)
norms_pre1 = models.IntegerField(
label="1) How appropriate do you personally believe it is to make a fair offer to the Receiver (Option C or D)??",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_pre2 = models.IntegerField(
label="2) Which option do you think the majority of participants chose in the preceding question? If your answer matches the actual option of the majority you will earn an additional $0.25?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_pre3 = models.IntegerField(
label="3) How appropriate do you personally believe it is to make a low offer the Receiver (Option A or B)??",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_pre4 = models.IntegerField(
label="4) Which option do you think the majority of participants chose in the preceding question? If your answer matches the actual option of the majority you will earn an additional $0.25?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
empirical_pre = models.IntegerField(
label="Do you expect that the majority of others provide a fair share to the Receiver (Option C or D)?",
choices=[
[1, "yes"],
[2, "no"],
],
widget=widgets.RadioSelectHorizontal,
)
split = models.IntegerField(
label="Which option do you choose?",
choices=[
[1, "A = £2.25 for me and £0.25 for the Receiver"],
[2, "B = £2.00 for me and £0.50 for the Receiver"],
[3, "C = £1.50 for me and £1.00 for the Receiver"],
[4, "D = £1.25 for me and £1.25 for the Receiver"],
[5, "E = £1.00 for me and £1.50 for the Receiver"],
[6, "F = £0.50 for me and £2.00 for the Receiver"],
[7, "G = £0.25 for me and £2.25 for the Receiver"],
],
widget=widgets.RadioSelect,
)
norms_post1 = models.IntegerField(
label="1) How appropriate do you personally believe it is to make a fair offer to the Receiver (Option C or D)?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_post2 = models.IntegerField(
label="2) Which option do you think the majority of participants chose in the preceding question? If your answer matches the actual option of the majority you will earn an additional $0.25?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_post3 = models.IntegerField(
label="3) How appropriate do you personally believe it is to make a low offer to the Receiver (Option A or B)?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
norms_post4 = models.IntegerField(
label="4) Which option do you think the majority of participants chose in the preceding question? If your answer matches the actual option of the majority you will earn an additional $0.25?",
choices=[
[1, "very inappropriate"],
[2, "somewhat inappropriate"],
[3, "somewhat appropriate"],
[4, "very appropriate "],
],
widget=widgets.RadioSelectHorizontal,
)
empirical_post = models.IntegerField(
label="Do you expect that the majority of others provide a fair share to the Receiver (Option C or D)?",
choices=[
[1, "yes"],
[2, "no"],
],
widget=widgets.RadioSelect,
)
age = models.IntegerField(
label="What is your age?",
max=100,
min=16
)
gender = models.IntegerField(
label="Which gender do you feel you belong to?",
choices=[
[1, "female"],
[2, "male"],
[3, "non-binary"]
],
)
educ = models.IntegerField(
label="Please select the highest educational qualification you have achieved so far",
choices=[
[1, "Student at school"],
[2, "School finished without graduation"],
[3, "Secondary school diploma"],
[4, "Completed apprenticeship"],
[5, "High school diploma"],
[6, "University degree (Bachelor)"],
[7, "University degree (Master)"],
[8, "PhD"],
],
widget=widgets.RadioSelect,
)
work = models.StringField(
label="Are you currently working?",
choices=[
[1, "Yes, full-time"],
[2, "Yes, part-time"],
[3, "No"],
],
widget=widgets.RadioSelect,
)
job = models.StringField(
label="Which of the following best describes your role at work?",
choices=[
[1, "Upper Management"],
[2, "Trained Professional"],
[3, "Middle Management"],
[4, "Skilled Laborer"],
[5, "Junior Management"],
[6, "Consultant"],
[7, "Administrative Staff"],
[8, "Temporary Employee"],
[9, "Support Staff"],
[10, "Researcher"],
[11, "Student"],
[12, "Self-employed/Partner"],
[13, "Other"],
[14, "Not working"],
],
widget=widgets.RadioSelect,
)
student = models.IntegerField(
label="Studieren Sie aktuell?",
choices=[
[1, "Ja"],
[2, "Nein"],
],
widget=widgets.RadioSelect,
)
major = models.StringField(
label="Bitte geben Sie Ihren aktuellen Studiengang / Beruf an.",
)
comment = models.LongStringField(
blank=True,
label="Is there anything else you would like to tell us? (optional)",
)
#Seite MoralFoundation
TREATED = models.IntegerField(
label="Whether or not someone suffered emotionally",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
UNFAIRLY = models.IntegerField(
label="Whether or not someone acted unfairly",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
RIGHTS = models.IntegerField(
label="Whether or not someone was denied his or her rights ",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
LOVECOUNTRY = models.IntegerField(
label="Whether or not someone’s action showed love for his or her country ",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
BETRAY = models.IntegerField(
label="Whether or not someone did something to betray his or her group",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
LOYALTY = models.IntegerField(
label="Whether or not someone showed a lack of loyalty ",
choices=[
[0, "not at all relevant (This consideration has nothing to do with my judgments of right and wrong)"],
[1, "not very relevant"],
[2, "slightly relevant"],
[3, "somewhat relevant"],
[4, "very relevant"],
[5, "extremely relevant (This is one of the most important factors when I judge right and wrong)"],
],
widget=widgets.RadioSelect,
)
FAIRLY = models.IntegerField(
label="When the government makes laws, the number one principle should be ensuring that everyone is treated fairly.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
JUSTICE = models.IntegerField(
label="Justice is the most important requirement for a society.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
RICH = models.IntegerField(
label="I think it’s morally wrong that rich children inherit a lot of money while poor children inherit nothing.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
HISTORY = models.IntegerField(
label="I am proud of my country’s history.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
FAMILY = models.IntegerField(
label="People should be loyal to their family members, even when they have done something wrong.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
TEAM = models.IntegerField(
label="It is more important to be a team player than to express oneself.",
choices=[
[0, "strongly disagree"],
[1, "moderately disagree"],
[2, "slightly disagree"],
[3, "slightly agree"],
[4, "moderately agree"],
[5, "strongly agree"],
],
widget=widgets.RadioSelect,
)
Connect = models.IntegerField(
label="To what extent did you feel connected to the other participant (your assigned partner)? (1=not connected at all; 5=very connected)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Rezipro = models.IntegerField(
label="How much did you consider the potential decision of the other Divider (your assigned partner) when making your decision about the share? (1=not considered at all; 5=strongly considered)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
AC1 = models.IntegerField(
label="Click on the option 4 on the following scale. (1=disagree strongly; 5=agree strongly)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Agreement = models.IntegerField(
label="To what extent do you think there is an agreement on how to behave in the situation regarding the share of money? (1=strong disagreement; 5=strong agreement)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Moral = models.IntegerField(
label="How much did you consider whether your decision was morally correct when deciding about the share of money? (1=considered not at all; 5=considered strongly)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Belong = models.IntegerField(
label="I have a strong need to belong. (1=strongly disagree; 5=strongly agree)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Belong2 = models.IntegerField(
label="I always like to know what others in a similar situation would do. (1=disagree strongly; 5=agree strongly)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
AC2 = models.IntegerField(
label="Click on the option 2 on the following scale. (1=disagree strongly; 5=agree strongly)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Compare = models.IntegerField(
label="I am not the type of person who often compares myself with others. (1=disagree strongly; 5=agree strongly)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
IdPar = models.IntegerField(
label="How strong do you identify yourself with your assigned partner? (1=not at all; 5=very much)",
choices=[
[1, "1"],
[2, "2"],
[3, "3"],
[4, "4"],
[5, "5"],
],
widget=widgets.RadioSelectHorizontal,
)
Consc = models.IntegerField(
label="Have you conscientiously participated in the experiment and answered the questions of the study so that we can use your data for research? The answer to this question has no consequences for you. It only helps us to better assess the data from the study.",
choices=[
[0, "Yes, I participated conscientiously."],
[1, "No, I just wanted to have a look and/or clicked through."],
],
widget=widgets.RadioSelect,
)
Instruction = models.IntegerField(
label="Did you find the instructions easy to understand?",
choices=[
[0, "Yes"],
[1, "No"],
],
widget=widgets.RadioSelect,
)
def prolificID_error_message(player, value):
if len(value) != 24:
return "Ihre Prolific ID muss 24 Zeichen (Buchstaben & Zahlen) lang sein."
class Welcome(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class ProlificID(Page):
form_model = 'player'
form_fields = ['prolificID']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Introduction(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Check(Page):
form_model = 'player'
form_fields = ['Weiß', 'Schwarz', 'Rot', 'Pink', 'Grün', 'Blau']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Instructions(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Personal_Norm_Pre(Page):
form_model = 'player'
form_fields = ['norms_pre1', 'norms_pre2']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Personal_Norm_Pre_4_Item(Page):
form_model = 'player'
form_fields = ['norms_pre1', 'norms_pre2', 'norms_pre3', 'norms_pre4']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Empirical_Norm_pre(Page):
form_model = 'player'
form_fields = ['empirical_pre']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Dictator(Page):
form_model = 'player'
form_fields = ['split']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Personal_Norm_Post_2_Item(Page):
form_model = 'player'
form_fields = ['norms_post1', 'norms_post2']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Personal_Norm_Post_4_Item(Page):
form_model = 'player'
form_fields = ['norms_post1', 'norms_post2', 'norms_post3', 'norms_post4']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Empirical_Norm_post(Page):
form_model = 'player'
form_fields = ['empirical_post']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class QuestionnaireWelcomePage(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Role(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Questions(Page):
form_model = 'player'
form_fields = ['Instruction', 'Connect', 'AC1', 'Agreement', 'AC2', 'IdPar']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Questions2(Page):
form_model = 'player'
form_fields = ['Belong', 'Belong2', 'Compare', 'AC2', 'IdPar']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Demographics(Page):
form_model = 'player'
form_fields = ['age', 'gender', 'educ', 'work', 'job', 'Consc', 'comment']
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class MoralFoundation(Page):
form_model = 'player'
form_fields = ['TREATED',
'UNFAIRLY',
'RIGHTS',
'LOVECOUNTRY',
'BETRAY',
'LOYALTY',
'FAIRLY',
'JUSTICE',
'RICH',
'HISTORY',
'FAMILY',
'TEAM'
]
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
class Final(Page):
@staticmethod
def is_displayed(player: Player):
return player.round_number == 1
page_sequence = [Welcome,
ProlificID,
#Introduction,
#Check,
Instructions,
Role,
#Personal_Norm_Pre,
#Personal_Norm_Pre_4_Item,
#Empirical_Norm_pre,
#Dictator,
Personal_Norm_Post_2_Item,
#Personal_Norm_Post_4_Item,
Empirical_Norm_post,
QuestionnaireWelcomePage,
MoralFoundation,
Questions,
Demographics,
Final,
]
##### Important: Set "PARTICIPANT_FIELDS = ['quiz_num_correct']" in settings.py !!
##### Vor Experiment: Set Treatment, DEBUG == False 'ComprehensionChecksReplication' oder 'ComprehensionChecksAdaptation' ausgrauen