Skip to content

xAPI events

xAPI pydantic models.

base special

agents

Base xAPI Agent definitions.

BaseXapiAgentAccount (BaseModelWithConfig) pydantic-model

Pydantic model for Agent type account property.

Attributes:

Name Type Description
homePage IRI

Consists of the home page of the account’s service provider.

name str

Consists of the unique id or name of the Actor’s account.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentAccount(BaseModelWithConfig):
    """Pydantic model for `Agent` type `account` property.

    Attributes:
        homePage (IRI): Consists of the home page of the account's service provider.
        name (str): Consists of the unique id or name of the Actor's account.
    """

    homePage: IRI
    name: StrictStr

BaseXapiAgentCommonProperties (BaseModelWithConfig, ABC) pydantic-model

Pydantic model for core Agent type property.

It defines who performed the action.

Attributes:

Name Type Description
objectType str

Consists of the value Agent.

name str

Consists of the full name of the Agent.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentCommonProperties(BaseModelWithConfig, ABC):
    """Pydantic model for core `Agent` type property.

    It defines who performed the action.

    Attributes:
        objectType (str): Consists of the value `Agent`.
        name (str): Consists of the full name of the Agent.
    """

    objectType: Optional[Literal["Agent"]]
    name: Optional[StrictStr]

BaseXapiAgentWithAccount (BaseXapiAgentCommonProperties, BaseXapiAccountIFI) pydantic-model

Pydantic model for Agent type property.

It is defined for agent type with an account IFI.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentWithAccount(BaseXapiAgentCommonProperties, BaseXapiAccountIFI):
    """Pydantic model for `Agent` type property.

    It is defined for agent type with an account IFI.
    """

BaseXapiAgentWithMbox (BaseXapiAgentCommonProperties, BaseXapiMboxIFI) pydantic-model

Pydantic model for Agent type property.

It is defined for agent type with a mailto IFI.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentWithMbox(BaseXapiAgentCommonProperties, BaseXapiMboxIFI):
    """Pydantic model for `Agent` type property.

    It is defined for agent type with a mailto IFI.
    """

BaseXapiAgentWithMboxSha1Sum (BaseXapiAgentCommonProperties, BaseXapiMboxSha1SumIFI) pydantic-model

Pydantic model for Agent type property.

It is defined for agent type with a hash IFI.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentWithMboxSha1Sum(
    BaseXapiAgentCommonProperties, BaseXapiMboxSha1SumIFI
):
    """Pydantic model for `Agent` type property.

    It is defined for agent type with a hash IFI.
    """

BaseXapiAgentWithOpenId (BaseXapiAgentCommonProperties, BaseXapiOpenIdIFI) pydantic-model

Pydantic model for Agent type property.

It is defined for agent type with an openID IFI.

Source code in ralph/models/xapi/base/agents.py
class BaseXapiAgentWithOpenId(BaseXapiAgentCommonProperties, BaseXapiOpenIdIFI):
    """Pydantic model for `Agent` type property.

    It is defined for agent type with an openID IFI.
    """

attachments

Base xAPI Attachments definitions.

BaseXapiAttachment (BaseModelWithConfig) pydantic-model

Pydantic model for attachment property.

Attributes:

Name Type Description
usageType IRI

Identifies the usage of this Attachment.

display LanguageMap

Consists of the Attachment’s title.

description LanguageMap

Consists of the Attachment’s description.

contentType str

Consists of the Attachment’s content type.

length int

Consists of the length of the Attachment’s data in octets.

sha2 str

Consists of the SHA-2 hash of the Attachment data.

fileUrl URL

Consists of the URL from which the Attachment can be retrieved.

Source code in ralph/models/xapi/base/attachments.py
class BaseXapiAttachment(BaseModelWithConfig):
    """Pydantic model for `attachment` property.

    Attributes:
        usageType (IRI): Identifies the usage of this Attachment.
        display (LanguageMap): Consists of the Attachment's title.
        description (LanguageMap): Consists of the Attachment's description.
        contentType (str): Consists of the Attachment's content type.
        length (int): Consists of the length of the Attachment's data in octets.
        sha2 (str): Consists of the SHA-2 hash of the Attachment data.
        fileUrl (URL): Consists of the URL from which the Attachment can be retrieved.
    """

    usageType: IRI
    display: LanguageMap
    description: Optional[LanguageMap]
    contentType: str
    length: int
    sha2: str
    fileUrl: Optional[AnyUrl]

common

Common for xAPI base definitions.

IRI (str)

Pydantic custom data type validating RFC 3987 IRIs.

Source code in ralph/models/xapi/base/common.py
class IRI(str):
    """Pydantic custom data type validating RFC 3987 IRIs."""

    @classmethod
    def __get_validators__(cls):  # noqa: D105
        def validate(iri: str):
            """Checks whether the provided IRI is a valid RFC 3987 IRI."""
            parse(iri, rule="IRI")
            return cls(iri)

        yield validate

LanguageTag (str)

Pydantic custom data type validating RFC 5646 Language tags.

Source code in ralph/models/xapi/base/common.py
class LanguageTag(str):
    """Pydantic custom data type validating RFC 5646 Language tags."""

    @classmethod
    def __get_validators__(cls):  # noqa: D105
        def validate(tag: str):
            """Checks whether the provided tag is a valid RFC 5646 Language tag."""
            if not tag_is_valid(tag):
                raise TypeError("Invalid RFC 5646 Language tag")
            return cls(tag)

        yield validate

MailtoEmail (str)

Pydantic custom data type validating mailto:email format.

Source code in ralph/models/xapi/base/common.py
class MailtoEmail(str):
    """Pydantic custom data type validating `mailto:email` format."""

    @classmethod
    def __get_validators__(cls):  # noqa: D105
        def validate(mailto: str):
            """Checks whether the provided value follows the `mailto:email` format."""
            if not mailto.startswith("mailto:"):
                raise TypeError("Invalid `mailto:email` value")
            valid = validate_email(mailto[7:])
            return cls(f"mailto:{valid[1]}")

        yield validate

contexts

Base xAPI Context definitions.

BaseXapiContext (BaseModelWithConfig) pydantic-model

Pydantic model for context property.

Attributes:

Name Type Description
registration UUID

The registration that the Statement is associated with.

instructor dict

The instructor that the Statement relates to.

team dict

The team that this Statement relates to.

contextActivities dict

See BaseXapiContextContextActivities.

revision str

The revision of the activity associated with this Statement.

platform str

The platform where the learning activity took place.

language dict

The language in which the experience occurred.

statement dict

Another Statement giving context for this Statement.

extensions dict

Consists of an dictionary of other properties as needed.

Source code in ralph/models/xapi/base/contexts.py
class BaseXapiContext(BaseModelWithConfig):
    """Pydantic model for `context` property.

    Attributes:
        registration (UUID): The registration that the Statement is associated with.
        instructor (dict): The instructor that the Statement relates to.
        team (dict): The team that this Statement relates to.
        contextActivities (dict): See BaseXapiContextContextActivities.
        revision (str): The revision of the activity associated with this Statement.
        platform (str): The platform where the learning activity took place.
        language (dict): The language in which the experience occurred.
        statement (dict): Another Statement giving context for this Statement.
        extensions (dict): Consists of an dictionary of other properties as needed.
    """

    registration: Optional[UUID]
    instructor: Optional[BaseXapiAgent]
    team: Optional[BaseXapiGroup]
    contextActivities: Optional[BaseXapiContextContextActivities]
    revision: Optional[StrictStr]
    platform: Optional[StrictStr]
    language: Optional[LanguageTag]
    statement: Optional[BaseXapiStatementRef]
    extensions: Optional[Dict[IRI, Union[str, int, bool, list, dict, None]]]

BaseXapiContextContextActivities (BaseModelWithConfig) pydantic-model

Pydantic model for context contextActivities property.

Attributes:

Name Type Description
parent dict or list

An Activity with a direct relation to the statement’s Activity.

grouping dict or list

An Activity with an indirect relation to the statement’s Activity.

category dict or list

An Activity used to categorize the Statement.

other dict or list

A contextActivity that doesn’t fit one of the other properties.

Source code in ralph/models/xapi/base/contexts.py
class BaseXapiContextContextActivities(BaseModelWithConfig):
    """Pydantic model for context `contextActivities` property.

    Attributes:
        parent (dict or list): An Activity with a direct relation to the statement's
            Activity.
        grouping (dict or list): An Activity with an indirect relation to the
            statement's Activity.
        category (dict or list): An Activity used to categorize the Statement.
        other (dict or list): A contextActivity that doesn't fit one of the other
            properties.
    """

    parent: Optional[Union[BaseXapiActivity, List[BaseXapiActivity]]]
    grouping: Optional[Union[BaseXapiActivity, List[BaseXapiActivity]]]
    category: Optional[Union[BaseXapiActivity, List[BaseXapiActivity]]]
    other: Optional[Union[BaseXapiActivity, List[BaseXapiActivity]]]

groups

Base xAPI Group definitions.

BaseXapiAnonymousGroup (BaseXapiGroupCommonProperties) pydantic-model

Pydantic model for Group type property.

It is defined for Anonymous Group type.

Attributes:

Name Type Description
member list

Consist of a list of the members of this Group.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiAnonymousGroup(BaseXapiGroupCommonProperties):
    """Pydantic model for `Group` type property.

    It is defined for Anonymous Group type.

    Attributes:
        member (list): Consist of a list of the members of this Group.
    """

    member: List[BaseXapiAgent]

BaseXapiGroupCommonProperties (BaseModelWithConfig, ABC) pydantic-model

Pydantic model for core Group type property.

It is defined for the Group which performed the action.

Attributes:

Name Type Description
objectType str

Consists of the value Group.

name str

Consists of the full name of the Group.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiGroupCommonProperties(BaseModelWithConfig, ABC):
    """Pydantic model for core `Group` type property.

    It is defined for the Group which performed the action.

    Attributes:
        objectType (str): Consists of the value `Group`.
        name (str): Consists of the full name of the Group.
    """

    objectType: Literal["Group"]
    name: Optional[StrictStr]

BaseXapiIdentifiedGroup (BaseXapiGroupCommonProperties) pydantic-model

Pydantic model for Group type property.

It is defined for Identified Group type.

Attributes:

Name Type Description
member list

Consist of a list of the members of this Group.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiIdentifiedGroup(BaseXapiGroupCommonProperties):
    """Pydantic model for `Group` type property.

    It is defined for Identified Group type.

    Attributes:
        member (list): Consist of a list of the members of this Group.
    """

    member: Optional[List[BaseXapiAgent]]

BaseXapiIdentifiedGroupWithAccount (BaseXapiIdentifiedGroup, BaseXapiAccountIFI) pydantic-model

Pydantic model for Group type property.

It is defined for group type with an account IFI.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiIdentifiedGroupWithAccount(BaseXapiIdentifiedGroup, BaseXapiAccountIFI):
    """Pydantic model for `Group` type property.

    It is defined for group type with an account IFI.
    """

BaseXapiIdentifiedGroupWithMbox (BaseXapiIdentifiedGroup, BaseXapiMboxIFI) pydantic-model

Pydantic model for Group type property.

It is defined for group type with a mailto IFI.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiIdentifiedGroupWithMbox(BaseXapiIdentifiedGroup, BaseXapiMboxIFI):
    """Pydantic model for `Group` type property.

    It is defined for group type with a mailto IFI.
    """

BaseXapiIdentifiedGroupWithMboxSha1Sum (BaseXapiIdentifiedGroup, BaseXapiMboxSha1SumIFI) pydantic-model

Pydantic model for Group type property.

It is defined for group type with a hash IFI.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiIdentifiedGroupWithMboxSha1Sum(
    BaseXapiIdentifiedGroup, BaseXapiMboxSha1SumIFI
):
    """Pydantic model for `Group` type property.

    It is defined for group type with a hash IFI.
    """

BaseXapiIdentifiedGroupWithOpenId (BaseXapiIdentifiedGroup, BaseXapiOpenIdIFI) pydantic-model

Pydantic model for Group type property.

It is defined for group type with an openID IFI.

Source code in ralph/models/xapi/base/groups.py
class BaseXapiIdentifiedGroupWithOpenId(BaseXapiIdentifiedGroup, BaseXapiOpenIdIFI):
    """Pydantic model for `Group` type property.

    It is defined for group type with an openID IFI.
    """

ifi

Base xAPI Inverse Functional Identifier definitions.

BaseXapiAccount (BaseModelWithConfig) pydantic-model

