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

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

Engaged ,
Sep 18, 2018 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

Views

316

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

Votes

Translate

Translate
Community Expert ,
Sep 18, 2018 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.

Votes

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
community guidelines
Engaged ,
Sep 18, 2018 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

Votes

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
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

OK, the it is up to the JS experts.

Votes

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
community guidelines
People's Champ ,
Sep 18, 2018 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";

Votes

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
community guidelines
Engaged ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Thanks David

That worked well.

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

Votes

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
community guidelines
People's Champ ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
Resources
Help resources