from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Quiz' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): quiz2 = models.StringField(choices=[['True', 'True'], ['False', 'False']], label='2. Farmland with a higher underground water level has a greater chance of getting a higher mean of return. True or False?', widget=widgets.RadioSelect) quiz3 = models.StringField(choices=[['True', 'True'], ['False', 'False']], label='3. As the water level of the aquifer declines, there will be a higher chance to buy a farm with a higher underground water level. True or False?', widget=widgets.RadioSelect) quiz4 = models.IntegerField(label='4. What is the mean return of a farm with underground water level at 70 feet?') quiz5 = models.StringField(choices=[['20', '20%'], ['25', '25%'], ['50', '50%'], ['75', '75%']], label='5. You have a farm with underground water level at 50 feet. What is the probability of the return that is greater than or equal to 271 points? ', widget=widgets.RadioSelect) quiz6 = models.IntegerField(label='6. What is the minimum return you can get from a dryland farm? ') quiz7 = models.IntegerField(label='7. What is the maximum return you can get from a dryland farm? ') proposal70 = models.CurrencyField(label='How many points would you like to pay for a farmland with underground water level at 70 feet? ', max=662, min=159) proposal60 = models.CurrencyField(label='How many points would you like to pay for a farmland with underground water level at 70 feet? ', max=619, min=133) proposal40 = models.CurrencyField(label='How many points would you like to pay for a farmland with underground water level at 40 feet? ', max=547, min=78) proposal0 = models.CurrencyField(label='How many points would you like to pay for a dry farmland? ', max=597, min=9) quiz1 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4']], label='1. How many farms are auctioned in one trading period?', widget=widgets.RadioSelect) class Mypage(Page): form_model = 'player' form_fields = ['quiz1', 'quiz2', 'quiz3', 'quiz4', 'quiz5', 'quiz6', 'quiz7'] @staticmethod def error_message(player: Player, values): solutions = dict(quiz1=4, quiz2='True', quiz3='False', quiz4=662, quiz5='75', quiz6=9, quiz7=597) if values != solutions: return "One or more answers were incorrect." class End(Page): form_model = 'player' page_sequence = [Mypage, End]