Pydantic model for IFI account property.

Attributes:

Name Type Description
homePage IRI

Consists of the home page of the account’s service provider.

name str

Consists of the unique id or name of the Actor’s account.

Source code in ralph/models/xapi/base/ifi.py
class BaseXapiAccount(BaseModelWithConfig):
    """Pydantic model for IFI `account` property.

    Attributes:
        homePage (IRI): Consists of the home page of the account's service provider.
        name (str): Consists of the unique id or name of the Actor's account.
    """

    homePage: IRI
    name: StrictStr

BaseXapiAccountIFI (BaseModelWithConfig) pydantic-model

Pydantic model for account Inverse Functional Identifier.

Attributes:

Name Type Description
account dict

See BaseXapiAccount.

Source code in ralph/models/xapi/base/ifi.py
class BaseXapiAccountIFI(BaseModelWithConfig):
    """Pydantic model for account Inverse Functional Identifier.

    Attributes:
        account (dict): See BaseXapiAccount.
    """

    account: BaseXapiAccount

BaseXapiMboxIFI (BaseModelWithConfig) pydantic-model

Pydantic model for mailto Inverse Functional Identifier.

Attributes:

Name Type Description
mbox MailtoEmail

Consists of the Agent’s email address.

Source code in ralph/models/xapi/base/ifi.py
class BaseXapiMboxIFI(BaseModelWithConfig):
    """Pydantic model for mailto Inverse Functional Identifier.

    Attributes:
        mbox (MailtoEmail): Consists of the Agent's email address.
    """

    mbox: MailtoEmail

BaseXapiMboxSha1SumIFI (BaseModelWithConfig) pydantic-model

Pydantic model for hash Inverse Functional Identifier.

Attributes:

Name Type Description
mbox_sha1sum str

Consists of the SHA1 hash of the Agent’s email address.

Source code in ralph/models/xapi/base/ifi.py
class BaseXapiMboxSha1SumIFI(BaseModelWithConfig):
    """Pydantic model for hash Inverse Functional Identifier.

    Attributes:
        mbox_sha1sum (str): Consists of the SHA1 hash of the Agent's email address.
    """

    mbox_sha1sum: constr(regex=r"^[0-9a-f]{40}$")  # noqa:F722

BaseXapiOpenIdIFI (BaseModelWithConfig) pydantic-model

Pydantic model for OpenID Inverse Functional Identifier.

Attributes:

Name Type Description
openid URI

Consists of an openID that uniquely identifies the Agent.

Source code in ralph/models/xapi/base/ifi.py
class BaseXapiOpenIdIFI(BaseModelWithConfig):
    """Pydantic model for OpenID Inverse Functional Identifier.

    Attributes:
        openid (URI): Consists of an openID that uniquely identifies the Agent.
    """

    openid: AnyUrl

objects

Base xAPI Object definitions (2).

BaseXapiSubStatement (BaseModelWithConfig) pydantic-model

Pydantic model for SubStatement type property.

Attributes:

Name Type Description
actor dict

See BaseXapiAgent and BaseXapiGroup.

verb dict

See BaseXapiVerb.

object dict

See BaseXapiUnnestedObject.

objecType dict

Consists of the value SubStatement.

Source code in ralph/models/xapi/base/objects.py
class BaseXapiSubStatement(BaseModelWithConfig):
    """Pydantic model for `SubStatement` type property.

    Attributes:
        actor (dict): See BaseXapiAgent and BaseXapiGroup.
        verb (dict): See BaseXapiVerb.
        object (dict): See BaseXapiUnnestedObject.
        objecType (dict): Consists of the value `SubStatement`.
    """

    actor: Union[BaseXapiAgent, BaseXapiGroup]
    verb: BaseXapiVerb
    object: BaseXapiUnnestedObject
    objectType: Literal["SubStatement"]
    result: Optional[BaseXapiResult]
    context: Optional[BaseXapiContext]
    timestamp: Optional[datetime]
    attachments: Optional[List[BaseXapiAttachment]]

results

Base xAPI Result definitions.

BaseXapiResult (BaseModelWithConfig) pydantic-model

Pydantic model for result property.

Attributes:

Name Type Description
score dict

See BaseXapiResultScore.

success bool

Indicates whether the attempt on the Activity was successful.

completion bool

Indicates whether the Activity was completed.

response str

Consists of the response for the given Activity.

duration timedelta

Consists of the duration over which the Statement occurred.

extensions dict

Consists of a dictionary of other properties as needed.

Source code in ralph/models/xapi/base/results.py
class BaseXapiResult(BaseModelWithConfig):
    """Pydantic model for `result` property.

    Attributes:
        score (dict): See BaseXapiResultScore.
        success (bool): Indicates whether the attempt on the Activity was successful.
        completion (bool): Indicates whether the Activity was completed.
        response (str): Consists of the response for the given Activity.
        duration (timedelta): Consists of the duration over which the Statement
            occurred.
        extensions (dict): Consists of a dictionary of other properties as needed.
    """

    score: Optional[BaseXapiResultScore]
    success: Optional[StrictBool]
    completion: Optional[StrictBool]
    response: Optional[StrictStr]
    duration: Optional[timedelta]
    extensions: Optional[Dict[IRI, Union[str, int, bool, list, dict, None]]]

BaseXapiResultScore (BaseModelWithConfig) pydantic-model

Pydantic model for result score property.

Attributes:

Name Type Description
scaled int

Consists of the normalized score related to the experience.

raw Decimal

Consists of the non-normalized score achieved by the Actor.

min Decimal

Consists of lowest possible score.

max Decimal

Consists of highest possible score.

Source code in ralph/models/xapi/base/results.py
class BaseXapiResultScore(BaseModelWithConfig):
    """Pydantic model for result `score` property.

    Attributes:
        scaled (int): Consists of the normalized score related to the experience.
        raw (Decimal): Consists of the non-normalized score achieved by the Actor.
        min (Decimal): Consists of lowest possible score.
        max (Decimal): Consists of highest possible score.
    """

    scaled: Optional[conint(ge=-1, le=1)]
    raw: Optional[Decimal]
    min: Optional[Decimal]
    max: Optional[Decimal]

    @root_validator
    @classmethod
    def check_raw_min_max_relation(cls, values):
        """Checks the relationship `min < raw < max`."""
        raw_value = values.get("raw", None)
        min_value = values.get("min", None)
        max_value = values.get("max", None)

        if min_value:
            if max_value and min_value > max_value:
                raise ValueError("min cannot be greater than max")
            if raw_value and min_value > raw_value:
                raise ValueError("min cannot be greater than raw")
        if max_value:
            if raw_value and raw_value > max_value:
                raise ValueError("raw cannot be greater than max")

        return values
check_raw_min_max_relation(values) classmethod

Checks the relationship min < raw < max.

Source code in ralph/models/xapi/base/results.py
@root_validator
@classmethod
def check_raw_min_max_relation(cls, values):
    """Checks the relationship `min < raw < max`."""
    raw_value = values.get("raw", None)
    min_value = values.get("min", None)
    max_value = values.get("max", None)

    if min_value:
        if max_value and min_value > max_value:
            raise ValueError("min cannot be greater than max")
        if raw_value and min_value > raw_value:
            raise ValueError("min cannot be greater than raw")
    if max_value:
        if raw_value and raw_value > max_value:
            raise ValueError("raw cannot be greater than max")

    return values

statements

Base xAPI Statement definitions.

BaseXapiStatement (BaseModelWithConfig) pydantic-model

Pydantic model for base xAPI statements.

Attributes:

Name Type Description
id UUID

Consists of a generated UUID string from the source event string.

actor dict

Consists of a definition of who performed the action.

verb dict

Consists of the action between an Actor and an Activity.

object dict

Consists of a definition of the thing that was acted on.

result dict

Consists of the outcome related to the Statement.

context dict

Consists of contextual information for the Statement.

timestamp datetime

Consists of the timestamp of when the event occurred.

stored datetime

Consists of the timestamp of when the event was recorded.

authority dict

Consists of the Actor asserting this Statement is true.

version str

Consists of the associated xAPI version of the Statement.

attachments list

Consists of a list of attachments.

Source code in ralph/models/xapi/base/statements.py
class BaseXapiStatement(BaseModelWithConfig):
    """Pydantic model for base xAPI statements.

    Attributes:
        id (UUID): Consists of a generated UUID string from the source event string.
        actor (dict): Consists of a definition of who performed the action.
        verb (dict): Consists of the action between an Actor and an Activity.
        object (dict): Consists of a definition of the thing that was acted on.
        result (dict): Consists of the outcome related to the Statement.
        context (dict): Consists of contextual information for the Statement.
        timestamp (datetime): Consists of the timestamp of when the event occurred.
        stored (datetime): Consists of the timestamp of when the event was recorded.
        authority (dict): Consists of the Actor asserting this Statement is true.
        version (str): Consists of the associated xAPI version of the Statement.
        attachments (list): Consists of a list of attachments.
    """

    id: Optional[UUID]
    actor: Union[BaseXapiAgent, BaseXapiGroup]
    verb: BaseXapiVerb
    object: BaseXapiObject
    result: Optional[BaseXapiResult]
    context: Optional[BaseXapiContext]
    timestamp: Optional[datetime]
    stored: Optional[datetime]
    authority: Optional[Union[BaseXapiAgent, BaseXapiGroup]]
    version: constr(regex=r"^1\.0\.[0-9]+$") = "1.0.0"  # noqa:F722
    attachments: Optional[List[BaseXapiAttachment]]

    @root_validator(pre=True)
    @classmethod
    def check_abscence_of_empty_and_invalid_values(cls, values):
        """Checks the model for empty and invalid values.

        Checks that the `context` field contains `platform` and `revision` fields
        only if the `object.objectType` property is equal to `Activity`.
        """
        for field, value in list(values.items()):
            if value in [None, "", {}]:
                raise ValueError(f"{field}: invalid empty value")
            if isinstance(value, dict) and field != "extensions":
                cls.check_abscence_of_empty_and_invalid_values(value)

        context = dict(values.get("context", {}))
        if context:
            platform = context.get("platform", {})
            revision = context.get("revision", {})
            object_type = dict(values["object"]).get("objectType", "Activity")
            if (platform or revision) and object_type != "Activity":
                raise ValueError(
                    "revision and platform properties can only be used if the "
                    "Statement's Object is an Activity"
                )
        return values
check_abscence_of_empty_and_invalid_values(values) classmethod

Checks the model for empty and invalid values.

Checks that the context field contains platform and revision fields only if the object.objectType property is equal to Activity.

Source code in ralph/models/xapi/base/statements.py
@root_validator(pre=True)
@classmethod
def check_abscence_of_empty_and_invalid_values(cls, values):
    """Checks the model for empty and invalid values.

    Checks that the `context` field contains `platform` and `revision` fields
    only if the `object.objectType` property is equal to `Activity`.
    """
    for field, value in list(values.items()):
        if value in [None, "", {}]:
            raise ValueError(f"{field}: invalid empty value")
        if isinstance(value, dict) and field != "extensions":
            cls.check_abscence_of_empty_and_invalid_values(value)

    context = dict(values.get("context", {}))
    if context:
        platform = context.get("platform", {})
        revision = context.get("revision", {})
        object_type = dict(values["object"]).get("objectType", "Activity")
        if (platform or revision) and object_type != "Activity":
            raise ValueError(
                "revision and platform properties can only be used if the "
                "Statement's Object is an Activity"
            )
    return values

unnested_objects

Base xAPI Object definitions (1).

BaseXapiActivity (BaseModelWithConfig) pydantic-model

Pydantic model for Activity type property.

Attributes:

Name Type Description
id IRI

Consists of an identifier for a single unique Activity.

objectType str

Consists of the value Activity.

definition dict

See BaseXapiActivityDefinition and BaseXapiActivityInteractionDefinition.

Source code in ralph/models/xapi/base/unnested_objects.py
class BaseXapiActivity(BaseModelWithConfig):
    """Pydantic model for `Activity` type property.

    Attributes:
        id (IRI): Consists of an identifier for a single unique Activity.
        objectType (str): Consists of the value `Activity`.
        definition (dict): See BaseXapiActivityDefinition and
            BaseXapiActivityInteractionDefinition.
    """

    id: IRI
    objectType: Optional[Literal["Activity"]]
    definition: Optional[
        Union[
            BaseXapiActivityDefinition,
            BaseXapiActivityInteractionDefinition,
        ]
    ]

