Skip to content

SCORM Cloud, Rustici Engine actor #14

@danielghost

Description

@danielghost

The Rustici engine used in SCORM Cloud uses an invalid actor structure. Incorrect attribute names are used, plus the values of these are stored in an Array which doesn't match the xAPI spec.

Whilst we have been aware of this issue for a long time, I am noting it here for others. It was previously decided not to amend the plugin to convert this as required, as the engine should match the spec rather than the plugin providing a workaround. If required, the following code can be added before:

const launchData = {
registration: lrs.registration || null,
actor: JSON.parse(lrs.actor)
};

var actor = JSON.parse(lrs.actor);

// convert actor for Rustici Engine
if (Array.isArray(actor.name)) actor.name = actor.name[0];
//if (Array.isArray(actor.mbox)) actor.mbox = actor.mbox[0];

if (Array.isArray(actor.account)) {
    var accountArr = actor.account[0];

    var account = {
        homePage: accountArr.accountServiceHomePage || accountArr.homePage,
        name: accountArr.accountName || accountArr.name
    };

    actor.account = account;
}

The following actor value needs to be adjusted accordingly to pass in the new actor variable instead:

'actor': JSON.parse(lrs.actor),/*,

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions