// Check if the method includes is defined
if ( ! String.prototype.includes ){
// Otherwise, define it
String.prototype.includes = function( search, start ){
if ( typeof start !== 'number' ){
start = 0;
}
if ( start + search.length > this.length ){
return false;
} else {
return this.indexOf(search, start) !== -1;
}
};
}
// Define function to get parameters from the URL
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var actor = JSON.parse(getParameterByName('actor'));
var baseUrl = getParameterByName('base_url');
var nonce = getParameterByName('nonce');
var email = actor.mbox[0].replace('mailto:', '');
var postId = getParameterByName('auth').replace('LearnDashId', '');
/* Tin Can configuration */
//
// ActivityID that is sent for the statement's object
//
TC_COURSE_ID = "http://Course_ID1";
//
// CourseName for the activity
//
TC_COURSE_NAME = {
"en-US": "Reflective Perspective xAPI"
};
//
// CourseDesc for the activity
//
TC_COURSE_DESC = {
"en-US": "Course Description."
};
//
// Pre-configured LRSes that should receive data, added to what is included
// in the URL and/or passed to the constructor function.
//
// An array of objects where each object may have the following properties:
//
// endpoint: (including trailing slash '/')
// auth:
// allowFail: (boolean, default true)
// version: (string, defaults to high version supported by TinCanJS)
//
TC_RECORD_STORES = [
];