BaseXapiActivityDefinition (BaseModelWithConfig) pydantic-model

Pydantic model for Activity type definition property.

Attributes:

Name Type Description
name LanguageMap

Consists of the human readable/visual name of the Activity.

description LanguageMap

Consists of a description of the Activity.

type IRI

Consists of the type of the Activity.

moreInfo URL

Consists of an URL to a document about the Activity.

extensions dict

Consists of a dictionary of other properties as needed.

Source code in ralph/models/xapi/base/unnested_objects.py
class BaseXapiActivityDefinition(BaseModelWithConfig):
    """Pydantic model for `Activity` type `definition` property.

    Attributes:
        name (LanguageMap): Consists of the human readable/visual name of the Activity.
        description (LanguageMap): Consists of a description of the Activity.
        type (IRI): Consists of the type of the Activity.
        moreInfo (URL): Consists of an URL to a document about the Activity.
        extensions (dict): Consists of a dictionary of other properties as needed.
    """

    name: Optional[LanguageMap]
    description: Optional[LanguageMap]
    type: Optional[IRI]
    moreInfo: Optional[AnyUrl]
    extensions: Optional[Dict[IRI, Union[str, int, bool, list, dict, None]]]

BaseXapiActivityInteractionDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for Activity type definition property.

It is defined for field with interaction properties.

Attributes:

Name Type Description
interactionType str

Consists of the type of the interaction.

correctResponsesPattern list

Consists of a pattern for the correct response.

choices list

Consists of a list of selectable choices.

scale list

Consists of a list of the options on the likert scale.

source list

Consists of a list of sources to be matched.

target list

Consists of a list of targets to be matched.

steps list

Consists of a list of the elements making up the interaction.

Source code in ralph/models/xapi/base/unnested_objects.py
class BaseXapiActivityInteractionDefinition(BaseXapiActivityDefinition):
    """Pydantic model for `Activity` type `definition` property.

    It is defined for field with interaction properties.

    Attributes:
        interactionType (str): Consists of the type of the interaction.
        correctResponsesPattern (list): Consists of a pattern for the correct response.
        choices (list): Consists of a list of selectable choices.
        scale (list): Consists of a list of the options on the `likert` scale.
        source (list): Consists of a list of sources to be matched.
        target (list): Consists of a list of targets to be matched.
        steps (list): Consists of a list of the elements making up the interaction.
    """

    interactionType: Literal[
        "true-false",
        "choice",
        "fill-in",
        "long-fill-in",
        "matching",
        "performance",
        "sequencing",
        "likert",
        "numeric",
        "other",
    ]
    correctResponsesPattern: Optional[List[StrictStr]]
    choices: Optional[List[BaseXapiInteractionComponent]]
    scale: Optional[List[BaseXapiInteractionComponent]]
    source: Optional[List[BaseXapiInteractionComponent]]
    target: Optional[List[BaseXapiInteractionComponent]]
    steps: Optional[List[BaseXapiInteractionComponent]]

    @validator("choices", "scale", "source", "target", "steps")
    @classmethod
    def check_unique_ids(cls, value):
        """Checks the uniqueness of interaction components IDs."""
        if len(value) != len({x.id for x in value}):
            raise ValueError("Duplicate InteractionComponents are not valid")
check_unique_ids(value) classmethod

Checks the uniqueness of interaction components IDs.

Source code in ralph/models/xapi/base/unnested_objects.py
@validator("choices", "scale", "source", "target", "steps")
@classmethod
def check_unique_ids(cls, value):
    """Checks the uniqueness of interaction components IDs."""
    if len(value) != len({x.id for x in value}):
        raise ValueError("Duplicate InteractionComponents are not valid")

BaseXapiInteractionComponent (BaseModelWithConfig) pydantic-model

Pydantic model for an interaction component.

Attributes:

Name Type Description
id str

Consists of an identifier of the interaction component.

description LanguageMap

Consists of the description of the interaction.

Source code in ralph/models/xapi/base/unnested_objects.py
class BaseXapiInteractionComponent(BaseModelWithConfig):
    """Pydantic model for an interaction component.

    Attributes:
        id (str): Consists of an identifier of the interaction component.
        description (LanguageMap): Consists of the description of the interaction.
    """

    id: constr(regex=r"^[^\s]+$")  # noqa:F722
    description: Optional[LanguageMap]

BaseXapiStatementRef (BaseModelWithConfig) pydantic-model

Pydantic model for StatementRef type property.

Attributes:

Name Type Description
objectType str

Consists of the value StatementRef.

id UUID

Consists of the UUID of the referenced statement.

Source code in ralph/models/xapi/base/unnested_objects.py
class BaseXapiStatementRef(BaseModelWithConfig):
    """Pydantic model for `StatementRef` type property.

    Attributes:
        objectType (str): Consists of the value `StatementRef`.
        id (UUID): Consists of the UUID of the referenced statement.
    """

    id: UUID
    objectType: Literal["StatementRef"]

verbs

Base xAPI Verb definitions.

BaseXapiVerb (BaseModelWithConfig) pydantic-model

Pydantic model for verb property.

Attributes:

Name Type Description
id IRI

Consists of an identifier for the verb.

display LanguageMap

Consists of a human readable representation of the verb.

Source code in ralph/models/xapi/base/verbs.py
class BaseXapiVerb(BaseModelWithConfig):
    """Pydantic model for `verb` property.

    Attributes:
        id (IRI): Consists of an identifier for the verb.
        display (LanguageMap): Consists of a human readable representation of the verb.
    """

    id: IRI
    display: Optional[LanguageMap]

concepts special

activity_types special

acrossx_profile

AcrossX Profile activity types definitions.

MessageActivity (BaseXapiActivity) pydantic-model

Pydantic model for message Activity type.

Attributes:

Name Type Description
definition dict

see MessageActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/acrossx_profile.py
class MessageActivity(BaseXapiActivity):
    """Pydantic model for message `Activity` type.

    Attributes:
        definition (dict): see MessageActivityDefinition.
    """

    definition: MessageActivityDefinition = MessageActivityDefinition()
MessageActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for message Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value https://w3id.org/xapi/acrossx/activities/message.

Source code in ralph/models/xapi/concepts/activity_types/acrossx_profile.py
class MessageActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for message `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `https://w3id.org/xapi/acrossx/activities/message`.
    """

    type: Literal[
        "https://w3id.org/xapi/acrossx/activities/message"
    ] = "https://w3id.org/xapi/acrossx/activities/message"

activity_streams_vocabulary

Activity streams vocabulary activity types definitions.

PageActivity (BaseXapiActivity) pydantic-model

Pydantic model for page Activity type.

Attributes:

Name Type Description
definition dict

See PageActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/activity_streams_vocabulary.py
class PageActivity(BaseXapiActivity):
    """Pydantic model for page `Activity` type.

    Attributes:
        definition (dict): See PageActivityDefinition.
    """

    definition: PageActivityDefinition = PageActivityDefinition()
PageActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for page Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value http://activitystrea.ms/schema/1.0/page.

Source code in ralph/models/xapi/concepts/activity_types/activity_streams_vocabulary.py
class PageActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for page `Activity` type `definition` property.

    Attributes:
       type (str): Consists of the value `http://activitystrea.ms/schema/1.0/page`.
    """

    type: Literal[
        "http://activitystrea.ms/schema/1.0/page"
    ] = "http://activitystrea.ms/schema/1.0/page"

scorm_profile

Scorm Profile activity types definitions.

CMIInteractionActivity (BaseXapiActivity) pydantic-model

Pydantic model for CMI Interaction Activity type.

Attributes:

Name Type Description
definition dict

see CMIInteractionActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class CMIInteractionActivity(BaseXapiActivity):
    """Pydantic model for CMI Interaction `Activity` type.

    Attributes:
        definition (dict): see CMIInteractionActivityDefinition.
    """

    definition: CMIInteractionActivityDefinition = CMIInteractionActivityDefinition()
CMIInteractionActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for CMI Interaction Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value http://adlnet.gov/expapi/activities/cmi.interaction.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class CMIInteractionActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for CMI Interaction `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `http://adlnet.gov/expapi/activities/cmi.interaction`.
    """

    type: Literal[
        "http://adlnet.gov/expapi/activities/cmi.interaction"
    ] = "http://adlnet.gov/expapi/activities/cmi.interaction"
CourseActivity (BaseXapiActivity) pydantic-model

Pydantic model for course Activity type.

Attributes:

Name Type Description
definition dict

see CourseActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class CourseActivity(BaseXapiActivity):
    """Pydantic model for course `Activity` type.

    Attributes:
        definition (dict): see CourseActivityDefinition.
    """

    definition: CourseActivityDefinition = CourseActivityDefinition()
CourseActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for course Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value http://adlnet.gov/expapi/activities/course.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class CourseActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for course `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `http://adlnet.gov/expapi/activities/course`.
    """

    type: Literal[
        "http://adlnet.gov/expapi/activities/course"
    ] = "http://adlnet.gov/expapi/activities/course"
ModuleActivity (BaseXapiActivity) pydantic-model

Pydantic model for module Activity type.

Attributes:

Name Type Description
definition dict

see ModuleActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class ModuleActivity(BaseXapiActivity):
    """Pydantic model for module `Activity` type.

    Attributes:
        definition (dict): see ModuleActivityDefinition.
    """

    definition: ModuleActivityDefinition = ModuleActivityDefinition()
ModuleActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for module Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value http://adlnet.gov/expapi/activities/module.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class ModuleActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for module `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `http://adlnet.gov/expapi/activities/module`.
    """

    type: Literal[
        "http://adlnet.gov/expapi/activities/module"
    ] = "http://adlnet.gov/expapi/activities/module"
ProfileActivity (BaseXapiActivity) pydantic-model

Pydantic model for profile Activity type.

Attributes:

Name Type Description
definition dict

see ProfileActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class ProfileActivity(BaseXapiActivity):
    """Pydantic model for profile `Activity` type.

    Attributes:
        definition (dict): see ProfileActivityDefinition.
    """

    definition: ProfileActivityDefinition = ProfileActivityDefinition()
ProfileActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for profile Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value http://adlnet.gov/expapi/activities/profile.

Source code in ralph/models/xapi/concepts/activity_types/scorm_profile.py
class ProfileActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for profile `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `http://adlnet.gov/expapi/activities/profile`.
    """

    type: Literal[
        "http://adlnet.gov/expapi/activities/profile"
    ] = "http://adlnet.gov/expapi/activities/profile"

video

Video activity types definitions.

VideoActivity (BaseXapiActivity) pydantic-model

Pydantic model for video Activity type.

WARNING: Contains an optional name property, this is not a violation of conformity but goes against xAPI specification recommendations.

Attributes:

Name Type Description
name dict

Consists of the dictionary {"en-US": <name of the video>}.

definition dict

See VideoActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/video.py
class VideoActivity(BaseXapiActivity):
    """Pydantic model for video `Activity` type.

    WARNING: Contains an optional name property, this is not a violation of
    conformity but goes against xAPI specification recommendations.

    Attributes:
        name (dict): Consists of the dictionary `{"en-US": <name of the video>}`.
        definition (dict): See VideoActivityDefinition.
    """

    name: Optional[Dict[Literal[LANG_EN_US_DISPLAY], str]]
    definition: VideoActivityDefinition = VideoActivityDefinition()
VideoActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for video Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value https://w3id.org/xapi/video/activity-type/video.

