from otree.api import * c = cu doc = '' class C(BaseConstants): PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 STARTING_POINTS = 100 JACKPOT_AMOUNT = 100 TIMEOUT = 15 NAME_IN_URL = 'wait_page_timeout' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def set_payoffs(group: Group): import random for player in group.get_players(): other_player = player.get_others_in_group()[0] if player.bid_amount == other_player.bid_amount: if random.choice([True, False]): player.winner = True other_player.winner = False else: player.winner = False other_player.winner = True else: if player.bid_amount>other_player.bid_amount: player.winner = True other_player = False else: player.winner = False other_player.winner = True if player.winner: player.payoff = C.STARTING_POINTS - player.bid_amount + C.JACKPOT_AMOUNT else: player.payoff = C.STARTING_POINTS - player.bid_amount class Player(BasePlayer): bid_amount = models.IntegerField(initial=0, label='How much will you spend?', max=C.STARTING_POINTS, min=0) final_points = models.FloatField(label='This is your final points ') winner = models.BooleanField(initial=False) question1_answer = models.IntegerField(choices=[[100, '100 (100 start - 150 spent + 100 for prize)'], [150, '150 (100 start - 50 spent + 100 for prize)'], [50, '50 (100 start - 50 spent)']], label='', widget=widgets.RadioSelect) question2_answer = models.IntegerField(choices=[[80, '80 (100 start - 20 spent)'], [170, '170 (100 start - 70 spent + 100 for prize) '], [130, '130 (100 start - 70 spent + 100 for prize) ']], label='', widget=widgets.RadioSelect) question3_answer = models.IntegerField(choices=[[100, '100 (100 start - 0 spent)'], [200, '200 (100 start – 100 spent + 100 for prize)'], [0, '0 (100 start - 100 spent)']], label='', widget=widgets.RadioSelect) all_correct = models.BooleanField(initial=False) q1 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='1.\tI like to be better than others at almost everything.', widget=widgets.RadioSelectHorizontal) q2 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='2.\tI get a lot of enjoyment out of competition.', widget=widgets.RadioSelectHorizontal) q3 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='3.\tOther people comment on how competitive I am.', widget=widgets.RadioSelectHorizontal) q4 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='4.\tI enjoy setting and beating goals through competition.', widget=widgets.RadioSelectHorizontal) q5 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='5.\tI don’t care if other people are better at things than I am.', widget=widgets.RadioSelectHorizontal) q6 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='6.\tNo matter what, I try to be better than others at things.', widget=widgets.RadioSelectHorizontal) q7 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='7.\tI am a competitive person.', widget=widgets.RadioSelectHorizontal) q8 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='8.\tI view almost every situation as a way to prove that I am better at things than others.', widget=widgets.RadioSelectHorizontal) q9 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='9.\tI can improve my competence by competing.', widget=widgets.RadioSelectHorizontal) q10 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='10.\tI put a lot of effort into beating others at things.', widget=widgets.RadioSelectHorizontal) q11 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='11.\tI love the thrill of competition.', widget=widgets.RadioSelectHorizontal) q12 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='12.\tBeing the best makes me feel powerful.', widget=widgets.RadioSelectHorizontal) q13 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='13.\tI don’t really care if I get beat in a competition.', widget=widgets.RadioSelectHorizontal) q14 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='14.\tCompetition motivates me.', widget=widgets.RadioSelectHorizontal) q15 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='15.\tFor as long I can remember, I have wanted to outperform others.', widget=widgets.RadioSelectHorizontal) q16 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='16.\tCompetition allows me to judge my level of competence.', widget=widgets.RadioSelectHorizontal) q17 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='17.\tI do not find competition self-fulfilling.', widget=widgets.RadioSelectHorizontal) q18 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='18.\tI think a lot about ways to win.', widget=widgets.RadioSelectHorizontal) q19 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='19.\tI enjoy beating others in almost every area in life.', widget=widgets.RadioSelectHorizontal) q20 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='20.\tI enjoy competing against others.', widget=widgets.RadioSelectHorizontal) q21 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='21.\tIt is important for me to outperform others.', widget=widgets.RadioSelectHorizontal) q22 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='22.\tI wouldn’t mind finishing in last place in a competition.', widget=widgets.RadioSelectHorizontal) q23 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='23.\tI use competition as a way to prove something to myself.', widget=widgets.RadioSelectHorizontal) q24 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='24.\tWinning makes me feel superior to others.', widget=widgets.RadioSelectHorizontal) q25 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='25.\tOther people notice how much I have to dominate others in a competition.', widget=widgets.RadioSelectHorizontal) q26 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='26.\tI like being the best compared to other people.', widget=widgets.RadioSelectHorizontal) q27 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='27.\tCompetition allows me to measure my own success.', widget=widgets.RadioSelectHorizontal) q28 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='28.\tI perform better when I compete against others.', widget=widgets.RadioSelectHorizontal) q29 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='29.\tI try to be the best person in the room at almost anything.', widget=widgets.RadioSelectHorizontal) q30 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='30.\tOthers notice that I am competitive.', widget=widgets.RadioSelectHorizontal) man_q31 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='1.\tI’d like to be kinder and more dependable than other men. ', widget=widgets.RadioSelectHorizontal) man_q32 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='2.\tI cannot stand very kind and compassionate men. ', widget=widgets.RadioSelectHorizontal) man_q33 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='3.\tI do my best to become a more forgiving and kind man. ', widget=widgets.RadioSelectHorizontal) man_q34 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='4.\tI look for negative points in kind and nice men. ', widget=widgets.RadioSelectHorizontal) man_q35 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='5.\tI’d like to be more attractive than other men. ', widget=widgets.RadioSelectHorizontal) man_q36 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='6.\tI cannot stand very attractive men. ', widget=widgets.RadioSelectHorizontal) man_q37 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='7.\tI do my best to become a sexier and more attractive man. ', widget=widgets.RadioSelectHorizontal) man_q38 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='8.\tI look for negative points in attractive men. ', widget=widgets.RadioSelectHorizontal) man_q39 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='9.\tI’d like to be more successful than other men. ', widget=widgets.RadioSelectHorizontal) man_q40 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='10.\tI cannot stand very successful and wealthy men. ', widget=widgets.RadioSelectHorizontal) man_q41 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='11.\tI do my best to become a more successful man. ', widget=widgets.RadioSelectHorizontal) man_q42 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='12.\tI look for negative points in successful men. ', widget=widgets.RadioSelectHorizontal) man_q43 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='13.\tI’d like to be smarter than other men. ', widget=widgets.RadioSelectHorizontal) man_q44 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='14.\tI cannot stand very intelligent and witty men. ', widget=widgets.RadioSelectHorizontal) man_q45 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='15.\tI do my best to become a more educated and smarter man. ', widget=widgets.RadioSelectHorizontal) man_q46 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='I look for negative points in smart and witty men. ', widget=widgets.RadioSelectHorizontal) woman_q31 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='1.\tI’d like to be kinder and more dependable than other women. ', widget=widgets.RadioSelectHorizontal) woman_q32 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='2.\tI cannot stand very kind and compassionate women. ', widget=widgets.RadioSelectHorizontal) woman_q33 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='3.\tI do my best to become a more forgiving and kind woman. ', widget=widgets.RadioSelectHorizontal) woman_q34 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='4.\tI look for negative points in kind and nice women. ', widget=widgets.RadioSelectHorizontal) woman_q35 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='5.\tI’d like to be more attractive than other women. ', widget=widgets.RadioSelectHorizontal) woman_q36 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='6.\tI cannot stand very attractive women. ', widget=widgets.RadioSelectHorizontal) woman_q37 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='7.\tI do my best to become a sexier and more attractive woman. ', widget=widgets.RadioSelectHorizontal) woman_q38 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='8.\tI look for negative points in attractive women. ', widget=widgets.RadioSelectHorizontal) woman_q39 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='9.\tI’d like to be more successful than other women. ', widget=widgets.RadioSelectHorizontal) woman_q40 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='10.\tI cannot stand very successful and wealthy women. ', widget=widgets.RadioSelectHorizontal) woman_q41 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='11.\tI do my best to become a more successful woman. ', widget=widgets.RadioSelectHorizontal) woman_q42 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='12.\tI look for negative points in successful women. ', widget=widgets.RadioSelectHorizontal) woman_q43 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='13.\tI’d like to be smarter than other women. ', widget=widgets.RadioSelectHorizontal) woman_q44 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='14.\tI cannot stand very intelligent and witty women. ', widget=widgets.RadioSelectHorizontal) woman_q45 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='15.\tI do my best to become a more educated and smarter woman. ', widget=widgets.RadioSelectHorizontal) woman_q46 = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='16.\tI look for negative points in smart and witty women. ', widget=widgets.RadioSelectHorizontal) direct_comp_man = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='I would engage in a physical fight between a man if they tried to strongly pursue my significant other/wife/husband', widget=widgets.RadioSelectHorizontal) direct_comp_woman = models.IntegerField(blank=True, choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very much)']], label='I would engage in a physical fight between a woman if they tried to strongly pursue my significant other/wife/husband', widget=widgets.RadioSelectHorizontal) timeout = models.FloatField() Age = models.IntegerField(label='1.\tWhat is your year of birth? ', max=2100, min=1940) Sex = models.StringField(choices=[['Female', 'Female'], ['Male', 'Male']], label='2.\tWhat is your sex at birth?', widget=widgets.RadioSelect) Sexual_Ori = models.StringField(blank=True, choices=[['Straight/Heterosexual', 'Straight/Heterosexual'], ['Gay or Lesbian', 'Gay or Lesbian'], ['Bisexual', 'Bisexual'], ['Other', 'Other']], label='3.\tWhich of the following best describes your sexual orientation?', widget=widgets.RadioSelect) other_sex_ori = models.StringField(blank=True, label="Please specify your sexual orientation (if selected 'other'):") Gender = models.BooleanField(blank=True, choices=[[True, 'Yes'], [False, 'No']], label='4.\tIs the gender you identify with the same as your sex registered at birth?') other_gender = models.StringField(blank=True, label='What gender do you currently identify as?') marriage_status = models.StringField(blank=True, choices=[['Never married and never registered a civil partnership ', 'Never married and never registered a civil partnership '], ['Separated, but still legally married ', 'Separated, but still legally married '], ['Separated, but still legally in a civil partnership ', 'Separated, but still legally in a civil partnership '], ['Married', 'Married'], ['In a registered civil partnership ', 'In a registered civil partnership '], ['Divorced ', 'Divorced '], ['Formerly in a civil partnership which is now legally dissolved ', 'Formerly in a civil partnership which is now legally dissolved '], ['Widowed', 'Widowed'], ['Surviving partner from a registered civil partnership', 'Surviving partner from a registered civil partnership'], ['Other', 'Other']], label='5.\tPlease state your legal marital or registered civil partnership status?', widget=widgets.RadioSelect) other_marriage = models.StringField(blank=True, label="Please specify your marital status (if selected 'other'):") Legal_marriage = models.StringField(blank=True, choices=[['Someone of the opposite sex', 'Someone of the opposite sex'], ['Someone of the same sex ', 'Someone of the same sex ']], label='6.\tWho is (was) your legal marriage or registered civil partnership to?') Postcode = models.StringField(label='In which area do you reside currently? Please indicate the FIRST 3 characters of your postcode:') Postcode_duration = models.StringField(choices=[['Less than 1 year', 'Less than 1 year'], ['1-3 years ', '1-3 years '], ['3-5 years', '3-5 years'], ['More than 5 years ', 'More than 5 years ']], label='How long have you lived at this post-code?') Country_birth = models.StringField(choices=[['England', 'England'], ['Wales', 'Wales'], ['Scotland', 'Scotland'], ['Northern Ireland ', 'Northern Ireland '], ['Republic of Ireland ', 'Republic of Ireland '], ['Other', 'Other']], label='8.\tWhat is your country of birth? ') other_country = models.StringField(blank=True, label="Please specify your country of birth (if selected 'other'):") national_identity = models.StringField(blank=True, choices=[['Afghan', 'Afghan'], ['\tAlbanian', 'Albanian'], ['\tAlgerian', 'Algerian'], ['American', 'American'], ['Andorran', 'Andorran'], ['Angolan', 'Angolan'], ['Anguillan', 'Anguillan'], ['Citizen of Antigua and Barbuda', 'Citizen of Antigua and Barbuda'], ['Argentine', 'Argentine'], ['Armenian', 'Armenian'], ['Australian', 'Australian'], ['Austrian', 'Austrian'], ['Azerbaijani', 'Azerbaijani'], ['Bahamian', 'Bahamian'], ['Bahraini', 'Bahraini'], ['Bangladeshi', 'Bangladeshi'], ['Barbadian', 'Barbadian'], ['Belarusian', 'Belarusian'], ['Belgian', 'Belgian'], ['Belizean', 'Belizean'], ['Beninese', 'Beninese'], ['Bermudian', 'Bermudian'], ['Bhutanese', 'Bhutanese'], ['Bolivian', 'Bolivian'], ['Citizen of Bosnia and Herzegovina', 'Citizen of Bosnia and Herzegovina'], ['Botswanan', 'Botswanan'], ['Brazilian', 'Brazilian'], ['British', 'British'], ['British Virgin Islander', 'British Virgin Islander'], ['Bruneian', 'Bruneian'], ['Bulgarian', 'Bulgarian'], ['Burkinan', 'Burkinan'], ['Burmese', 'Burmese'], ['Burundian', 'Burundian'], ['Cambodian', 'Cambodian'], ['Cameroonian', 'Cameroonian'], ['Canadian', 'Canadian'], ['Cape Verdean', 'Cape Verdean'], ['Cayman Islander', 'Cayman Islander'], ['Central African', 'Central African'], ['Chadian', 'Chadian'], ['Chilean', 'Chilean'], ['Chinese', 'Chinese'], ['Colombian', 'Colombian'], ['Comoran', 'Comoran'], ['Congolese (Congo)', 'Congolese (Congo)'], ['Congolese (DRC)', 'Congolese (DRC)'], ['Cook Islander', 'Cook Islander'], ['Costa Rican', 'Costa Rican'], ['Croatian', 'Croatian'], ['Cuban', 'Cuban'], ['\tCymraes', 'Cymraes'], ['Cymro', 'Cymro'], ['Cypriot', 'Cypriot'], ['Czech', 'Czech'], ['Danish', 'Danish'], ['Djiboutian', 'Djiboutian'], ['Dominican', 'Dominican'], ['Citizen of the Dominican Republic', 'Citizen of the Dominican Republic'], ['Dutch', 'Dutch'], ['East Timorese', 'East Timorese'], ['Ecuadorean', 'Ecuadorean'], ['Egyptian', 'Egyptian'], ['Emirati', 'Emirati'], ['English', 'English'], ['Equatorial Guinean', 'Equatorial Guinean'], ['Eritrean', 'Eritrean'], ['Estonian', 'Estonian'], ['Ethiopian', 'Ethiopian'], ['Faroese', 'Faroese'], ['Fijian', 'Fijian'], ['Filipino', 'Filipino'], ['Finnish', 'Finnish'], ['French', 'French'], ['Gabonese', 'Gabonese'], ['Gambian', 'Gambian'], ['Georgian', 'Georgian'], ['German', 'German'], ['Ghanaian', 'Ghanaian'], ['Gibraltarian', 'Gibraltarian'], ['Greek', 'Greek'], ['Greenlandic', 'Greenlandic'], ['Grenadian', 'Grenadian'], ['Guamanian', 'Guamanian'], ['Guatemalan', 'Guatemalan'], ['Citizen of Guinea-Bissau', 'Citizen of Guinea-Bissau'], ['Guinean', 'Guinean'], ['Guyanese', 'Guyanese'], ['Haitian', 'Haitian'], ['Honduran', 'Honduran'], ['Hong Konger', 'Hong Konger'], ['Hungarian', 'Hungarian'], ['Icelandic', 'Icelandic'], ['Indian', 'Indian'], ['Indonesian', 'Indonesian'], ['Iranian', 'Iranian'], ['Iraqi', 'Iraqi'], ['Irish', 'Irish'], ['Israeli', 'Israeli'], ['Italian', 'Italian'], ['Ivorian', 'Ivorian'], ['Jamaican', 'Jamaican'], ['Japanese', 'Japanese'], ['Jordanian', 'Jordanian'], ['Kazakh', 'Kazakh'], ['Kenyan', 'Kenyan'], ['Kittitian', 'Kittitian'], ['Citizen of Kiribati', 'Citizen of Kiribati'], ['Kosovan', 'Kosovan'], ['Kuwaiti', 'Kuwaiti'], ['Kyrgyz', 'Kyrgyz'], ['Lao', 'Lao'], ['Latvian', 'Latvian'], ['Lebanese', 'Lebanese'], ['Liberian', 'Liberian'], ['Libyan', 'Libyan'], ['Liechtenstein citizen', 'Liechtenstein citizen'], ['Lithuanian', 'Lithuanian'], ['Luxembourger', 'Luxembourger'], ['Macanese', 'Macanese'], ['Macedonian', 'Macedonian'], ['Malagasy', 'Malagasy'], ['Malawian', 'Malawian'], ['Malaysian', 'Malaysian'], ['Maldivian', 'Maldivian'], ['Malian', 'Malian'], ['Maltese', 'Maltese'], ['Marshallese', 'Marshallese'], ['Martiniquais', 'Martiniquais'], ['Mauritanian', 'Mauritanian'], ['Mauritian', 'Mauritian'], ['Mexican', 'Mexican'], ['Micronesian', 'Micronesian'], ['Moldovan', 'Moldovan'], ['Monegasque', 'Monegasque'], ['Mongolian', 'Mongolian'], ['Montenegrin', 'Montenegrin'], ['Montserratian', 'Montserratian'], ['Moroccan', 'Moroccan'], ['Mosotho', 'Mosotho'], ['Mozambican', 'Mozambican'], ['Namibian', 'Namibian'], ['Nauruan', 'Nauruan'], ['Nepalese', 'Nepalese'], ['New Zealander', 'New Zealander'], ['Nicaraguan', 'Nicaraguan'], ['Nigerian', 'Nigerian'], ['Nigerien', 'Nigerien'], ['Niuean', 'Niuean'], ['North Korean', 'North Korean'], ['Northern Irish', 'Northern Irish'], ['Norwegian', 'Norwegian'], ['Omani', 'Omani'], ['Pakistani', 'Pakistani'], ['Palauan', 'Palauan'], ['Palestinian', 'Palestinian'], ['Panamanian', 'Panamanian'], ['Papua New Guinean', 'Papua New Guinean'], ['Paraguayan', 'Paraguayan'], ['Peruvian', 'Peruvian'], ['Pitcairn Islander', 'Pitcairn Islander'], ['Polish', 'Polish'], ['Portuguese', 'Portuguese'], ['Prydeinig', 'Prydeinig'], ['Puerto Rican', 'Puerto Rican'], ['Qatari', 'Qatari'], ['Romanian', 'Romanian'], ['Russian', 'Russian'], ['Rwandan', 'Rwandan'], ['Salvadorean', 'Salvadorean'], ['Sammarinese\t', 'Sammarinese\t'], ['Samoan', 'Samoan'], ['Sao Tomean', 'Sao Tomean'], ['Saudi Arabian', 'Saudi Arabian'], ['Scottish', 'Scottish'], ['Senegalese', 'Senegalese'], ['Serbian', 'Serbian'], ['Citizen of Seychelles', 'Citizen of Seychelles'], ['Sierra Leonean', 'Sierra Leonean'], ['Singaporean', 'Singaporean'], ['Slovak', 'Slovak'], ['Slovenian', 'Slovenian'], ['Solomon Islander', 'Solomon Islander'], ['Somali', 'Somali'], ['South African', 'South African'], ['South Korean', 'South Korean'], ['South Sudanese', 'South Sudanese'], ['Spanish', 'Spanish'], ['Sri Lankan', 'Sri Lankan'], ['St Helenian', 'St Helenian'], ['St Lucian', 'St Lucian'], ['Stateless', 'Stateless'], ['Sudanese', 'Sudanese'], ['Surinamese', 'Surinamese'], ['Swazi', 'Swazi'], ['Swedish', 'Swedish'], ['Swiss', 'Swiss'], ['Syrian', 'Syrian'], ['Taiwanese', 'Taiwanese'], ['Tajik', 'Tajik'], ['Tanzanian', 'Tanzanian'], ['Thai', 'Thai'], ['Togolese', 'Togolese'], ['Tongan', 'Tongan'], ['Trinidadian', 'Trinidadian'], ['Tristanian', 'Tristanian'], ['Tunisian', 'Tunisian'], ['Turkish', 'Turkish'], ['Turkmen', 'Turkmen'], ['Turks and Caicos Islander', 'Turks and Caicos Islander'], ['Tuvaluan', 'Tuvaluan'], ['Ugandan', 'Ugandan'], ['Ukrainian', 'Ukrainian'], ['Uruguayan', 'Uruguayan'], ['Uzbek', 'Uzbek'], ['Vatican citizen', 'Vatican citizen'], ['Citizen of Vanuatu', 'Citizen of Vanuatu'], ['Venezuelan', 'Venezuelan'], ['Vietnamese', 'Vietnamese'], ['Vincentian', 'Vincentian'], ['Wallisian', 'Wallisian'], ['Welsh', 'Welsh'], ['Yemeni', 'Yemeni'], ['Zambian', 'Zambian'], ['Zimbabwean', 'Zimbabwean']], label='9.\tWhat is your current nationality or citizenship?') ethnic_group = models.StringField(blank=True, choices=[['White (English, Welsh, Scottish, Northern Irish or British)', 'White (English, Welsh, Scottish, Northern Irish or British)'], ['White (Irish)', 'White (Irish)'], ['White (Gypsy or Irish Traveller)', 'White (Gypsy or Irish Traveller)'], ['White (Roma)', 'White (Roma)'], ['White (Any other background)', 'White (Any other background)'], ['White and Black Caribbean', 'White and Black Caribbean'], ['White and Black African', 'White and Black African'], ['White and Asian', 'White & Southern Asian'], ['White & South-East Asian', 'White & South-East Asian'], ['White & East Asian', 'White & East Asian'], [' Mixed (Any other background)', ' Mixed (Any other background)'], ['Asian or Asian British (Indian)', 'Asian or Asian British (Indian)'], ['Asian or Asian British (Pakistani)', 'Asian or Asian British (Pakistani)'], ['Asian or Asian British (Bangladeshi)', 'Asian or Asian British (Bangladeshi)'], ['Asian or Asian British (Chinese)', 'Asian or Asian British (Chinese)'], ['Asian or Asian British (Any other background)', 'Asian or Asian British (Any other background)'], ['Black or Black British (Caribbean)', 'Black or Black British (Caribbean)'], ['Black or Black British (African)', 'Black or Black British (African)'], ['Black or Black British (African & Caribbean)', 'Black or Black British (African & Caribbean)'], ['Black or Black British (South American)', 'Black or Black British (South American)'], ['Black or Black British (Any other background)', 'Black or Black British (Any other background)'], ['Other', 'Other']], label='10.\tWhat do you consider to be your ethnicity group? ') other_ethnic = models.StringField(blank=True, label="Please specify your ethnicity (if selected 'other'): ") religious = models.StringField(blank=True, choices=[['No Religion ', 'No Religion '], ['Christian (including Church of England, Catholic, Protestant and all other Christian denominations)', 'Christian (including Church of England, Catholic, Protestant and all other Christian denominations)'], ['Jewish', 'Jewish'], ['Muslim', 'Muslim'], ['Buddhist', 'Buddhist'], ['Hindu', 'Hindu'], ['Sikh', 'Sikh'], ['Agnostic', 'Agnostic'], ['Other', 'Other']], label='11.\tWhat is your religious affiliation, if any?', widget=widgets.RadioSelect) other_religious = models.StringField(blank=True, label="Please specify your religious affiliation (if selected 'other'): ") Education = models.StringField(blank=True, choices=[['None', 'None'], ['Primary Education ', 'Primary Education '], ['Secondary Education ', "Secondary Education (GCSE's or Equivalent)"], ['Secondary Education- A-levels', '6th Form, College (A-levels or Equivalent)'], ['Diploma Higher Education', 'Diploma higher education, Bachelor Degree, Honours degree'], ['Masters Degree', 'Masters Degree, Postgraduate Diploma/Certificate, Doctoral Degree'], ['other', 'Other']], label='12.\tPlease indicate your highest level of education: ', widget=widgets.RadioSelect) other_education = models.StringField(blank=True, label="Please specify your highest level of education (if selected 'other'): ") Physical_mental = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='13.\tDo you have any physical or mental limitations and/or conditions that affect your ability to perform daily activities? ') Height = models.FloatField(blank=True, label='14.\tWhat is your standing height, without shoes, measured to the nearest centimetre (cm)? Please provide your best estimate, rather than rounding up or down', max=230, min=120) Employment_status = models.StringField(choices=[['Student', 'Student'], ['Employed', 'Employed'], ['Self-employed or freelance without employees', 'Self-employed or freelance without employees'], ['Unemployed ', 'Unemployed (Seeking work)'], ['Not Employed (people not seeking work)', 'Not Employed (Not seeking work)']], label='15.\tWhat is your employment status? ', widget=widgets.RadioSelect) Parents_house = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='16.\tDo you you currently live with your parent(s)/caregiver(s)? ') Household_income = models.StringField(blank=True, choices=[['0-10,000', '£0 - £10,000'], ['5,001-15,000', '£5,001 - £15,000'], ['15,001-25,000', '£15,001 - £25,000'], ['25,001-35,000', '£25,001 - £35,000'], ['35,001-45,000', '£35,001 - £45,000'], ['45,001-75,000', '£45,001 - £75,000'], ['75,001-100,000', '£75,001 - £100,000'], ['>100,001', '>£100,001'], ["Don't Know", "Don't know"], ['Prefer not to say', 'Prefer not to say']], label="18.\t(If 'No' to Q16) Approximately, what is your total annual household income, before tax? ") Parent_household_income = models.StringField(blank=True, choices=[['0-10,000', '£0 - £10,000'], ['5,001-15,000', '£5,001 - £15,000'], ['15,001-25,000', '£15,001 - £25,000'], ['25,001-35,000', '£25,001 - £35,000'], ['35,001-45,000', '£35,001 - £45,000'], ['45,001-75,000', '£45,001 - £75,000'], ['75,001-100,000', '£75,001 - £100,000'], ['>100,001', '>£100,001'], ["Don't know", "Don't know"], ['Prefer not to say', 'Prefer not to say']], label="17.\t(If 'Student' in Q15 and/or 'Yes' in Q16) Approximately, what is your parent(s) annual household income before tax? ") socio_economic_status = models.StringField(blank=True, choices=[['Semi or unskilled manual work ', 'Semi or unskilled manual work (e.g. Manual workers, all apprentices to be skilled trades, Caretaker, Park keeper, non-HGV driver, shop assistant)'], ['Skilled manual worker', 'Skilled manual worker(e.g. Skilled Bricklayer, Carpenter, Plumber, Painter, Bus or Ambulance Driver, HGV driver, AA patrolman, Pub or Bar worker, etc.)'], ['Supervisory or clerical/ junior managerial/ professional/ administrative ', 'Supervisory or clerical/ junior managerial/ professional/ administrative (e.g. Office worker, Student Doctor, Nurse, Foreman with 25+ employees, salesperson, etc.)'], ['Intermediate managerial/ professional/ administrative ', 'Intermediate managerial/ professional/ administrative (e.g. Newly qualified (under 3 years) doctor, Solicitor, Board director small organisation, middle manager in large organisation, principal officer in civil service/local government, teacher)'], ['Higher managerial/ professional/ administrative ', 'Higher managerial/ professional/ administrative (e.g. Doctor, Solicitor, Board Director in a large organisation (200+ employees, top level civil servant/public service employee))'], ['Student', 'Student'], ['Casual worker ', 'Casual worker – not in permanent employment'], ['Homemaker', 'Homemaker'], ['Retired and living on state pension', 'Retired and living on state pension'], ['Unemployed or not working due to long-term sickness', 'Unemployed or not working due to long-term sickness'], ['Carer of other household member', 'Carer of other household member'], ['Other', 'Other']], label='19.\tThinking back to when you were aged about 14, which best describes the sort of work the main/highest income earner of your household did as their main job?') other_socio_eco = models.StringField(blank=True, label="Please specify what job (if selected 'other'): ") have_children = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='20.\tHave you had children? If yes, please complete the following fields for a every child born, starting with the first born: ') child_birth_order = models.StringField(blank=True) child_sex_at_birth = models.StringField(blank=True) child_birth_years = models.StringField(blank=True) child_still_alive = models.StringField(blank=True) child_year_of_death = models.StringField(blank=True) why_decision = models.StringField(blank=True, label='(Optional) Why did you decide to make this decision? ') prolific_id = models.StringField() attention_span = models.IntegerField(choices=[[1, '1 (Not at all)'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7 (Very Much)']], label='How much are you paying attention to these statements?', widget=widgets.RadioSelectHorizontal) def question1_answer_error_message(player: Player, value): if value != 150: return 'Wrong answer' def question2_answer_error_message(player: Player, value): if value != 130: return 'Wrong answer' def question3_answer_error_message(player: Player, value): if value != 100: return 'Wrong answer' def custom_export(players): yield ['participant_code', 'id_in_group'] for p in players: pp = p.participant yield [pp.code, p.id_in_group] class MatchedWaitPage(WaitPage): group_by_arrival_time = True body_text = ' Please be patient as participants are being grouped!' class Demographics(Page): form_model = 'player' form_fields = ['Age', 'Sex', 'Sexual_Ori', 'other_sex_ori', 'Gender', 'other_gender', 'marriage_status', 'other_marriage', 'Legal_marriage', 'Postcode', 'Postcode_duration', 'Country_birth', 'other_country', 'national_identity', 'ethnic_group', 'other_ethnic'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.prolific_id = player.participant.label class Demographics_2(Page): form_model = 'player' form_fields = ['religious', 'other_religious', 'Education', 'other_education', 'Physical_mental', 'Height', 'Employment_status', 'Parents_house', 'Household_income', 'Parent_household_income', 'socio_economic_status', 'other_socio_eco', 'have_children', 'child_birth_order', 'child_birth_years', 'child_sex_at_birth', 'child_still_alive', 'child_year_of_death'] class DemographWait(WaitPage): wait_for_all_groups = True body_text = 'Please be patient while participants answer questions!' class Instructions(Page): form_model = 'player' class Instructions2(Page): form_model = 'player' class Test_player(Page): form_model = 'player' form_fields = ['question1_answer', 'question2_answer', 'question3_answer'] class CompetitorSexWait(WaitPage): wait_for_all_groups = True body_text = 'Please be patient while participants answer questions!' class BidPage(Page): form_model = 'player' form_fields = ['bid_amount'] timeout_seconds = 180 @staticmethod def vars_for_template(player: Player): group = player.group other_player_id = 2 if player.id_in_group == 1 else 1 other_player = group.get_player_by_id(other_player_id) return { 'other_player_sex': other_player.Sex, } @staticmethod def before_next_page(player: Player, timeout_happened): if player.round_number == 1: player.payoff = C.STARTING_POINTS - player.bid_amount + C.JACKPOT_AMOUNT class Whydecision(Page): form_model = 'player' form_fields = ['why_decision'] class CompetitiveAnalysis(Page): form_model = 'player' form_fields = ['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9', 'q10', 'q11', 'q12', 'q13', 'q14', 'q15', 'q16', 'q17', 'q18', 'q19', 'q20', 'q21', 'q22', 'q23', 'q24', 'q25', 'q26', 'q27', 'q28', 'q29', 'q30'] class IfWoman(Page): form_model = 'player' form_fields = ['woman_q31', 'woman_q32', 'woman_q33', 'woman_q34', 'woman_q35', 'woman_q36', 'attention_span', 'woman_q37', 'woman_q38', 'woman_q39', 'woman_q40', 'woman_q41', 'woman_q42', 'woman_q43', 'woman_q44', 'woman_q45', 'woman_q46', 'direct_comp_woman'] @staticmethod def is_displayed(player: Player): return player.Sex == 'Female' class IfMan(Page): form_model = 'player' form_fields = ['man_q31', 'man_q32', 'man_q33', 'man_q34', 'man_q35', 'man_q36', 'attention_span', 'man_q37', 'man_q38', 'man_q39', 'man_q40', 'man_q41', 'man_q42', 'man_q43', 'man_q44', 'man_q45', 'man_q46', 'direct_comp_man'] @staticmethod def is_displayed(player: Player): return player.Sex == 'Male' class ResultsWaitPage(WaitPage): after_all_players_arrive = set_payoffs body_text = 'Please be patient while we calculate the total points!' class ResultsPage(Page): form_model = 'player' @staticmethod def vars_for_template(player: Player): group = player.group competitor = group.get_player_by_id(2) if player.id_in_group == 1 else group.get_player_by_id(1) return {'winner_payoff': C.STARTING_POINTS - player.bid_amount + C.JACKPOT_AMOUNT, 'winner_points': round((C.STARTING_POINTS - player.bid_amount + C.JACKPOT_AMOUNT)*0.05,2), 'loser_payoff': C.STARTING_POINTS - player.bid_amount, 'loser_points':round((C.STARTING_POINTS - player.bid_amount) * 0.05, 2), 'bid_amount': player.bid_amount, 'competitor_bid_amount': competitor.bid_amount, } page_sequence = [MatchedWaitPage, Demographics, Demographics_2, DemographWait, Instructions, Instructions2, Test_player, CompetitorSexWait, BidPage, Whydecision, CompetitiveAnalysis, IfWoman, IfMan, ResultsWaitPage, ResultsPage]