""" This application countains the block of instructions, including WTP """ from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'Instructions' players_per_group = None num_rounds = 1 PointsImport_dict = {"8Z3RU9VD": 500, "DEKB6TN3": 550, "XBE3Q6W4": 600, "7GFZX1ZK": 550, "G0XVNQAC": 500, "65SUCP5H": 450, "E9WEPNEG": 450, "FER8FV22": 400, "V5XAZBU9": 400, "5N2368H2": 500, "KHXFLXNN": 450, "UDYM8W6L": 500, "K61A63WB": 450, "31CQ28BF": 500, "NS1AHAMR": 450, "7M8K3CL4": 450, "87G3TPEF": 600, "2ZZKUABF": 500, "BQM972BN": 550, "20U3HN8M": 550, "BDRX4KUQ": 500, "4QDLYXCT": 650, "PLCQ5TQV": 550, "6W5YAZ99": 600, "0SQVMY4D": 500, "N6RZ0PDA": 600, "CBDFCMA2": 550, "3CLG8UG9": 450, "ZS99P1XP": 600, "ZMNL41VC": 600, "ZLL63AQ3": 450, "X29KG9Y9": 500, "M06811HU": 400, "ZMRKUVFV": 500, "M5LCHSF0": 550, "1U1YC4B1": 600, "MLBKGSL9": 550, "1XB7CCMW": 600, "GCXRX4VG": 500, "NG29CUH6": 650, "P0E5GKFB": 600, "P97A6W1G": 550, "7RNQD7ZZ": 450, "RVE4N5MB": 550, "6P4KPQ0Q": 550, "436MAUFP": 600, "PBAHTLYN": 550, "CA8B9P0W": 650, "B9GHLGWY": 500, "HGDV252M": 450, "7M6GNGSN": 500, "2T5H8TL8": 450, "8NYE046X": 600, "E1Q3M7VV": 450, "DS57L91D": 600, "2FW9GXT5": 550, "ABHZRHKV": 500, "P0WUU071": 350, "CWGH7TX9": 550, "DX7098XE": 500, "E6D5QU91": 600, "T2ZR6G05": 400, "AAEB74E0": 550, "7KTG9CQH": 300, "K3ZBS0FZ": 600, "C0BS1515": 450, "HUK1E3XU": 600, "GDTKYR5R": 550, "4L2QUMKA": 500, "5BCT1M6R": 500, "AE7P0REB": 600, "Z3LFSKVF": 500, "D5H318EV": 450, "T4TWBB41": 400, "6GXYL8CN": 500, "6W3P135R": 500, "THZ01SMY": 400, "18F9X6CW": 450, "N68P2UQ9": 600, "0TVSHB12": 550, "KTDH54Q1": 550, "FGELNKG6": 550, "25HHFZ4Q": 550, "NUYU3S8A": 550, "U8FEA23A": 600, "9GE861M8": 400, "Y9S4Z0NT": 600, "LTLZL0HR": 550, "WUYT6A65": 450, "ZB9PYC9N": 400, "HUNF3Z6E": 400, "KS6EDZBD": 400, "77R8E9RC": 550, "TK01ZQ5B": 500, "T1GBZ60T": 500, "TCA4VXY8": 400, "AX8ZPK5Z": 600, "5DXGFZS8": 650, "ZU5BCGBQ": 550, "1CDMATBP": 550, "YLQURYWX": 450, "HGDVTPR1": 600, "PCNNMWCW": 500, "N669GBL2": 500, "GLCZ30TN": 400, "Y4B3310Q": 600, "P0WBRK1Z": 300,} class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # Set up for lottery lottery_no_meat = models.IntegerField() # Instructions p_label = models.StringField(label="Please enter the computer label") birth_date = models.StringField(label="What is your birth date? Please enter it in this format 30.08.1980 ") email = models.StringField( label="What is your personal 8 characters combination from the online survey? (please use capital letters only)") def email_error_message(self, value): if value not in Constants.PointsImport_dict: return '''This combination has not been found in the database. Please try again, using only capital letters. If you can't remember it, please raise your hand and prepare your secret word.''' # WTP CONTROL QUESTIONS WTP_i1 = models.IntegerField(widget=widgets.RadioSelect, label="Suppose you have selected a minimum acceptable payoff of -50 for item 1. The computer randomly selected a payoff of +40 for item 1. What happens?" , choices=[[1, "The offer is accepted: you get item 1 & you get 40 points"], [2, "The offer is accepted: you get item 1 & you lose 50 points"], [3, "The offer is refused: you do not get item 1 & you get no payoff"], [4, "The offer is refused: you do not get item 1 & you lose 50 points"] ] ) WTP_i2 = models.IntegerField(widget=widgets.RadioSelect, label="Suppose you have selected a minimum acceptable payoff of +50 for item 2. The computer randomly selected a payoff of +19 for item 2. What happens?", choices=[[3, "The offer is accepted: you get item 2 & you get 19 points"], [2, "The offer is accepted: you get item 2 & you lose 19 points"], [1, "The offer is refused: you do not get item 2 & you get no payoff"], [4, "The offer is refused: you do not get item 2 & you lose 19 points"] ] ) WTP_i3 = models.IntegerField(widget=widgets.RadioSelect, label="Suppose you have selected a minimum acceptable payoff of 0 for item 3. The computer randomly selected a payoff of -10 for item 3. What happens?" , choices=[[3, "The offer is accepted: you get item 3 & you get 10 points"], [2, "The offer is accepted: you get item 3 & you lose 10 points"], [1, "The offer is refused: you do not get item 3 & you get no payoff"], [4, "The offer is refused: you do not get item 3 & you lose 10 points"] ] ) WTP_i4 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label="Suppose you want item 4 and are ready to accept any offer for it. What should you answer to 'What is your minimum acceptable payoff for item 4?'", choices=[[1, "-75"], [2, "-50"], [3, "-25"], [4, "0"], [5, "+25"], [6, "+50"], [5, "+75"] ] ) WTP_i5 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label="Suppose you do not want item 5 and want to refuse any offer for it. What should you answer to 'What is your minimum acceptable payoff for item 5?'", choices=[[7, "-75"], [2, "-50"], [3, "-25"], [4, "0"], [5, "+25"], [6, "+50"], [1, "+75"]] ) #CONTROL QUESTIONS ERROR MESSAGES def WTP_i1_error_message(self, value): if value != 1: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.' def WTP_i2_error_message(self, value): if value != 1: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.' def WTP_i3_error_message(self, value): if value != 1: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.' def WTP_i4_error_message(self, value): if value != 1: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.' def WTP_i5_error_message(self, value): if value != 1: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.' def WTP_i6_error_message(self, value): if value != 8: return 'Your answer is wrong. Please reconsider your answer. If you are unsure about the answer please raise your hand.'