Source code in ralph/models/xapi/concepts/activity_types/video.py
class VideoActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for video `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `https://w3id.org/xapi/video/activity-type/video`.
    """

    type: Literal[
        "https://w3id.org/xapi/video/activity-type/video"
    ] = "https://w3id.org/xapi/video/activity-type/video"

virtual_classroom

Virtual classroom activity types definitions.

VirtualClassroomActivity (BaseXapiActivity) pydantic-model

Pydantic model for virtual classroom Activity type.

Attributes:

Name Type Description
definition dict

See VirtualClassroomActivityDefinition.

Source code in ralph/models/xapi/concepts/activity_types/virtual_classroom.py
class VirtualClassroomActivity(BaseXapiActivity):
    """Pydantic model for virtual classroom `Activity` type.

    Attributes:
        definition (dict): See VirtualClassroomActivityDefinition.
    """

    definition: VirtualClassroomActivityDefinition = (
        VirtualClassroomActivityDefinition()
    )
VirtualClassroomActivityDefinition (BaseXapiActivityDefinition) pydantic-model

Pydantic model for virtual classroom Activity type definition property.

Attributes:

Name Type Description
type str

Consists of the value https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom.

Source code in ralph/models/xapi/concepts/activity_types/virtual_classroom.py
class VirtualClassroomActivityDefinition(BaseXapiActivityDefinition):
    """Pydantic model for virtual classroom `Activity` type `definition` property.

    Attributes:
        type (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom`.
    """

    type: Literal[
        "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
    ] = "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"

constants special

acrossx_profile

Constants for AcrossX Profile xAPI profile.

cmi5_profile

Constants for cmi5 Profile xAPI profile.

scorm_profile

Constants for Scorm Profile xAPI profile.

tincan_vocabulary

Constants for TinCan Vocabulary xAPI profile.

video

Constants for Video xAPI profile.

verbs special

acrossx_profile

AcrossX Profile verbs definitions.

PostedVerb (BaseXapiVerb) pydantic-model

Pydantic model for posted verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/acrossx/verbs/posted.

display dict

Consists of the dictionary {"en-US": "posted"}.

Source code in ralph/models/xapi/concepts/verbs/acrossx_profile.py
class PostedVerb(BaseXapiVerb):
    """Pydantic model for posted `verb`.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/acrossx/verbs/posted`.
        display (dict): Consists of the dictionary `{"en-US": "posted"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/acrossx/verbs/posted"
    ] = "https://w3id.org/xapi/acrossx/verbs/posted"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["posted"]]]

activity_streams_vocabulary

Activity streams vocabulary verbs definitions.

JoinVerb (BaseXapiVerb) pydantic-model

Pydantic model for join verb.

Attributes:

Name Type Description
id str

Consists of the value http://activitystrea.ms/join.

display dict

Consists of the dictionary {"en-US": "joined"}.

Source code in ralph/models/xapi/concepts/verbs/activity_streams_vocabulary.py
class JoinVerb(BaseXapiVerb):
    """Pydantic model for join verb.

    Attributes:
        id (str): Consists of the value `http://activitystrea.ms/join`.
        display (dict): Consists of the dictionary `{"en-US": "joined"}`.
    """

    id: Literal["http://activitystrea.ms/join"] = "http://activitystrea.ms/join"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["joined"]]]
LeaveVerb (BaseXapiVerb) pydantic-model

Pydantic model for leave verb.

Attributes:

Name Type Description
id str

Consists of the value http://activitystrea.ms/leave.

display dict

Consists of the dictionary {"en-US": "left"}.

Source code in ralph/models/xapi/concepts/verbs/activity_streams_vocabulary.py
class LeaveVerb(BaseXapiVerb):
    """Pydantic model for leave `verb`.

    Attributes:
        id (str): Consists of the value `http://activitystrea.ms/leave`.
        display (dict): Consists of the dictionary `{"en-US": "left"}`.
    """

    id: Literal["http://activitystrea.ms/leave"] = "http://activitystrea.ms/leave"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["left"]]]

adl_vocabulary

ADL Vocabulary verbs definitions.

AnsweredVerb (BaseXapiVerb) pydantic-model

Pydantic model for answered verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/answered.

display dict

Consists of the dictionary {"en-US": "answered"}.

Source code in ralph/models/xapi/concepts/verbs/adl_vocabulary.py
class AnsweredVerb(BaseXapiVerb):
    """Pydantic model for answered `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/answered`.
        display (dict): Consists of the dictionary `{"en-US": "answered"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/answered"
    ] = "http://adlnet.gov/expapi/verbs/answered"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["answered"]]]
AskedVerb (BaseXapiVerb) pydantic-model

Pydantic model for asked verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/asked.

display dict

Consists of the dictionary {"en-US": "asked"}.

Source code in ralph/models/xapi/concepts/verbs/adl_vocabulary.py
class AskedVerb(BaseXapiVerb):
    """Pydantic model for asked `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/asked`.
        display (dict): Consists of the dictionary `{"en-US": "asked"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/asked"
    ] = "http://adlnet.gov/expapi/verbs/asked"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["asked"]]]

scorm_profile

Scorm Profile verbs definitions.

CompletedVerb (BaseXapiVerb) pydantic-model

Pydantic model for completed verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/completed.

display dict

Consists of the dictionary {"en-US": "completed"}.

Source code in ralph/models/xapi/concepts/verbs/scorm_profile.py
class CompletedVerb(BaseXapiVerb):
    """Pydantic model for completed `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/completed`.
        display (dict): Consists of the dictionary `{"en-US": "completed"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/completed"
    ] = "http://adlnet.gov/expapi/verbs/completed"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["completed"]]]
InitializedVerb (BaseXapiVerb) pydantic-model

Pydantic model for initialized verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/initialized.

display Dict

Consists of the dictionary {"en-US": "initialized"}.

Source code in ralph/models/xapi/concepts/verbs/scorm_profile.py
class InitializedVerb(BaseXapiVerb):
    """Pydantic model for initialized `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/initialized`.
        display (Dict): Consists of the dictionary `{"en-US": "initialized"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/initialized"
    ] = "http://adlnet.gov/expapi/verbs/initialized"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["initialized"]]]
InteractedVerb (BaseXapiVerb) pydantic-model

Pydantic model for interacted verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/interacted.

display dict

Consists of the dictionary {"en-US": "interacted"}.

Source code in ralph/models/xapi/concepts/verbs/scorm_profile.py
class InteractedVerb(BaseXapiVerb):
    """Pydantic model for interacted `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/interacted`.
        display (dict): Consists of the dictionary `{"en-US": "interacted"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/interacted"
    ] = "http://adlnet.gov/expapi/verbs/interacted"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["interacted"]]]
TerminatedVerb (BaseXapiVerb) pydantic-model

Pydantic model for terminated verb.

Attributes:

Name Type Description
id str

Consists of the value http://adlnet.gov/expapi/verbs/terminated.

display dict

Consists of the dictionary {"en-US": "terminated"}.

Source code in ralph/models/xapi/concepts/verbs/scorm_profile.py
class TerminatedVerb(BaseXapiVerb):
    """Pydantic model for terminated `verb`.

    Attributes:
        id (str): Consists of the value `http://adlnet.gov/expapi/verbs/terminated`.
        display (dict): Consists of the dictionary `{"en-US": "terminated"}`.
    """

    id: Literal[
        "http://adlnet.gov/expapi/verbs/terminated"
    ] = "http://adlnet.gov/expapi/verbs/terminated"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["terminated"]]]

tincan_vocabulary

TinCan Vocabulary verbs definitions.

ViewedVerb (BaseXapiVerb) pydantic-model

Pydantic model for viewed verb.

Attributes:

Name Type Description
id str

Consists of the value http://id.tincanapi.com/verb/viewed.

display dict

Consists of the dictionary {"en-US": "viewed"}.

Source code in ralph/models/xapi/concepts/verbs/tincan_vocabulary.py
class ViewedVerb(BaseXapiVerb):
    """Pydantic model for viewed `verb`.

    Attributes:
        id (str): Consists of the value `http://id.tincanapi.com/verb/viewed`.
        display (dict): Consists of the dictionary `{"en-US": "viewed"}`.
    """

    id: Literal[
        "http://id.tincanapi.com/verb/viewed"
    ] = "http://id.tincanapi.com/verb/viewed"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["viewed"]]]

video

Video verbs definitions.

PausedVerb (BaseXapiVerb) pydantic-model

Pydantic model for paused verb field.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/video/verbs/paused.

display dict

Consists of the dictionary {"en-US": "paused"}.

Source code in ralph/models/xapi/concepts/verbs/video.py
class PausedVerb(BaseXapiVerb):
    """Pydantic model for paused `verb` field.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/video/verbs/paused`.
        display (dict): Consists of the dictionary `{"en-US": "paused"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/video/verbs/paused"
    ] = "https://w3id.org/xapi/video/verbs/paused"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["paused"]]]
PlayedVerb (BaseXapiVerb) pydantic-model

Pydantic model for played verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/video/verbs/played.

display dict

Consists of the dictionary {"en-US": "played"}.

Source code in ralph/models/xapi/concepts/verbs/video.py
class PlayedVerb(BaseXapiVerb):
    """Pydantic model for played `verb`.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/video/verbs/played`.
        display (dict): Consists of the dictionary `{"en-US": "played"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/video/verbs/played"
    ] = "https://w3id.org/xapi/video/verbs/played"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["played"]]]
SeekedVerb (BaseXapiVerb) pydantic-model

Pydantic model for seeked verb field.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/video/verbs/seeked.

display dict

Consists of the dictionary {"en-US": "seeked"}.

Source code in ralph/models/xapi/concepts/verbs/video.py
class SeekedVerb(BaseXapiVerb):
    """Pydantic model for seeked `verb` field.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/video/verbs/seeked`.
        display (dict): Consists of the dictionary `{"en-US": "seeked"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/video/verbs/seeked"
    ] = "https://w3id.org/xapi/video/verbs/seeked"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["seeked"]]]

virtual_classroom

Virtual classroom verbs definitions.

LoweredHandVerb (BaseXapiVerb) pydantic-model

Pydantic model for lowered hand verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/lowered-hand.

display dict

Consists of the dictionary {"en-US": "lowered hand"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class LoweredHandVerb(BaseXapiVerb):
    """Pydantic model for lowered hand `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/lowered-hand`.
        display (dict): Consists of the dictionary `{"en-US": "lowered hand"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/lowered-hand"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/lowered-hand"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["lowered hand"]]]
MutedVerb (BaseXapiVerb) pydantic-model

Pydantic model for muted verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/muted.

display dict

Consists of the dictionary {"en-US": "muted"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class MutedVerb(BaseXapiVerb):
    """Pydantic model for muted `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/muted`.
        display (dict): Consists of the dictionary `{"en-US": "muted"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/muted"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/muted"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["muted"]]]
RaisedHandVerb (BaseXapiVerb) pydantic-model

Pydantic model for raised hand verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/raised-hand.

display dict

Consists of the dictionary {"en-US": "raised hand"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class RaisedHandVerb(BaseXapiVerb):
    """Pydantic model for raised hand `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/raised-hand`.
        display (dict): Consists of the dictionary `{"en-US": "raised hand"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/raised-hand"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/raised-hand"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["raised hand"]]]
SharedScreenVerb (BaseXapiVerb) pydantic-model

Pydantic model for shared screen verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/shared-screen.

display dict

Consists of the dictionary {"en-US": "shared screen"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class SharedScreenVerb(BaseXapiVerb):
    """Pydantic model for shared screen `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/shared-screen`.
        display (dict): Consists of the dictionary `{"en-US": "shared screen"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/shared-screen"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/shared-screen"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["shared screen"]]]
StartedCameraVerb (BaseXapiVerb) pydantic-model

Pydantic model for started camera verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/started-camera.

display dict

Consists of the dictionary {"en-US": "started camera"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class StartedCameraVerb(BaseXapiVerb):
    """Pydantic model for started camera `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/started-camera`.
        display (dict): Consists of the dictionary `{"en-US": "started camera"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/started-camera"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/started-camera"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["started camera"]]]
StoppedCameraVerb (BaseXapiVerb) pydantic-model

Pydantic model for stopped camera verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/stopped-camera.

display dict

Consists of the dictionary {"en-US": "stopped camera"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class StoppedCameraVerb(BaseXapiVerb):
    """Pydantic model for stopped camera `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/stopped-camera`.
        display (dict): Consists of the dictionary `{"en-US": "stopped camera"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/stopped-camera"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/stopped-camera"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["stopped camera"]]]
UnmutedVerb (BaseXapiVerb) pydantic-model

Pydantic model for unmuted verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/unmuted.

display dict

Consists of the dictionary {"en-US": "unmuted"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class UnmutedVerb(BaseXapiVerb):
    """Pydantic model for unmuted `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/unmuted`.
        display (dict): Consists of the dictionary `{"en-US": "unmuted"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/unmuted"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/unmuted"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["unmuted"]]]
UnsharedScreenVerb (BaseXapiVerb) pydantic-model

Pydantic model for unshared screen verb.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom/verbs/unshared-screen.

display dict

Consists of the dictionary {"en-US": "unshared screen"}.

Source code in ralph/models/xapi/concepts/verbs/virtual_classroom.py
class UnsharedScreenVerb(BaseXapiVerb):
    """Pydantic model for unshared screen `verb`.

    Attributes:
        id (str): Consists of the value
            `https://w3id.org/xapi/virtual-classroom/verbs/unshared-screen`.
        display (dict): Consists of the dictionary `{"en-US": "unshared screen"}`.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom/verbs/unshared-screen"
    ] = "https://w3id.org/xapi/virtual-classroom/verbs/unshared-screen"
    display: Optional[Dict[Literal[LANG_EN_US_DISPLAY], Literal["unshared screen"]]]

