from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Introduction' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Agree = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='I accept these rules and I want to participate in the experiment') Control1 = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='This experiment consists of 15 rounds') Control2 = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Your final earnings uniquely depend on the outcome of one single round') Control3 = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='Choices in one round affect the results and payoffs of the other rounds') class Instructions(Page): form_model = 'player' form_fields = ['Agree'] @staticmethod def is_displayed(player: Player): return player.round_number == 1 return True @staticmethod def error_message(player: Player, values): error_msg = dict() if values['Agree'] != True: error_msg.update(Agree='We are sorry but if you do not provide your consent you cannot take part in the experiment. If you do not want to take part you are free to leave the lab.') return error_msg class Tasks(Page): form_model = 'player' class Control(Page): form_model = 'player' form_fields = ['Control1', 'Control2', 'Control3'] @staticmethod def error_message(player: Player, values): error_msg = dict() if values['Control1'] != True: error_msg.update(Control1='Wrong. This experiment consists of 15 rounds') if values['Control2'] != True: error_msg.update(Control2='Wrong. Your final earnings uniquely depend on the outcome of one single round') if values['Control3'] != False: error_msg.update(Control3='Wrong. Choices in one round DO NOT affect the results and payoffs of the other rounds') return error_msg page_sequence = [Instructions, Tasks, Control]