from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'comprehension' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): comprehension1 = models.IntegerField( blank=False, label='What is your objective in this task?', choices=[[1, "Find the best investment decision"], [2, "Allocate resources between you and another person"], [3, "Show that I understand statistics"]], widget=widgets.RadioSelect ) comprehension2 = models.IntegerField( blank=False, label='How many rounds will you be playing?', choices=[[1, "6"], [2, "15"], [3, "10"]], widget=widgets.RadioSelect ) comprehension3 = models.IntegerField( blank=False, label='Based on your decision in each round you will earn a bonus payout. This bonus ranges from...', choices=[[1, "either £0.00 or £2.00"], [2, "£1.00 to £2.00"], [3, "£0.00 to £2.00"]], widget=widgets.RadioSelect ) pass # PAGES class Thanks(Page): form_model = "player" pass class Instructions2(Page): form_model = "player" pass class Comprehension(Page): form_model = "player" form_fields = ['comprehension1', 'comprehension2', 'comprehension3'] @staticmethod def error_message(player: Player, values): solutions = dict( comprehension1=2, comprehension2=2, comprehension3=3) if values != solutions: return "One or more answers were incorrect." page_sequence = [Thanks, Instructions2, Comprehension]