config

Base xAPI model configuration.

BaseExtensionModelWithConfig (BaseModel) pydantic-model

Pydantic model for extension configuration shared among all models.

Source code in ralph/models/xapi/config.py
class BaseExtensionModelWithConfig(BaseModel):
    """Pydantic model for extension configuration shared among all models."""

    class Config:  # pylint: disable=missing-class-docstring # noqa: D106
        extra = Extra.allow
        min_anystr_length = 0

BaseModelWithConfig (BaseModel) pydantic-model

Pydantic model for base configuration shared among all models.

Source code in ralph/models/xapi/config.py
class BaseModelWithConfig(BaseModel):
    """Pydantic model for base configuration shared among all models."""

    class Config:  # pylint: disable=missing-class-docstring # noqa: D106
        extra = Extra.forbid
        min_anystr_length = 1

constants

Constants for xAPI specifications.

navigation special

statements

Navigation xAPI event definitions.

PageTerminated (BaseXapiStatement) pydantic-model

Pydantic model for page terminated statement.

Example: John terminated the https://www.fun-mooc.fr/ page.

Attributes:

Name Type Description
object dict

See PageActivity.

verb dict

See TerminatedVerb.

Source code in ralph/models/xapi/navigation/statements.py
class PageTerminated(BaseXapiStatement):
    """Pydantic model for page terminated statement.

    Example: John terminated the https://www.fun-mooc.fr/ page.

    Attributes:
       object (dict): See PageActivity.
       verb (dict): See TerminatedVerb.
    """

    __selector__ = selector(
        object__definition__type="http://activitystrea.ms/schema/1.0/page",
        verb__id="http://adlnet.gov/expapi/verbs/terminated",
    )

    object: PageActivity
    verb: TerminatedVerb = TerminatedVerb()

PageViewed (BaseXapiStatement) pydantic-model

Pydantic model for page viewed statement.

Example: John viewed the https://www.fun-mooc.fr/ page.

Attributes:

Name Type Description
object dict

See PageActivity.

verb dict

See ViewedVerb.

Source code in ralph/models/xapi/navigation/statements.py
class PageViewed(BaseXapiStatement):
    """Pydantic model for page viewed statement.

    Example: John viewed the https://www.fun-mooc.fr/ page.

    Attributes:
       object (dict): See PageActivity.
       verb (dict): See ViewedVerb.
    """

    __selector__ = selector(
        object__definition__type="http://activitystrea.ms/schema/1.0/page",
        verb__id="http://id.tincanapi.com/verb/viewed",
    )

    object: PageActivity
    verb: ViewedVerb = ViewedVerb()

video special

contexts

Video xAPI events context fields definitions.

BaseVideoContext (BaseXapiContext) pydantic-model

Pydantic model for video core context property.

Attributes:

Name Type Description
contextActivities dict

see VideoContextContextActivities.

Source code in ralph/models/xapi/video/contexts.py
class BaseVideoContext(BaseXapiContext):
    """Pydantic model for video core `context` property.

    Attributes:
        contextActivities (dict): see VideoContextContextActivities.
    """

    contextActivities: Optional[VideoContextContextActivities]

VideoBrowsingContextExtensions (VideoContextExtensions) pydantic-model

Pydantic model for video browsing context.extensions property.

Such field is used in paused, completed and terminated events.

Attributes:

Name Type Description
completionThreshold float

Consists of the percentage of media that should be consumed to trigger a completion.

length float

Consists of the length of the video.

Source code in ralph/models/xapi/video/contexts.py
class VideoBrowsingContextExtensions(VideoContextExtensions):
    """Pydantic model for video browsing `context`.`extensions` property.

    Such field is used in `paused`, `completed` and `terminated` events.

    Attributes:
        completionThreshold (float): Consists of the percentage of media that should
            be consumed to trigger a completion.
        length (float): Consists of the length of the video.
    """

    length: NonNegativeFloat = Field(alias=CONTEXT_EXTENSION_LENGTH)
    completionThreshold: Optional[float] = Field(
        alias=CONTEXT_EXTENSION_COMPLETION_THRESHOLD
    )

VideoCompletedContext (BaseVideoContext) pydantic-model

Pydantic model for video completed context property.

Attributes:

Name Type Description
extensions dict

See VideoBrowsingContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoCompletedContext(BaseVideoContext):
    """Pydantic model for video completed `context` property.

    Attributes:
        extensions (dict): See VideoBrowsingContextExtensions.
    """

    extensions: VideoBrowsingContextExtensions

VideoContextContextActivities (BaseXapiContextContextActivities) pydantic-model

Pydantic model for video context.contextActivities property.

Attributes:

Name Type Description
category list

see VideoContextContextActivitiesCategory.

Source code in ralph/models/xapi/video/contexts.py
class VideoContextContextActivities(BaseXapiContextContextActivities):
    """Pydantic model for video `context`.`contextActivities` property.

    Attributes:
        category (list): see VideoContextContextActivitiesCategory.
    """

    category: Union[
        VideoContextContextActivitiesCategory,
        List[VideoContextContextActivitiesCategory],
    ]

VideoContextContextActivitiesCategory (BaseXapiActivity) pydantic-model

Pydantic model for video context.contextActivities.category property.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/video.

definition dict

see ProfileActivity.

Source code in ralph/models/xapi/video/contexts.py
class VideoContextContextActivitiesCategory(BaseXapiActivity):
    # noqa: D205, D415
    """Pydantic model for video `context`.`contextActivities`.`category`
    property.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/video`.
        definition (dict): see ProfileActivity.
    """

    id: Literal["https://w3id.org/xapi/video"] = "https://w3id.org/xapi/video"
    definition: ProfileActivity

VideoContextExtensions (BaseExtensionModelWithConfig) pydantic-model

Pydantic model for video core context extensions property.

Attributes:

Name Type Description
session uuid

Consists of the ID of the active session.

Source code in ralph/models/xapi/video/contexts.py
class VideoContextExtensions(BaseExtensionModelWithConfig):
    """Pydantic model for video core context `extensions` property.

    Attributes:
        session (uuid): Consists of the ID of the active session.
    """

    session_id: Optional[UUID] = Field(alias=CONTEXT_EXTENSION_SESSION_ID)

VideoEnableClosedCaptioningContext (BaseVideoContext) pydantic-model

Pydantic model for video enable closed captioning context property.

Attributes:

Name Type Description
extensions dict

See VideoEnableClosedCaptioningContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoEnableClosedCaptioningContext(BaseVideoContext):
    """Pydantic model for video enable closed captioning `context` property.

    Attributes:
        extensions (dict): See VideoEnableClosedCaptioningContextExtensions.
    """

    extensions: VideoEnableClosedCaptioningContextExtensions

VideoEnableClosedCaptioningContextExtensions (VideoContextExtensions) pydantic-model

Represents the context.extensions field for video interacted xAPI statement.

Attributes:

Name Type Description
ccSubtitleLanguage str

Consists of the language of subtitle or closed captioning.

Source code in ralph/models/xapi/video/contexts.py
class VideoEnableClosedCaptioningContextExtensions(VideoContextExtensions):
    """Represents the context.extensions field for video `interacted` xAPI statement.

    Attributes:
        ccSubtitleLanguage (str): Consists of the language of subtitle or closed
            captioning.
    """

    ccSubtitleLanguage: str = Field(alias=CONTEXT_EXTENSION_CC_SUBTITLE_LANG)

VideoInitializedContext (BaseVideoContext) pydantic-model

Pydantic model for video initialized context property.

Attributes:

Name Type Description
extensions dict

See VideoInitializedContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoInitializedContext(BaseVideoContext):
    """Pydantic model for video initialized `context` property.

    Attributes:
        extensions (dict): See VideoInitializedContextExtensions.
    """

    extensions: VideoInitializedContextExtensions

VideoInitializedContextExtensions (VideoContextExtensions) pydantic-model

Pydantic model for video initialized context extensions property.

Attributes:

Name Type Description
length float

Consists of the length of the video.

ccSubtitleEnabled bool

Indicates whether subtitle or closed captioning is enabled.

ccSubtitleLanguage str

Consists of the language of subtitle or closed captioning.

fullScreen bool

Indicates whether the video is played in full screen mode.

screenSize str

Consists of the device playback screen size or the maximum available screen size for Video playback.

videoPlaybackSize str

Consists of the size in Width x Height of the video as viewed by the user.

speed str

Consists of the play back speed.

userAgent str

Consists of the User Agent string of the browser, if the video is launched in browser.

volume int

Consists of the volume of the video.

completionThreshold float

Consists of the percentage of media that should be consumed to trigger a completion.

Source code in ralph/models/xapi/video/contexts.py
class VideoInitializedContextExtensions(VideoContextExtensions):
    """Pydantic model for video initialized `context` `extensions` property.

    Attributes:
        length (float): Consists of the length of the video.
        ccSubtitleEnabled (bool): Indicates whether subtitle or closed captioning is
            enabled.
        ccSubtitleLanguage (str): Consists of the language of subtitle or closed
            captioning.
        fullScreen (bool): Indicates whether the video is played in full screen mode.
        screenSize (str): Consists of the device playback screen size or the maximum
            available screen size for Video playback.
        videoPlaybackSize (str): Consists of the size in Width x Height of the video as
            viewed by the user.
        speed (str): Consists of the play back speed.
        userAgent (str): Consists of the User Agent string of the browser,
            if the video is launched in browser.
        volume (int): Consists of the volume of the video.
        completionThreshold (float): Consists of the percentage of media that should be
            consumed to trigger a completion.
    """

    length: NonNegativeFloat = Field(alias=CONTEXT_EXTENSION_LENGTH)
    ccSubtitleEnabled: Optional[bool] = Field(alias=CONTEXT_EXTENSION_CC_ENABLED)
    ccSubtitleLang: Optional[str] = Field(alias=CONTEXT_EXTENSION_CC_SUBTITLE_LANG)
    fullScreen: Optional[bool] = Field(alias=CONTEXT_EXTENSION_FULL_SCREEN)
    screenSize: Optional[str] = Field(alias=CONTEXT_EXTENSION_SCREEN_SIZE)
    videoPlaybackSize: Optional[str] = Field(
        alias=CONTEXT_EXTENSION_VIDEO_PLAYBACK_SIZE
    )
    speed: Optional[str] = Field(alias=CONTEXT_EXTENSION_SPEED)
    userAgent: Optional[str] = Field(alias=CONTEXT_EXTENSION_USER_AGENT)
    volume: Optional[int] = Field(alias=CONTEXT_EXTENSION_VOLUME)
    completionThreshold: Optional[float] = Field(
        alias=CONTEXT_EXTENSION_COMPLETION_THRESHOLD
    )

VideoPausedContext (BaseVideoContext) pydantic-model

Pydantic model for video paused context property.

Attributes:

Name Type Description
extensions dict

See VideoBrowsingContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoPausedContext(BaseVideoContext):
    """Pydantic model for video paused `context` property.

    Attributes:
        extensions (dict): See VideoBrowsingContextExtensions.
    """

    extensions: VideoBrowsingContextExtensions

VideoPlayedContext (BaseVideoContext) pydantic-model

Pydantic model for video played context property.

Attributes:

Name Type Description
extensions dict

See VideoContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoPlayedContext(BaseVideoContext):
    """Pydantic model for video played `context` property.

    Attributes:
        extensions (dict): See VideoContextExtensions.
    """

    extensions: Optional[VideoContextExtensions]

VideoScreenChangeInteractionContext (BaseVideoContext) pydantic-model

Pydantic model for video screen change interaction context property.

Attributes:

Name Type Description
extensions dict

See VideoScreenChangeInteractionContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoScreenChangeInteractionContext(BaseVideoContext):
    """Pydantic model for video screen change interaction `context` property.

    Attributes:
        extensions (dict): See VideoScreenChangeInteractionContextExtensions.
    """

    extensions: VideoScreenChangeInteractionContextExtensions

VideoScreenChangeInteractionContextExtensions (VideoContextExtensions) pydantic-model

Pydantic model for video screen change interaction context.extensions property.

Attributes:

Name Type Description
fullScreen bool

Indicates whether the video is played in full screen mode.

