In order to create an exam which has an LTI Connection through the API, you'll need to go through these steps:

1. Create an exam 
2. Create a tool provider, which specifies your external platform, linked to your Institute. You can create the tool provider via the API or once, using the web interface, in which case you should fetch the tool_providers with the API in order to know its id.
3. Create an LTI resource with the exam_id of the exam you want to connect and the tool_provider_id of the external platform you created in step 2. The LTI resource you create in this step should match one of the resources you have created on your external platform.
4. Finally, create the exam instructions using the /documents API, by inserting the placeholder that was returned in step 3 into the instructions (exam_content field)

Errors

Code Description
403 You are not authorized to access this page.
422 Param is missing or the value is empty: 'param'

Examples

{
        'example_request_params': {
            'tool_name': 'some name',
            'oauth_consumer_key': 'key',
            'oauth_consumer_secret': 'secret',
            'nonce': 1527500365,
            'timestamp': 1527500365052,
            'signature': '8aac70c9906ad0812f4fbc34617322f985b4ac978cec861724f142cb572b88ff'
        },
        'example_response': {
            'tool_provider': {
                'id': 2,
                'tool_name': 'some name',
                'tool_url': '',
                'oauth_consumer_key': 'key',
                'oauth_consumer_secret': 'secret',
                'institute_id': 1,
                'created_at': '2020-11-26T07:19:53.143+01:00',
                'updated_at': '2020-11-26T07:19:53.143+01:00',
                'use_as_basic_link': true,
                'lti_custom_data': '{}'
            }
        }
    }

Params

Param name Description
tool_name
required

Name of the tool provider

Validations:

  • Must be a String

oauth_consumer_key
required

Oauth key to authenticate to the tool provider

Validations:

  • Must be a String

oauth_consumer_secret
required

Oauth secret to authenticate to the tool provider

Validations:

  • Must be a String

institute_id
optional

ID of the institute where the tool_provider will belong (only for superuser)

Validations:

  • Must be a String

use_as_basic_link
optional

If set to true the link will be used directly as a basic link otherwise it will be used for deep linking

Validations:

  • Must be one of: true, false, 1, 0.

lti_custom_data
optional

Json as a string that will add custom data to the LTI request (custom_ will be added in front of each key of the JSON when the LTI request will be made)

Validations:

  • Must be a String

tool_url
optional

Url of the tool provider LTI resource

Validations:

  • Must be a String

timestamp
required

Timestamp of the request in milliseconds.

Validations:

  • Must be a number.

nonce
required

Random number unique between the api calls made in the previous 24 hours.

Validations:

  • Must be a number.

signature
required

HMAC sha256 hex encoded hash, using the user secret_key as key, of the query string build with all the other parameters in the format 'name=value' joined by '?' and ordered alphabethically by name. Do not use encoding scheme on the values you use to calculate the string

Validations:

  • Must be a String