Enable Custom Script $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="https://rssamplifier.com/api/frame?u=https%3A%2F%2Fdocs.codio.com%2Finstructors%2Fadmin%2Forganization%2Fenable-custom-script.html#enable-custom-script">
You can enable custom scripts to integrate third-party systems, such as Sense Network to help and track students from the Organization > Custom Scripts page in Codio. The script passes the userid, email, and user type (Student/Teacher).
If required by the third-party system, custom js code can be included in the Custom Script section. This code should be entered without script tags, for example:
var http = new XMLHttpRequest();
var url = 'https://userdomain/url'; //Change to valid URL for your third-party system
var params = 'userId=' + codio.userId ;
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange = function()
//Call a function when the state changes.
{if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
You can also add console.log entries to be able to test and view output, for example:
console.log('params', codio);
console.log('params', window);
console.log('params', document)
console.log(window.codio.currentPage)
console.log(window.codio.totalNumberOfPages)
If you require any assistance enabling custom scripts, contact Codio.