screenSize str

Expresses the total available screen size for Video playback.

videoPlaybackSize str

Consists of the size in Width x Height of the video as viewed by the user.

Source code in ralph/models/xapi/video/contexts.py
class VideoScreenChangeInteractionContextExtensions(VideoContextExtensions):
    # noqa: D205, D415
    """Pydantic model for video screen change interaction `context`.`extensions`
    property.

    Attributes:
        fullScreen (bool): Indicates whether the video is played in full screen mode.
        screenSize (str): Expresses the total available screen size for Video playback.
        videoPlaybackSize (str): Consists of the size in Width x Height of the video as
            viewed by the user.
    """

    fullScreen: bool = Field(alias=CONTEXT_EXTENSION_FULL_SCREEN)
    screenSize: str = Field(alias=CONTEXT_EXTENSION_SCREEN_SIZE)
    videoPlaybackSize: str = Field(alias=CONTEXT_EXTENSION_VIDEO_PLAYBACK_SIZE)

VideoSeekedContext (BaseVideoContext) pydantic-model

Pydantic model for video seeked context property.

Attributes:

Name Type Description
extensions dict

See VideoContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoSeekedContext(BaseVideoContext):
    """Pydantic model for video seeked `context` property.

    Attributes:
        extensions (dict): See VideoContextExtensions.
    """

    extensions: Optional[VideoContextExtensions]

VideoTerminatedContext (BaseVideoContext) pydantic-model

Pydantic model for video terminated context property.

Attributes:

Name Type Description
extensions dict

See VideoBrowsingContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoTerminatedContext(BaseVideoContext):
    """Pydantic model for video terminated `context` property.

    Attributes:
        extensions (dict): See VideoBrowsingContextExtensions.
    """

    extensions: VideoBrowsingContextExtensions

VideoVolumeChangeInteractionContext (BaseVideoContext) pydantic-model

Pydantic model for video volume change interaction context property.

Attributes:

Name Type Description
extensions dict

See VideoVolumeChangeInteractionContextExtensions.

Source code in ralph/models/xapi/video/contexts.py
class VideoVolumeChangeInteractionContext(BaseVideoContext):
    """Pydantic model for video volume change interaction `context` property.

    Attributes:
        extensions (dict): See VideoVolumeChangeInteractionContextExtensions.
    """

    extensions: VideoVolumeChangeInteractionContextExtensions

VideoVolumeChangeInteractionContextExtensions (VideoContextExtensions) pydantic-model

Pydantic model for video volume change interaction context.extensions property.

Attributes:

Name Type Description
volume int

Consists of the volume of the video.

Source code in ralph/models/xapi/video/contexts.py
class VideoVolumeChangeInteractionContextExtensions(VideoContextExtensions):
    # noqa: D205, D415
    """Pydantic model for video volume change interaction `context`.`extensions`
    property.

    Attributes:
        volume (int): Consists of the volume of the video.
    """

    volume: int = Field(alias=CONTEXT_EXTENSION_VOLUME)

results

Video xAPI events result fields definitions.

VideoCompletedResult (BaseXapiResult) pydantic-model

Pydantic model for video completed result property.

Attributes:

Name Type Description
extensions dict

See VideoCompletedResultExtensions.

completion bool

Consists of the value True.

duration str

Consists of the total time spent consuming the video under current registration.

Source code in ralph/models/xapi/video/results.py
class VideoCompletedResult(BaseXapiResult):
    """Pydantic model for video completed `result` property.

    Attributes:
        extensions (dict): See VideoCompletedResultExtensions.
        completion (bool): Consists of the value `True`.
        duration (str): Consists of the total time spent consuming the video under
            current registration.
    """

    extensions: VideoCompletedResultExtensions
    completion: Optional[Literal[True]]
    duration: Optional[timedelta]

VideoCompletedResultExtensions (VideoResultExtensions) pydantic-model

Pydantic model for video completed result.extensions property.

Attributes:

Name Type Description
progress float

Consists of the percentage of media consumed by the actor.

Source code in ralph/models/xapi/video/results.py
class VideoCompletedResultExtensions(VideoResultExtensions):
    """Pydantic model for video completed `result`.`extensions` property.

    Attributes:
        progress (float): Consists of the percentage of media consumed by the actor.
    """

    progress: NonNegativeFloat = Field(alias=RESULT_EXTENSION_PROGRESS)

VideoEnableClosedCaptioningResult (BaseXapiResult) pydantic-model

Pydantic model for video enable closed captioning result property.

Attributes:

Name Type Description
extensions dict

See VideoEnableClosedCaptioningResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoEnableClosedCaptioningResult(BaseXapiResult):
    """Pydantic model for video enable closed captioning `result` property.

    Attributes:
        extensions (dict): See VideoEnableClosedCaptioningResultExtensions.
    """

    extensions: VideoEnableClosedCaptioningResultExtensions

VideoEnableClosedCaptioningResultExtensions (VideoResultExtensions) pydantic-model

Pydantic model for video enable closed captioning result.extensions property.

Attributes:

Name Type Description
ccEnabled bool

Indicates whether subtitles are enabled.

Source code in ralph/models/xapi/video/results.py
class VideoEnableClosedCaptioningResultExtensions(VideoResultExtensions):
    """Pydantic model for video enable closed captioning `result`.`extensions` property.

    Attributes:
        ccEnabled (bool): Indicates whether subtitles are enabled.
    """

    ccEnabled: bool = Field(alias=CONTEXT_EXTENSION_CC_ENABLED)

VideoPausedResult (BaseXapiResult) pydantic-model

Pydantic model for video paused result property.

Attributes:

Name Type Description
extensions dict

See VideoPausedResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoPausedResult(BaseXapiResult):
    """Pydantic model for video paused `result` property.

    Attributes:
        extensions (dict): See VideoPausedResultExtensions.
    """

    extensions: VideoPausedResultExtensions

VideoPausedResultExtensions (VideoResultExtensions) pydantic-model

Pydantic model for video paused result.extensions property.

Attributes:

Name Type Description
progress float

Consists of the ratio of media consumed by the actor.

Source code in ralph/models/xapi/video/results.py
class VideoPausedResultExtensions(VideoResultExtensions):
    """Pydantic model for video paused `result`.`extensions` property.

    Attributes:
        progress (float): Consists of the ratio of media consumed by the actor.
    """

    progress: Optional[NonNegativeFloat] = Field(alias=RESULT_EXTENSION_PROGRESS)

VideoPlayedResult (BaseXapiResult) pydantic-model

Pydantic model for video played result property.

Attributes:

Name Type Description
extensions dict

See VideoResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoPlayedResult(BaseXapiResult):
    """Pydantic model for video played `result` property.

    Attributes:
        extensions (dict): See VideoResultExtensions.
    """

    extensions: VideoResultExtensions

VideoResultExtensions (BaseExtensionModelWithConfig) pydantic-model

Pydantic model for video result.extensions property.

Attributes:

Name Type Description
playedSegments str

Consists of parts of the video the actor watched during current registration in chronological order (for example, “0[.]5[,]12[.]22[,]15[.]55[,]55[.]99.33[,]99.33”).

time float

Consists of the video time code when the event was emitted.

Source code in ralph/models/xapi/video/results.py
class VideoResultExtensions(BaseExtensionModelWithConfig):
    """Pydantic model for video `result`.`extensions` property.

    Attributes:
        playedSegments (str): Consists of parts of the video the actor watched during
            current registration in chronological order (for example,
            "0[.]5[,]12[.]22[,]15[.]55[,]55[.]99.33[,]99.33").
        time (float): Consists of the video time code when the event was emitted.
    """

    time: NonNegativeFloat = Field(alias=RESULT_EXTENSION_TIME)
    playedSegments: Optional[str] = Field(alias=CONTEXT_EXTENSION_PLAYED_SEGMENTS)

VideoScreenChangeInteractionResult (BaseXapiResult) pydantic-model

Pydantic model for video screen change interaction result property.

Attributes:

Name Type Description
extensions dict

See VideoResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoScreenChangeInteractionResult(BaseXapiResult):
    """Pydantic model for video screen change interaction `result` property.

    Attributes:
        extensions (dict): See VideoResultExtensions.
    """

    extensions: VideoResultExtensions

VideoSeekedResult (BaseXapiResult) pydantic-model

Pydantic model for video seeked result property.

Attributes:

Name Type Description
extensions dict

See VideoSeekedResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoSeekedResult(BaseXapiResult):
    """Pydantic model for video seeked `result` property.

    Attributes:
        extensions (dict): See VideoSeekedResultExtensions.
    """

    extensions: VideoSeekedResultExtensions

VideoSeekedResultExtensions (BaseExtensionModelWithConfig) pydantic-model

Pydantic model for video seeked result.extensions property.

Attributes:

Name Type Description
timeFrom float

Consists of the point in time the actor changed from in a media object during a seek operation.

timeTo float

Consists of the point in time the actor changed to in a media object during a seek operation.

Source code in ralph/models/xapi/video/results.py
class VideoSeekedResultExtensions(BaseExtensionModelWithConfig):
    """Pydantic model for video seeked `result`.`extensions` property.

    Attributes:
        timeFrom (float): Consists of the point in time the actor changed from in a
            media object during a seek operation.
        timeTo (float): Consists of the point in time the actor changed to in a media
            object during a seek operation.
    """

    timeFrom: NonNegativeFloat = Field(alias=RESULT_EXTENSION_TIME_FROM)
    timeTo: NonNegativeFloat = Field(alias=RESULT_EXTENSION_TIME_TO)

VideoTerminatedResult (BaseXapiResult) pydantic-model

Pydantic model for video terminated result property.

Attributes:

Name Type Description
extensions dict

See VideoTerminatedResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoTerminatedResult(BaseXapiResult):
    """Pydantic model for video terminated `result` property.

    Attributes:
        extensions (dict): See VideoTerminatedResultExtensions.
    """

    extensions: VideoTerminatedResultExtensions

VideoTerminatedResultExtensions (VideoResultExtensions) pydantic-model

Pydantic model for video terminated result.extensions property.

Attributes:

Name Type Description
progress float

Consists of the percentage of media consumed by the actor.

Source code in ralph/models/xapi/video/results.py
class VideoTerminatedResultExtensions(VideoResultExtensions):
    """Pydantic model for video terminated `result`.`extensions` property.

    Attributes:
        progress (float): Consists of the percentage of media consumed by the actor.
    """

    progress: NonNegativeFloat = Field(alias=RESULT_EXTENSION_PROGRESS)

VideoVolumeChangeInteractionResult (BaseXapiResult) pydantic-model

Pydantic model for video volume change interaction result property.

Attributes:

Name Type Description
extensions dict

See VideoResultExtensions.

Source code in ralph/models/xapi/video/results.py
class VideoVolumeChangeInteractionResult(BaseXapiResult):
    """Pydantic model for video volume change interaction `result` property.

    Attributes:
        extensions (dict): See VideoResultExtensions.
    """

    extensions: VideoResultExtensions

statements

Video xAPI event definitions.

BaseVideoStatement (BaseXapiStatement) pydantic-model

Pydantic model for video core statements.

Attributes:

Name Type Description
object dict

See VideoActivity.

Source code in ralph/models/xapi/video/statements.py
class BaseVideoStatement(BaseXapiStatement):
    """Pydantic model for video core statements.

    Attributes:
        object (dict): See VideoActivity.
    """

    object: VideoActivity

VideoCompleted (BaseVideoStatement) pydantic-model

Pydantic model for video completed statement.

Example: John completed a video by watching major parts of the video at least once.

Attributes:

Name Type Description
verb dict

See CompletedVerb.

result dict

See VideoCompletedResult.

context dict

See VideoCompletedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoCompleted(BaseVideoStatement):
    """Pydantic model for video completed statement.

    Example: John completed a video by watching major parts of the video at least once.

    Attributes:
        verb (dict): See CompletedVerb.
        result (dict): See VideoCompletedResult.
        context (dict): See VideoCompletedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/completed",
    )

    verb: CompletedVerb = CompletedVerb()
    result: VideoCompletedResult
    context: VideoCompletedContext

VideoEnableClosedCaptioning (BaseVideoStatement) pydantic-model

Pydantic model for video enable closed captioning statement.

Example: John interacted with the player to enable closed captioning.

Attributes:

Name Type Description
verb dict

See InteractedVerb.

result dict

See VideoEnableClosedCaptioningResult.

context dict

See VideoEnableClosedCaptioningContext.

Source code in ralph/models/xapi/video/statements.py
class VideoEnableClosedCaptioning(BaseVideoStatement):
    """Pydantic model for video enable closed captioning statement.

    Example: John interacted with the player to enable closed captioning.

    Attributes:
        verb (dict): See InteractedVerb.
        result (dict): See VideoEnableClosedCaptioningResult.
        context (dict): See VideoEnableClosedCaptioningContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/interacted",
    )

    verb: InteractedVerb = InteractedVerb()
    result: VideoEnableClosedCaptioningResult
    context: VideoEnableClosedCaptioningContext

