Skip to content

Optional line item props cannot be omitted during deep linking return #169

@snake

Description

@snake

The Deep Linking spec indicates that, when returning a resource link with an attached line item, the following line item properties are optional:

  • label
  • tag
  • resourceId
  • gradesReleased (not present in library yet, so can be ignored here)

See: https://www.imsglobal.org/spec/lti-dl/v2p0#lti-resource-link

Currently, the library doesn't support this, and this is causing errors to be reported on the new build.1edtech certification site, when certifying a tool for Deep Linking.

If not set, the library is sending null values, instead of omitting the properties.

Here is an example of a valid line item being constructed (as we do it using the library) and attached to a content item which is then returned:

$lineitem = LtiLineitem::new()
    ->setScoreMaximum($resource->get_grademax())
    ->setResourceId($resource->get_uuid());
$contentitem->setLineitem($lineitem);
...
$contentitems[] = $contentitem;
...
// Later, returned via form post, as usual.
$messagelaunch->getDeepLink()->getResponseJwt($contentitems)

Using this code to return the content items, results in a build.1edtech suite error (the important snippet below):

"errors": [
    "'label' should be a string",
    "'tag' should be a string"
],

and it reports the payload as (again, the important snippet):

"lineItem": {
    "scoreMaximum": 100,
    "label": null,
    "resourceId": "60afb901-262a-4036-aba0-4b102265e85a",
    "tag": null
},

These fields should be omitted if they aren't set. When omitted, the cert. suite will not error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions