Copy link to clipboard
Copied
Hi there, I would the user to be able to click on a button and to see the cmi.location in SCORM 2004.
I am trying linking this script to a JS and a button
var myLocation = window.cpAPIInterface.getVariableValue("cmi.location");
var nameOfTEBVariable = myLocation;
I have a text entry box that is called nameOfTEBVariable
What am I doing wrong?
Thanks
B
The cmi.location is not a Captivate variable.
Use:
window.nameOfTEBVariable = SCORM2004_CallGetValue("cmi.location");
Be aware that this will be a slide label if present, otherwise it will be a slide number, such as "Slide_5";
Copy link to clipboard
Copied
No answer about the JS, but wonder why you use a TEB instead of a text container (shape or caption) to display a variable. TEB's are bit weird, they don't update automatically when you change the value of the associated variable. A workaround is to replay the slide, or to use the CpExtra widget by InfoSemantics which can fix some of the limitations like this one for a TEB.
Copy link to clipboard
Copied
Thanks Lieve
Actually it is not a TEB .... I got it wrong taking the name from an old project
It is a caption
Copy link to clipboard
Copied
OK, the it is up to the JS experts.
Copy link to clipboard
Copied
The cmi.location is not a Captivate variable.
Use:
window.nameOfTEBVariable = SCORM2004_CallGetValue("cmi.location");
Be aware that this will be a slide label if present, otherwise it will be a slide number, such as "Slide_5";
Copy link to clipboard
Copied
Thanks David
That worked well.
Is there a way to use cmi.location for bookmarking?
Copy link to clipboard
Copied
The cmi.location is used for bookmarking along with slide completion data in the suspend_data.
Captivate returns you to the last slide visited, not the furthest progress. If you want furthest progress, then the scormdriver.js needs to be edited to only write the bookmark based on furthest progress.