from otree.api import * doc = """ Your app description """ # def make_image_data(image_names): # return [dict(name=name, path='global/{}'.format(name)) for name in image_names] class C(BaseConstants): NAME_IN_URL = 'attentionCheck' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # record the submission for each task failed = models.BooleanField(initial=False) attention_check = models.IntegerField( label='', choices=[1, 2, 3], ) # PAGES 3 = human class MyPage(Page): form_model = 'player' form_fields = ['attention_check'] @staticmethod def is_displayed(player: Player): return player.round_number == 1 @staticmethod def app_after_this_page(player, upcoming_apps): print('upcoming_apps is', upcoming_apps) if player.attention_check == 3: return "welcome" # # # @staticmethod # def vars_for_template(player: Player): # image_names = [ # 'AClion.jpg', # 'ACrabbit.jpg', # 'AChuman.jpg', # ] # return dict(imag_data=make_image_data(image_names)) class ResultsWaitPage(WaitPage): pass class dropout(Page): pass page_sequence = [MyPage, dropout]