##################################################### ##################################################### # README # # Program Name: __init__.py # Purpose: catchall page for failures ##################################################### # # Author: Andrew Olsen # Date Created: 01.14.2025 # Last Updated: 01.14.2025 # ##################################################### #### Modules from otree.api import * import numpy as np c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'failpage' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): is_mobile = models.BooleanField() # PAGES class FailPageMobile(Page): form_model = 'player' ## only display to the failures @staticmethod def is_displayed(player): participant = player.participant condition = participant.is_mobile return (condition) # PAGES class FailPageQuiz(Page): form_model = 'player' ## only display to the failures ## if they fail mobile devices, passed_quiz is None @staticmethod def is_displayed(player): participant = player.participant condition = not participant.passed_quiz return (condition) class FailPageAsleep(Page): form_model = 'player' @staticmethod def is_displayed(player): participant = player.participant return participant.timed_out page_sequence = [FailPageMobile, FailPageQuiz, FailPageAsleep]