from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'experiment_info' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): comprehension = models.FloatField(label='''Please answer the following question: Assume you have solved 5 tables correctly out of 10. What are your total earnings at the end of the experiment including the base payment? Answer in pounds, as a decimal. Remember, your base payment is £2.34 ''') page_pass_time = models.FloatField() prolific_id = models.StringField(default=str(" ")) # PAGES class Starting(Page): def before_next_page(player, timeout_happened): import time player.page_pass_time = time.time() + 15 class Instructions1(Page): def before_next_page(player, timeout_happened): player.prolific_id = player.participant.label import time player.page_pass_time = time.time() + 15 def error_message(player,values): import time if time.time() < player.page_pass_time: return "You have to stay on this page for 15 seconds before you can move to the next page" class Instructions2(Page): form_model = 'player' form_fields = ['comprehension'] def error_message(player, values): solutions = dict(comprehension=2.84) if values!=solutions: return "Your answer to the comprehesion question was incorrect. Please try again." import time if time.time() < player.page_pass_time: return "You have to stay on this page for 15 seconds before you can move to the next page" class Results(Page): pass page_sequence = [Starting, Instructions1, Instructions2]