Follow

Using Custom Launch Data in Content Controller

Avatar

Configuring custom launch data allows you to specify a set of data that will be made available to the course when it is launched by a learner. It really only works with courses that have been specifically designed to look for and use that custom launch data, so if you wanted to take advantage of this, it would require some changes to your courses.

We most commonly see this feature used as a way to slightly differ a course's presentation or behavior between accounts. You could pass in different company names to display, alternative verbiage, flags to enable/disable certain chapters, etc.

Content Controller provides the custom launch data you've configured as a query parameter on the URL of your course content. The query parameter is named "cp", and the value is a URL. For example, this is some test content I've got locally:

https://cc.example.com/courses/9b4c0391-775e-47f6-a4e6-b8896818fa3f/0/shared/launchpage.html?accountId=5&cp=https://cc.example.com/api/launch/customParams/764ae7b2-df36-489e-8b60-66a0115368ce


Then, your content will need to make an AJAX call to that URL for your custom parameters. This is how I retrieved the launch data from my test content:

var customParamUrl = new URLSearchParams(window.location.search).get('cp')
var xhttp = new XMLHttpRequest();
xhttp.open("GET", customParamUrl, true);
xhttp.send()
xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
       // wait for the response, then parse the response as JSON
       // and check the "custom_param" property
       alert(JSON.parse(xhttp.responseText).custom_param)
    }
};

The CustomParams URL is only valid for a short window, so make sure that you grab your launch data within a few minutes of launching the content.
 
If you have any other questions about custom launch data, please feel free to reach out to us at support@rusticisoftware.com.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk