Forum Discussion
How does Storyline 360 identify whether it is published to an LMS or the web?
I'm not sure that a scripting effort would not do this, but based on my experience, you are basically going to be publishing two versions of the course: one for the LMS (a standard SCORM package, for example) and a second for web access. And since you are publishing two separate versions, you should be able to readily add the supplemental materials to the web-only version.
You might consider keeping the second slide (after the splash) in both versions, and require the user to confirm that they are indeed completing the course in the correct delivery environment (accessing via LMS? click here, accessing via web? click here), with the "incorrect" selection resulting in a second screen that requires the user to either exit the course and then start it in the alternate environment.
Keep in mind that completing the course via the web will not provide the reporting data that the LMS version does.
- Nathan_Hilliard6 months agoCommunity Member
To detect the LMS, you can try this short piece of JavaScript. It will assign true or false to some Storyline variables if the LMS or the LMS API is found. You can publish it to LMS/SCORM and run it as a local webpage or on your LMS to see the results. In my environment, I get false outside my LMS, and true inside my LMS.
Code:
//Create reference to LMSAPI, either in current or parent windows, it it exists
//May cause CORS errors outside of LMS if not trapped
//https://docs.rusticisoftware.com/driver/Function-List.html
//-Function to connect with LMSAPI---------------------------------------------
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) {
return win;
}
else if (win.parent == win) {
return null;
}
else {
return findLMSAPI(win.parent);
}
// see also window.LMSStandardAPI and scormdriver.js for list of available functions
}
//-Main Routine----------------------------------------------------------------
let player = GetPlayer();
let lmsAPI = findLMSAPI(this);
player.SetVar("foundLMSAPI", !(lmsAPI == null));
player.SetVar("foundLMS", (lmsAPI) ? lmsAPI.IsLmsPresent() : false);