VideoInitialized (BaseVideoStatement) pydantic-model

Pydantic model for video initialized statement.

Example: A video has been fully initialized.

Attributes:

Name Type Description
verb dict

See InitializedVerb.

context dict

See VideoInitializedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoInitialized(BaseVideoStatement):
    """Pydantic model for video initialized statement.

    Example: A video has been fully initialized.

    Attributes:
        verb (dict): See InitializedVerb.
        context (dict): See VideoInitializedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/initialized",
    )

    verb: InitializedVerb = InitializedVerb()
    context: VideoInitializedContext

VideoPaused (BaseVideoStatement) pydantic-model

Pydantic model for video paused statement.

Example: John paused the video or clicked the pause button.

Attributes:

Name Type Description
verb dict

See PausedVerb.

result dict

See VideoPausedResult.

context dict

See VideoPausedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoPaused(BaseVideoStatement):
    """Pydantic model for video paused statement.

    Example: John paused the video or clicked the pause button.

    Attributes:
        verb (dict): See PausedVerb.
        result (dict): See VideoPausedResult.
        context (dict): See VideoPausedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="https://w3id.org/xapi/video/verbs/paused",
    )

    verb: PausedVerb = PausedVerb()
    result: VideoPausedResult
    context: VideoPausedContext

VideoPlayed (BaseVideoStatement) pydantic-model

Pydantic model for video played statement.

Example: John played the video or clicked the play button.

Attributes:

Name Type Description
verb dict

See PlayedVerb.

result dict

See VideoPlayedResult.

context dict

See VideoPlayedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoPlayed(BaseVideoStatement):
    """Pydantic model for video played statement.

    Example: John played the video or clicked the play button.

    Attributes:
        verb (dict): See PlayedVerb.
        result (dict): See VideoPlayedResult.
        context (dict): See VideoPlayedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="https://w3id.org/xapi/video/verbs/played",
    )

    verb: PlayedVerb = PlayedVerb()
    result: VideoPlayedResult
    context: Optional[VideoPlayedContext]

VideoScreenChangeInteraction (BaseVideoStatement) pydantic-model

Pydantic model for video screen change interaction statement.

Example: John interacted with the player to activate or deactivate full screen.

Attributes:

Name Type Description
verb dict

See InteractedVerb.

result dict

See VideoScreenChangeInteractionResult.

context dict

See VideoScreenChangeInteractionContext.

Source code in ralph/models/xapi/video/statements.py
class VideoScreenChangeInteraction(BaseVideoStatement):
    """Pydantic model for video screen change interaction statement.

    Example: John interacted with the player to activate or deactivate full screen.

    Attributes:
        verb (dict): See InteractedVerb.
        result (dict): See VideoScreenChangeInteractionResult.
        context (dict): See VideoScreenChangeInteractionContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/interacted",
    )

    verb: InteractedVerb = InteractedVerb()
    result: VideoScreenChangeInteractionResult
    context: VideoScreenChangeInteractionContext

VideoSeeked (BaseVideoStatement) pydantic-model

Pydantic model for video seeked statement.

!!! example “John moved the progress bar forward or backward to a specific time in the” video.

Attributes:

Name Type Description
verb dict

See SeekedVerb.

result dict

See VideoSeekedResult.

context dict

See VideoSeekedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoSeeked(BaseVideoStatement):
    """Pydantic model for video seeked statement.

    Example: John moved the progress bar forward or backward to a specific time in the
        video.

    Attributes:
        verb (dict): See SeekedVerb.
        result (dict): See VideoSeekedResult.
        context (dict): See VideoSeekedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="https://w3id.org/xapi/video/verbs/seeked",
    )

    verb: SeekedVerb = SeekedVerb()
    result: VideoSeekedResult
    context: Optional[VideoSeekedContext]

VideoTerminated (BaseVideoStatement) pydantic-model

Pydantic model for video terminated statement.

Example: John ended a video (quit the player).

Attributes:

Name Type Description
verb dict

See TerminatedVerb.

result dict

See VideoTerminatedResult.

context dict

See VideoTerminatedContext.

Source code in ralph/models/xapi/video/statements.py
class VideoTerminated(BaseVideoStatement):
    """Pydantic model for video terminated statement.

    Example: John ended a video (quit the player).

    Attributes:
        verb (dict): See TerminatedVerb.
        result (dict): See VideoTerminatedResult.
        context (dict): See VideoTerminatedContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/terminated",
    )

    verb: TerminatedVerb = TerminatedVerb()
    result: VideoTerminatedResult
    context: VideoTerminatedContext

VideoVolumeChangeInteraction (BaseVideoStatement) pydantic-model

Pydantic model for video volume change interaction statement.

Example: John interacted with the player to change the volume.

Attributes : verb (dict): See InteractedVerb. result (dict): See VideoVolumeChangeInteractionResult. context (dict): See VideoVolumeChangeInteractionContext.

Source code in ralph/models/xapi/video/statements.py
class VideoVolumeChangeInteraction(BaseVideoStatement):
    """Pydantic model for video volume change interaction statement.

    Example: John interacted with the player to change the volume.

    Attributes :
        verb (dict): See InteractedVerb.
        result (dict): See VideoVolumeChangeInteractionResult.
        context (dict): See VideoVolumeChangeInteractionContext.
    """

    __selector__ = selector(
        object__definition__type="https://w3id.org/xapi/video/activity-type/video",
        verb__id="http://adlnet.gov/expapi/verbs/interacted",
    )

    verb: InteractedVerb = InteractedVerb()
    result: VideoVolumeChangeInteractionResult
    context: VideoVolumeChangeInteractionContext

virtual_classroom special

contexts

Virtual classroom xAPI events context fields definitions.

VirtualClassroomAnsweredPollContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom answered poll context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomContextExtensions.

contextActivities dict

see VirtualClassroomAnsweredPollContextActivities.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomAnsweredPollContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom answered poll `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomContextExtensions.
        contextActivities (dict): see VirtualClassroomAnsweredPollContextActivities.
    """

    extensions: VirtualClassroomContextExtensions
    contextActivities: VirtualClassroomAnsweredPollContextActivities

VirtualClassroomAnsweredPollContextActivities (VirtualClassroomContextContextActivities) pydantic-model

Pydantic model for virtual classroom answered poll context.contextActivities property.

Attributes:

Name Type Description
parent list

see VirtualClassroomActivity.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomAnsweredPollContextActivities(
    VirtualClassroomContextContextActivities
):
    # noqa: D205, D415
    """Pydantic model for virtual classroom answered poll `context`.`contextActivities`
    property.

    Attributes:
        parent (list): see VirtualClassroomActivity.
    """

    parent: Union[VirtualClassroomActivity, List[VirtualClassroomActivity]]

VirtualClassroomContext (BaseXapiContext) pydantic-model

Pydantic model for virtual classroom base context property.

Attributes:

Name Type Description
registration uuid

the registration that the Statement is associated with.

extensions dict

see VirtualClassroomExtensions.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomContext(BaseXapiContext):
    """Pydantic model for virtual classroom base `context` property.

    Attributes:
        registration (uuid): the registration that the Statement is associated with.
        extensions (dict): see VirtualClassroomExtensions.
    """

    contextActivities: VirtualClassroomContextContextActivities
    registration: UUID
    extensions: VirtualClassroomContextExtensions

VirtualClassroomContextActivitiesCategory (BaseXapiActivity) pydantic-model

Pydantic model for virtual classroom context.contextActivities.category property.

Attributes:

Name Type Description
id str

Consists of the value https://w3id.org/xapi/virtual-classroom.

definition dict

see ProfileActivity.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomContextActivitiesCategory(BaseXapiActivity):
    # noqa: D205, D415
    """Pydantic model for virtual classroom `context`.`contextActivities`.`category`
    property.

    Attributes:
        id (str): Consists of the value `https://w3id.org/xapi/virtual-classroom`.
        definition (dict): see ProfileActivity.
    """

    id: Literal[
        "https://w3id.org/xapi/virtual-classroom"
    ] = "https://w3id.org/xapi/virtual-classroom"
    definition: ProfileActivity

VirtualClassroomContextContextActivities (BaseXapiContextContextActivities) pydantic-model

Pydantic model for virtual classroom context.contextActivities property.

Attributes:

Name Type Description
category list

see VirtualClassroomContextActivitiesCategory.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomContextContextActivities(BaseXapiContextContextActivities):
    """Pydantic model for virtual classroom `context`.`contextActivities` property.

    Attributes:
        category (list): see VirtualClassroomContextActivitiesCategory.
    """

    category: Union[
        VirtualClassroomContextActivitiesCategory,
        List[VirtualClassroomContextActivitiesCategory],
    ]

VirtualClassroomContextExtensions (BaseExtensionModelWithConfig) pydantic-model

Pydantic model for virtual classroom base context.extensions property.

Attributes:

Name Type Description
session_id str

Consists of the ID of the active session.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomContextExtensions(BaseExtensionModelWithConfig):
    """Pydantic model for virtual classroom base `context`.`extensions` property.

    Attributes:
        session_id (str): Consists of the ID of the active session.
    """

    session_id: str = Field(alias=CONTEXT_EXTENSION_SESSION_ID, default="")

VirtualClassroomInitializedContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom initialized context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomInitializedContextExtensions.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomInitializedContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom initialized `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomInitializedContextExtensions.
    """

    extensions: VirtualClassroomInitializedContextExtensions

VirtualClassroomInitializedContextExtensions (VirtualClassroomContextExtensions) pydantic-model

Pydantic model for virtual classroom initialized context.extensions property.

Attributes:

Name Type Description
planned_duration datetime

Consists of the estimated duration of the scheduled virtual classroom.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomInitializedContextExtensions(VirtualClassroomContextExtensions):
    """Pydantic model for virtual classroom initialized `context`.`extensions` property.

    Attributes:
        planned_duration (datetime): Consists of the estimated duration of the scheduled
            virtual classroom.
    """

    planned_duration: Optional[datetime] = Field(
        alias=CONTEXT_EXTENSION_PLANNED_DURATION
    )

VirtualClassroomJoinedContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom joined context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomJoinedContextExtensions.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomJoinedContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom joined `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomJoinedContextExtensions.
    """

    extensions: VirtualClassroomJoinedContextExtensions

VirtualClassroomJoinedContextExtensions (VirtualClassroomContextExtensions) pydantic-model

Pydantic model for virtual classroom initialized context.extensions property.

Attributes:

Name Type Description
planned_duration datetime

Consists of the estimated duration of the scheduled virtual classroom.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomJoinedContextExtensions(VirtualClassroomContextExtensions):
    """Pydantic model for virtual classroom initialized `context`.`extensions` property.

    Attributes:
        planned_duration (datetime): Consists of the estimated duration of the scheduled
            virtual classroom.
    """

    planned_duration: Optional[datetime] = Field(
        alias=CONTEXT_EXTENSION_PLANNED_DURATION
    )

VirtualClassroomPostedPublicMessageContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom posted public message context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomContextExtensions.

contextActivities list

see VirtualClassroomPostedPublicMessageContextActivities.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomPostedPublicMessageContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom posted public message `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomContextExtensions.
        contextActivities (list): see
            VirtualClassroomPostedPublicMessageContextActivities.
    """

    extensions: VirtualClassroomContextExtensions
    contextActivities: VirtualClassroomPostedPublicMessageContextActivities

VirtualClassroomPostedPublicMessageContextActivities (VirtualClassroomContextContextActivities) pydantic-model

Pydantic model for virtual classroom posted public message context.contextActivities property.

Attributes:

Name Type Description
parent list

see VirtualClassroomActivity.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomPostedPublicMessageContextActivities(
    VirtualClassroomContextContextActivities
):
    # noqa: D205, D415
    """Pydantic model for virtual classroom posted public message
    `context`.`contextActivities` property.

    Attributes:
        parent (list): see VirtualClassroomActivity.
    """

    parent: Union[VirtualClassroomActivity, List[VirtualClassroomActivity]]

VirtualClassroomStartedPollContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom started poll context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomContextExtensions.

contextActivities dict

see VirtualClassroomStartedPollContextActivities.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomStartedPollContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom started poll `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomContextExtensions.
        contextActivities (dict): see
            VirtualClassroomStartedPollContextActivities.
    """

    extensions: VirtualClassroomContextExtensions
    contextActivities: VirtualClassroomStartedPollContextActivities

