from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'P3_postsurvey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): reasons = models.LongStringField(label='Briefly describe the reasons you used in making your decisions. ') age = models.IntegerField(label='What is your age?', max=125, min=18) gender = models.StringField(choices=[['Male', 'Male'], ['Female', 'Female'], ['Non-binary', 'Non-binary'], ['Prefer not so say', 'Prefer not so say']], label='What is your gender?') work_experience = models.IntegerField(label='How many years of managerial work experience do you have?', max=60, min=0) religion = models.StringField(choices=[['None', 'None'], ['Buddhist', 'Buddhist'], ['Christian (including Catholic, Protestant and all other Christian denominations)', 'Christian (including Catholic, Protestant and all other Christian denominations)'], ['Hindu', 'Hindu'], ['Islam', 'Islam'], ['Jewish', 'Jewish'], ['Other', 'Other'], ['Prefer not to say', 'Prefer not to say']], label='What is your religion?') nationality = models.StringField(choices=[['Afghan', 'Afghan'], ['Albanian', 'Albanian'], ['Algerian', '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'], ['Cymraes', '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', 'Sammarinese'], ['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'], ['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'], ['Prefer not to say', 'Prefer not to say']], label='What is your nationality?') other_country = models.IntegerField(choices=[[1, 'Yes'], [2, 'No']], label='Have you ever lived in a country other than the one of your origin?') time_spent_other_country = models.IntegerField(label='Please state your time spent in other countries (in year(s)). If this question is not applicable to you, answer 0. ', min=0) South = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='South Office', widget=widgets.RadioSelectHorizontal) West = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='West office', widget=widgets.RadioSelectHorizontal) North = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='North Office', widget=widgets.RadioSelectHorizontal) East = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='East Office', widget=widgets.RadioSelectHorizontal) tomaximize_payoff = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='The urge to maximize payoffs.', widget=widgets.RadioSelectHorizontal) tobehonest = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='The urge to be honest.', widget=widgets.RadioSelectHorizontal) toNGO = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='The urge to help NGO.', widget=widgets.RadioSelectHorizontal) tocooperate = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='The urge to cooperate with your teammates.', widget=widgets.RadioSelectHorizontal) toget_contract = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='The urge to get a contract from official.', widget=widgets.RadioSelectHorizontal) audit_amb = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='Precise information on audit probability', widget=widgets.RadioSelectHorizontal) audit_prob = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10']], label='Audit probability', widget=widgets.RadioSelectHorizontal) suggestion = models.LongStringField(label='Please note any parts of the instructions you found confusing.') other_comments = models.LongStringField(label='Other comments.') at1 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='1. A problem has little attraction for me if I do not think it has a solution.', widget=widgets.RadioSelectHorizontal) at2 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='2. I am just a little uncomfortable with people unless I feel that I can understand their behavior.', widget=widgets.RadioSelectHorizontal) at3 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='3. There is a right way and a wrong way to do almost everything.', widget=widgets.RadioSelectHorizontal) at4 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='4. I would rather bet 1 to 6 on a long shot than 3 to 1 on a probable winner.', widget=widgets.RadioSelectHorizontal) at5 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='5. The way to understand complex problems is to be concerned with their larger aspects instead of breaking them into smaller pieces.', widget=widgets.RadioSelectHorizontal) at6 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='6. I get pretty anxious when I am in a social situation over which I have no control.', widget=widgets.RadioSelectHorizontal) at7 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='7. Practically every problem has a solution.', widget=widgets.RadioSelectHorizontal) at8 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='8. It bothers me when I am unable to follow another person’s train of thought.', widget=widgets.RadioSelectHorizontal) at9 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='9. I have always felt that there is a clear difference between right and wrong.', widget=widgets.RadioSelectHorizontal) at10 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='10. It bothers me when I do not know how other people react to me.', widget=widgets.RadioSelectHorizontal) at11 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='11. Nothing gets accomplished in this world unless you stick to some basic rules.', widget=widgets.RadioSelectHorizontal) at12 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='12. If I were a doctor, I would prefer the uncertainties of a psychiatrist to the clear and definite work of someone like a surgeon or X-ray specialist.', widget=widgets.RadioSelectHorizontal) at13 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='13. Vague and impressionistic picture really have little appeal for me.', widget=widgets.RadioSelectHorizontal) at14 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='14. If I were a scientist, it would bother me that my work would never be completed (because science will always make more discoveries).', widget=widgets.RadioSelectHorizontal) at15 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='15. Before an examination, I feel much less anxious if I know how many questions there will be.', widget=widgets.RadioSelectHorizontal) at16 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='16. The best part about working on a jigsaw puzzle is putting in the last piece.', widget=widgets.RadioSelectHorizontal) at17 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='17. Sometimes I rather enjoy going against the rules and doing things I am not supposed to do. ', widget=widgets.RadioSelectHorizontal) at18 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='18. I do not like to work on a problem unless there is a possibility of coming out with a clear-cut and unambiguous answer.', widget=widgets.RadioSelectHorizontal) at19 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='19. I like to fool around with new ideas, even if they turn out later to be a total waste of time. ', widget=widgets.RadioSelectHorizontal) at20 = models.BooleanField(choices=[[True, 'True'], [False, 'False']], label='20. Perfect balance is the essence of all good composition.', widget=widgets.RadioSelectHorizontal) def custom_export(players): yield ['participant_code', 'id_in_group', 'payment'] for p in players: pp = p.participant yield [pp.code, p.id_in_group, pp.payment] class AT20(Page): form_model = 'player' form_fields = ['at1', 'at2', 'at3', 'at4', 'at5', 'at6', 'at7', 'at8', 'at9', 'at10', 'at11', 'at12', 'at13', 'at14', 'at15', 'at16', 'at17', 'at18', 'at19', 'at20'] class Demographics(Page): form_model = 'player' form_fields = ['tomaximize_payoff', 'tobehonest', 'toNGO', 'tocooperate', 'toget_contract', 'audit_amb', 'audit_prob', 'reasons', 'nationality', 'other_country', 'time_spent_other_country', 'gender', 'age', 'work_experience', 'religion', 'suggestion', 'other_comments'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.participant.finished = True class Payment(Page): form_model = 'player' @staticmethod def vars_for_template(player: Player): participant = player.participant return dict(payoff = player.participant.payoff_plus_participation_fee()) page_sequence = [AT20, Demographics, Payment]