def __init__(self, **kwargs): Event.__init__(self, **kwargs) ensure_type(self.actor, ENTITY_TYPES["PERSON"]) ensure_type(self.object, ENTITY_TYPES["SOFTWARE_APPLICATION"]) ensure_type(self.generated, ENTITY_TYPES["DIGITAL_RESOURCE"], optional=True) ensure_types( self.target, [ENTITY_TYPES["LINK"], ENTITY_TYPES["LTI_LINK"]], optional=True ) if self.action == CALIPER_ACTIONS["LAUNCHED"]: ensure_type(self.federatedSession, ENTITY_TYPES["LTI_SESSION"])
def __init__(self, **kwargs): Event.__init__(self, **kwargs) ensure_type(self.actor, ENTITY_TYPES["PERSON"]) if self.profile == CALIPER_PROFILES["SURVEY"]: ensure_types( self.object, [ENTITY_TYPES["QUESTIONNAIRE"], ENTITY_TYPES["QUESTIONNAIRE_ITEM"]], ) else: ensure_type(self.object, ENTITY_TYPES["DIGITAL_RESOURCE"]) ensure_type(self.target, ENTITY_TYPES["FRAME"], optional=True)
def __init__(self, **kwargs): Event.__init__(self, **kwargs) if self.action == CALIPER_ACTIONS["LOGGED_IN"]: ensure_type(self.actor, ENTITY_TYPES["PERSON"]) ensure_type(self.object, ENTITY_TYPES["SOFTWARE_APPLICATION"]) ensure_type(self.generated, ENTITY_TYPES["SESSION"], optional=True) ensure_type(self.target, ENTITY_TYPES["DIGITAL_RESOURCE"], optional=True) elif self.action == CALIPER_ACTIONS["LOGGED_OUT"]: ensure_type(self.actor, ENTITY_TYPES["PERSON"]) ensure_type(self.object, ENTITY_TYPES["SOFTWARE_APPLICATION"]) ensure_type(self.target, ENTITY_TYPES["SESSION"], optional=True) elif self.action == CALIPER_ACTIONS["TIMED_OUT"]: ensure_type(self.actor, ENTITY_TYPES["SOFTWARE_APPLICATION"]) ensure_type(self.object, ENTITY_TYPES["SESSION"]) ensure_types( self.referrer, [ENTITY_TYPES["DIGITAL_RESOURCE"], ENTITY_TYPES["SOFTWARE_APPLICATION"]], optional=True, )