Forum Discussion
Import LMS status to project state variable?
My LMS (LearnDash LMS) registers whether a course has been completed by the user. Is it possible for a Storyline project to fetch this state somehow (with Javascript perhaps?) from the LMS and put it in a project state variable that can then be used in the Storyline project?
P.S Here the LMS function to call on to check if a user has completed the project in the past: https://developers.learndash.com/function/learndash_is_lesson_complete/
- JoeFrancisCommunity Member
Sam Coulson responded to the Help with JavaScript and pulling data from an LMS thread with a list of the available functions in the LMSAPI.js file. One of the functions he identified is lmsAPI.GetStatus.
As Sam points out, "this is advanced coder territory, reverse-engineer with caution."
- AdaMiantiCommunity Member
Thanks Joseph, I gave it a first try and added a trigger that executes the following Javascript code:
alert(lmsAPI.GetStatus());
But it returns:
lmsAPI is not defined
It's probably because LearnDash isn't SCORM-compliant by default. Since, I would only need SCORM for this one function it's not worth it for me to purchase the additional software needed to make LearnDash SCORM-compliant.
For any future visitors of this post: it should work and provide the solution to my question, as long as you have a SCORM-compliant LMS.
If anyone has any additional ideas how to make this work without dependence on SCORM, I would love to find out. After all, the LMS has a function for it available, so it should be possible to call upon that function with JavaScript from inside the storyline project...?
- Jürgen_Schoene_Community Member
the function "learndash_is_lesson_complete" is not a javascript function, it's a function to create plug-ins with php running on the web server
- AdaMiantiCommunity Member
Ah, I see, so then unfortunately it's only possible if you have an LMS that supports SCORM.