H5P NodeJS Library
    Preparing search index...

    Saves user data in JSON files on the disk. It creates one file per content object. There's a separate file for user states and one for the finished data. Each file contains a list of all states or finished data objects.

    Implements

    Index

    Constructors

    Properties

    directory: string

    Methods

    • Loads the contentUserData for given contentId, dataType and subContentId

      Parameters

      • contentId: string

        The id of the content to load user data from

      • dataType: string

        Used by the h5p.js client

      • subContentId: string

        The id provided by the h5p.js client call

      • userId: string

        The user who owns this object

      • OptionalcontextId: string

        an arbitrary value that can be used to save multiple states for one content - user tuple

      Returns Promise<IContentUserData>

      the data

    • Lists all associated contentUserData for a given contentId and user.

      Parameters

      • contentId: string

        The id of the content to load user data from

      • userId: string

        The id of the user to load user data from

      • OptionalcontextId: string

        an arbitrary value that can be used to save multiple states for one content - user tuple

      Returns Promise<IContentUserData[]>

      An array of objects containing the dataType, subContentId and the contentUserState as string in the data field.