Forum Discussion
LMS Course Name JavaScript Action
Are you checking the console for errors? I am sure you must be getting some.
Course name is not defined in the scorm standard, so using the LMSAPI is unlikely to work.
In the code you posted last you definitely have a syntax error and need to dd the line var player=GetPlayer();. Even then you need to know what you are connecting to to pull the variable.
var player=GetPlayer();
var externalCourseID = classroomName;
player.SetVar("CourseName", externalCourseID);
Phil, I wasn't assuming he was using any SCORM API because unfortunately you're right about the SCORM spec. What I was going from was Joe writing "and found the function 'classroomName' which returns the right value". So however that value was returned via the console that he said he could use, he should replicate that to the right of the externalCourseID =
Joe, employing the function classroomName (however you did that in the console) requires a pair of trailing parentheses and likely some quoted parameter inside those parens. Copy/paste that text to the right of
var externalCourseID = classroomName('some parameter');
and see what happens. Of course make sure your single/double quotes are never stylized, curled, etc. What LMS are you working with? Their API documentation is probably online and we might be able to research that function a little more.
- JoeLloyd-17dcfe2 years agoCommunity Member
Thank you so much all for the support…..
The LMS I am using is ESR (Electronic Staff Records) which is an NHS system used by most organisations in some capacity in the UK
as previously mentioned i have managed to get the java-script to work for finding the users name and copy and paste over a project variable which is grabbing that information from the system. And ive also managed to get the date working (however i know this doesn't need to come from the LMS this can be based on the system date)
Thank you all for this support i really appreciate it
- PhilMayor2 years agoSuper Hero
Hi Craig, I was replying to Joe he had syntax errors in his code and wasn’t setting the player so nothing would come back.
The console should be your friend to find errors, I just find it odd that the course name is available to pull directly although ESR is odd as it uses oracle and a transition layer between the course and the LMS
Sent from my iPhone
- JoeLloyd-17dcfe2 years agoCommunity Member
ESR is a very strange system and never quite works or behaves as a standard system should....
I used to use Lectora Online which was very easy as this could basically pull down the API setting straight from the course itself.
but with Articulate there isn't that option.... i am not 100% how the console works and what i need to do in there.... i am literally just starting a degree in software engineering so hopefully in a few years this will all be much easier and make sense to me but for now i am but a fish out of water 🤣
- PhilMayor2 years agoSuper Hero
The console will give you error messages in user.js and typically give you the line number, often it is the line before.
There is no provision in the scorm API for course name, would be useful if there was why do you want to pull it?
Sent from my iPhone