Control the variables with Java Script from the Console in F12 - Dev Tools
Hi there,
I can get and set variables in a project in IE Dev tools Console.
This is what commands work for me.
//Get a variable value
cpAPIInterface.getVariableValue ("nameVariable");
//Set a Section completion variable to 1. Useful for marking a topic/section as completed
cpAPIInterface.setVariableValue('nameVariable', 1);
//Go to a slide number. The slide starts from 0 in JS and from 1 in Captivate
cpAPIInterface.setVariableValue('cpCmndGotoSlide', 2);
All the above works well when I preview the project with F11 - HTML5 in browser or just run the project locally.
Then, I deploy the project on the LMS. (SharePoint based LMS 365).
I cannot change the variables with the same commands. For instance, if I use this one
cpAPIInterface.setVariableValue('cpCmndGotoSlide', 2);
this is what I get
'cpAPIInterface' is undefined
Any ideas why this happens?
Also, how can I try this one in a Console?
SCORM_objAPI.LMSSetValue("cmi.core.lesson_status", "completed");
Thanks in advance
B