VirtualClassroomStartedPollContextActivities (VirtualClassroomContextContextActivities) pydantic-model

Pydantic model for virtual classroom started poll context.contextActivities property.

Attributes:

Name Type Description
parent list

see VirtualClassroomActivity.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomStartedPollContextActivities(
    VirtualClassroomContextContextActivities
):
    # noqa: D205, D415
    """Pydantic model for virtual classroom started poll `context`.`contextActivities`
    property.

    Attributes:
        parent (list): see VirtualClassroomActivity.
    """

    parent: Union[VirtualClassroomActivity, List[VirtualClassroomActivity]]

VirtualClassroomTerminatedContext (VirtualClassroomContext) pydantic-model

Pydantic model for virtual classroom terminated context property.

Attributes:

Name Type Description
extensions dict

see VirtualClassroomInitializedContextExtensions.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomTerminatedContext(VirtualClassroomContext):
    """Pydantic model for virtual classroom terminated `context` property.

    Attributes:
        extensions (dict): see VirtualClassroomInitializedContextExtensions.
    """

    extensions: VirtualClassroomTerminatedContextExtensions

VirtualClassroomTerminatedContextExtensions (VirtualClassroomContextExtensions) pydantic-model

Pydantic model for virtual classroom terminated context.extensions property.

Attributes:

Name Type Description
planned_duration datetime

Consists of the estimated duration of the scheduled virtual classroom.

Source code in ralph/models/xapi/virtual_classroom/contexts.py
class VirtualClassroomTerminatedContextExtensions(VirtualClassroomContextExtensions):
    """Pydantic model for virtual classroom terminated `context`.`extensions` property.

    Attributes:
        planned_duration (datetime): Consists of the estimated duration of the scheduled
            virtual classroom.
    """

    planned_duration: Optional[datetime] = Field(
        alias=CONTEXT_EXTENSION_PLANNED_DURATION
    )

results

Virtual classroom xAPI events result fields definitions.

VirtualClassroomAnsweredPollResult (BaseXapiResult) pydantic-model

Pydantic model for virtual classroom answered poll result property.

Attributes:

Name Type Description
response str

Consists of the response for the given Activity.

Source code in ralph/models/xapi/virtual_classroom/results.py
class VirtualClassroomAnsweredPollResult(BaseXapiResult):
    """Pydantic model for virtual classroom answered poll `result` property.

    Attributes:
        response (str): Consists of the response for the given Activity.
    """

    response: StrictStr  # = StrictStr()

statements

Virtual classroom xAPI event definitions.

BaseVirtualClassroomStatement (BaseXapiStatement) pydantic-model

Pydantic model for Virtual Classroom core statements.

Attributes:

Name Type Description
timestamp datetime

Consists of the timestamp of when the event occurred.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class BaseVirtualClassroomStatement(BaseXapiStatement):
    """Pydantic model for Virtual Classroom core statements.

    Attributes:
        timestamp (datetime): Consists of the timestamp of when the event occurred.
    """

    timestamp: datetime

VirtualClassroomAnsweredPoll (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom answered poll statement.

Example: John answered to a poll question.

Attributes:

Name Type Description
verb dict

See AskedVerb.

object dict

See CMIInteractionActivity.

context dict

See VirtualClassroomAnsweredPollContext.

result dict

See AnsweredPollResult.

result dict

See AnsweredPollResult.

timestamp datetime

Consists of the timestamp of when the event occurred.

result dict

See AnsweredPollResult.

timestamp datetime

Consists of the timestamp of when the event occurred.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomAnsweredPoll(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom answered poll statement.

    Example: John answered to a poll question.

    Attributes:
        verb (dict): See AskedVerb.
        object (dict): See CMIInteractionActivity.
        context (dict): See VirtualClassroomAnsweredPollContext.
        result (dict): See AnsweredPollResult.
        result (dict): See AnsweredPollResult.
        timestamp (datetime): Consists of the timestamp of when the event occurred.
        result (dict): See AnsweredPollResult.
        timestamp (datetime): Consists of the timestamp of when the event occurred.
    """

    __selector__ = selector(
        verb__id="http://adlnet.gov/expapi/verbs/answered",
        object__definition__type=(
            "http://adlnet.gov/expapi/activities/cmi.interaction"
        ),
    )

    verb: AnsweredVerb = AnsweredVerb()
    object: CMIInteractionActivity
    context: VirtualClassroomAnsweredPollContext
    result: VirtualClassroomAnsweredPollResult

VirtualClassroomInitialized (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom initialized statement.

Example: John has entered the virtual classroom as the first user.

Attributes:

Name Type Description
verb dict

See InitializedVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomInitializedContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomInitialized(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom initialized statement.

    Example: John has entered the virtual classroom as the first user.

    Attributes:
        verb (dict): See InitializedVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomInitializedContext.
    """

    __selector__ = selector(
        verb__id="http://adlnet.gov/expapi/verbs/initialized",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: InitializedVerb = InitializedVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomInitializedContext

VirtualClassroomJoined (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom joined statement.

Example: Jane has entered the virtual classroom.

Attributes:

Name Type Description
verb dict

See JoinVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomJoinedContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomJoined(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom joined statement.

    Example: Jane has entered the virtual classroom.

    Attributes:
        verb (dict): See JoinVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomJoinedContext.
    """

    __selector__ = selector(
        verb__id="http://activitystrea.ms/join",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: JoinVerb = JoinVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomJoinedContext

VirtualClassroomLeft (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom joined statement.

Example: Jane has left the virtual classroom.

Attributes:

Name Type Description
verb dict

See LeaveVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomLeft(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom joined statement.

    Example: Jane has left the virtual classroom.

    Attributes:
        verb (dict): See LeaveVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomContext.

    """

    __selector__ = selector(
        verb__id="http://activitystrea.ms/leave",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: LeaveVerb = LeaveVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomLoweredHand (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom lowered hand statement.

Example: Jane has lowered the hand.

Attributes:

Name Type Description
verb dict

See LoweredHandVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomLoweredHandContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomLoweredHand(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom lowered hand statement.

    Example: Jane has lowered the hand.

    Attributes:
        verb (dict): See LoweredHandVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomLoweredHandContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/lowered-hand",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: LoweredHandVerb = LoweredHandVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomMuted (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom muted statement.

Example: Jane has muted herself or has been muted.

Attributes:

Name Type Description
verb dict

See MutedVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomMutedContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomMuted(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom muted statement.

    Example: Jane has muted herself or has been muted.

    Attributes:
        verb (dict): See MutedVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomMutedContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/muted",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: MutedVerb = MutedVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomPostedPublicMessage (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom posted public message statement.

Example: John sent a message in the public chat.

Attributes:

Name Type Description
verb dict

See PostedVerb.

object dict

See MessageActivity.

context dict

See VirtualClassroomPostedPublicMessageContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomPostedPublicMessage(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom posted public message statement.

    Example: John sent a message in the public chat.

    Attributes:
        verb (dict): See PostedVerb.
        object (dict): See MessageActivity.
        context (dict): See VirtualClassroomPostedPublicMessageContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/acrossx/verbs/posted",
        object__definition__type="https://w3id.org/xapi/acrossx/activities/message",
    )

    verb: PostedVerb = PostedVerb()
    object: MessageActivity
    context: VirtualClassroomPostedPublicMessageContext

VirtualClassroomRaisedHand (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom raised hand statement.

Example: Jane has raised the hand.

Attributes:

Name Type Description
verb dict

See RaisedHandVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomRaisedHandContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomRaisedHand(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom raised hand statement.

    Example: Jane has raised the hand.

    Attributes:
        verb (dict): See RaisedHandVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomRaisedHandContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/raised-hand",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: RaisedHandVerb = RaisedHandVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomSharedScreen (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom shared screen statement.

Example: Jane has shared her screen.

Attributes:

Name Type Description
verb dict

See SharedScreenVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomSharedScreenContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomSharedScreen(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom shared screen statement.

    Example: Jane has shared her screen.

    Attributes:
        verb (dict): See SharedScreenVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomSharedScreenContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/shared-screen",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: SharedScreenVerb = SharedScreenVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomStartedCamera (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom started camera statement.

Example: Jane has started her camera.

Attributes:

Name Type Description
verb dict

See StartedCameraVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomStartedCamera(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom started camera statement.

    Example: Jane has started her camera.

    Attributes:
        verb (dict): See StartedCameraVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/started-camera",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: StartedCameraVerb = StartedCameraVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomStartedPoll (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom started poll statement.

Example: A poll has been started in the virtual classroom in order to collect participants opinions about a given question.

Attributes:

Name Type Description
verb dict

See AskedVerb.

object dict

See CMIInteractionActivity.

context dict

See VirtualClassroomLoweredHandContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomStartedPoll(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom started poll statement.

    Example: A poll has been started in the virtual classroom in order
    to collect participants opinions about a given question.

    Attributes:
        verb (dict): See AskedVerb.
        object (dict): See CMIInteractionActivity.
        context (dict): See VirtualClassroomLoweredHandContext.

    """

    __selector__ = selector(
        verb__id="http://adlnet.gov/expapi/verbs/asked",
        object__definition__type=(
            "http://adlnet.gov/expapi/activities/cmi.interaction"
        ),
    )

    verb: AskedVerb = AskedVerb()
    object: CMIInteractionActivity
    context: VirtualClassroomStartedPollContext

VirtualClassroomStoppedCamera (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom stopped camera statement.

Example: Jane has stopped her camera.

Attributes:

Name Type Description
verb dict

See StoppedCameraVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomStoppedCameraContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomStoppedCamera(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom stopped camera statement.

    Example: Jane has stopped her camera.

    Attributes:
        verb (dict): See StoppedCameraVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomStoppedCameraContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/stopped-camera",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: StoppedCameraVerb = StoppedCameraVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomTerminated (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom terminated statement.

Example: Jane has terminated the virtual classroom.

Attributes:

Name Type Description
verb dict

See TerminatedVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomTerminatedContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomTerminated(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom terminated statement.

    Example: Jane has terminated the virtual classroom.

    Attributes:
        verb (dict): See TerminatedVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomTerminatedContext.

    """

    __selector__ = selector(
        verb__id="http://adlnet.gov/expapi/verbs/terminated",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: TerminatedVerb = TerminatedVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomTerminatedContext

VirtualClassroomUnmuted (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom unmuted statement.

Example: Jane has unmuted herself or has been unmuted.

Attributes:

Name Type Description
verb dict

See UnmutedVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomUnmuted(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom unmuted statement.

    Example: Jane has unmuted herself or has been unmuted.

    Attributes:
        verb (dict): See UnmutedVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/unmuted",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: UnmutedVerb = UnmutedVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext

VirtualClassroomUnsharedScreen (BaseVirtualClassroomStatement) pydantic-model

Pydantic model for virtual classroom unshared screen statement.

Example: Jane has unshared her screen or her screen has been unshared by the moderator.

Attributes:

Name Type Description
verb dict

See UnsharedScreenVerb.

object dict

See VirtualClassroomActivity.

context dict

See VirtualClassroomUnsharedScreenContext.

Source code in ralph/models/xapi/virtual_classroom/statements.py
class VirtualClassroomUnsharedScreen(BaseVirtualClassroomStatement):
    """Pydantic model for virtual classroom unshared screen statement.

    Example: Jane has unshared her screen or her screen has been unshared by the
    moderator.

    Attributes:
        verb (dict): See UnsharedScreenVerb.
        object (dict): See VirtualClassroomActivity.
        context (dict): See VirtualClassroomUnsharedScreenContext.

    """

    __selector__ = selector(
        verb__id="https://w3id.org/xapi/virtual-classroom/verbs/unshared-screen",
        object__definition__type=(
            "https://w3id.org/xapi/virtual-classroom/activity-types/virtual-classroom"
        ),
    )

    verb: UnsharedScreenVerb = UnsharedScreenVerb()
    object: VirtualClassroomActivity
    context: VirtualClassroomContext