Highlighted

Display the cmi.location to the learner in the Captivate module

Engaged ,
Sep 18, 2018

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

Adobe Community Professional
Correct answer by TLCMediaDesign | Adobe Community Professional

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";

Views

113

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Display the cmi.location to the learner in the Captivate module

Engaged ,
Sep 18, 2018

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

Adobe Community Professional
Correct answer by TLCMediaDesign | Adobe Community Professional

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";

Views

114

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2018 0
Most Valuable Participant ,
Sep 18, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Engaged ,
Sep 18, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Most Valuable Participant ,
Sep 18, 2018

Copy link to clipboard

Copied

OK, the it is up to the JS experts.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 1
Adobe Community Professional ,
Sep 18, 2018

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";

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 2
Engaged ,
Sep 18, 2018

Copy link to clipboard

Copied

Thanks David

That worked well.

Is there a way to use cmi.location for bookmarking?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2018 0
Adobe Community Professional ,
Sep 19, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 19, 2018 0