from otree.api import * doc = """ Manipulation_Check """ class C(BaseConstants): NAME_IN_URL = 'Check' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 def timer(player, seconds): """Return seconds if timers are enabled, else None.""" return seconds if player.session.config.get('enable_timers', False) else None class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): manipulation = models.StringField( choices=["Yes", "No"], widget=widgets.RadioSelectHorizontal, ) manipulation_explained = models.LongStringField(blank=True, label="Can you briefly explain why you doubted the behaviour?") # PAGES class Manipulation_Check(Page): form_model = 'player' form_fields = ['manipulation', 'manipulation_explained'] @staticmethod def get_timeout_seconds(player): # Example: 120s normally return timer(player, 120) @staticmethod def before_next_page(player, timeout_happened): if timeout_happened: player.participant.dropout = True @staticmethod def app_after_this_page(player, timeout_happened): if player.participant.dropout: return "End_Page" page_sequence = [Manipulation_Check]