from otree.api import * c = cu doc = "Istruzioni generali sull'esperimento" class C(BaseConstants): NAME_IN_URL = 'Instructions' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Q1 = models.BooleanField(choices=[[True, 'Sì'], [False, 'No']], label='Questo esperimento riguarda gli strumenti di Business Analytics?', widget=widgets.RadioSelect) Q2 = models.BooleanField(choices=[[True, 'Sì'], [False, 'No']], label='L’esperimento è suddiviso in quattro fasi', widget=widgets.RadioSelect) Q3 = models.BooleanField(choices=[[True, 'Sì'], [False, 'No']], initial=False, label='La probabilità di vincere è direttamente proporzionata al numero di inefficienze individuate') class Instructions(Page): form_model = 'player' class InstructionsTask(Page): form_model = 'player' class Understanding(Page): form_model = 'player' form_fields = ['Q1', 'Q2', 'Q3'] @staticmethod def error_message(player: Player, values): error_msg = dict() if values['Q1'] != True: error_msg.update(Q1='Sbagliato. Questo esperimento riguarda gli strumenti di Business Analytics') if values['Q2'] != True: error_msg.update(Q2='Sbagliato. Questo esperimento è suddiviso in quattro fasi') if values['Q3'] != True: error_msg.update(Q3='Sbagliato. La valuta di questo esperimento sono gli ECU') return error_msg page_sequence = [Instructions, InstructionsTask, Understanding]