arrayswrapperlti

How to map array type groups parameter to LTI1p0


I have an LTI Tool Consumer(LMS) that is using LTI1p0 which will send a request to a service that is currently not using LTI. Therefore I'm writing a NodeJS implementation of a wrapper which will

  1. receive from the LTI Tool Consumer,
  2. map it to match service's API,
  3. send it to the service,
  4. then parse the response from the service into an LTI Tool Provider format,
  5. and finally send it back to the Tool Consumer.

The service has a required field called groups which expects an array of group objects like so:

group: [ {
    id: <string>, // id of the group
    name: <string>, // name of the group
    role: <string> // role of the user
}]

This parameter doesn't exactly exist in the LTI1p0 implementation guide. So I want to know how to best send array-type (groups in my case) information via LTI.

When looking through the docs, I've come across a few potential parameters I could use:

1. Context parameters

The guide mentions that a 'type of context would be "group"', and there are parameters for context_id, context_type, context_title. The issue would be that this is only an option for one group per request/user.

2. Custom parameters

I could make a custom parameter and call it custom_groups which seems simple, but I'm not sure how the value should look for arrays? Just like a stringified json object?

custom_groups = "{"id":123,"name":"Group Name","role":"Instructor"}, {"id":124,"name":"Group Name 2","role":"Creator"}"

For the roles parameter, one can send a list of comma-separated strings (i.e. roles= Instructor, Creator,..)but that wouldn't suffice in my case.

I'm still new to LTI, so my apologies if this is blatantly obvious.

Note: Both LTI Consumer (LMS) and the service are external, i.e. I can't change them and only provide the wrapper. I can communicate with the Tool Consumer about possible custom parameters but again not sure which format to request. Additionally, the service might implement LTI towards the end of the year, so ideally the wrapper could then be removed and the Tool Consumer wouldn't have to change much.

Any help much appreciated!


Solution

  • Groups are notably absent from the LTI spec. So any answer will be part opinion.

    I would agree with you that using the context parameter fields, with one LTI launch per group. Would be the most correct way, as far as the spec goes.

    However I have not seen an LMS that allows LTI launches from group context. So you may not be able to use the service without a wrapper, even if it supported LTI natively.

    Alternatively:

    LTI 1.0 Supports custom parameters, as you are extending the the information already sent (context and roles) You could use the ext_ prefix. Referer: https://www.imsglobal.org/specs/ltiv1p0/implementation-guide

    If a profile wants to extend these fields, they should prefix all fields not described herein with "ext_".

    So you could send a custom parameter with that prefix. Assuming your LMS lets you send a useful custom paramater. LTI is designed to use basic POST request, Not multidimensional Json objects. But a stringified JSON object is perfectly valid with an appropriate key.

    i.e:

    ext_custom_groups = "{"id":123,"name":"Group Name","role":"Instructor"}, {"id":124,"name":"Group Name 2","role":"Creator"}"