Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Engaged ,
Sep 18, 2018 Sep 18, 2018

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

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

correct answers 1 Correct answer

People's Champ , Sep 18, 2018 Sep 18, 2018

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

Translate
Community Expert ,
Sep 18, 2018 Sep 18, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 18, 2018 Sep 18, 2018

Thanks Lieve

Actually it is not a TEB .... I got it wrong taking the name from an old project

It is a caption

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

OK, the it is up to the JS experts.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 18, 2018 Sep 18, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 18, 2018 Sep 18, 2018

Thanks David

That worked well.

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 19, 2018 Sep 19, 2018
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources