Skip to main content
Inspiring
September 18, 2018
Answered

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

  • September 18, 2018
  • 2 replies
  • 760 views

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

    This topic has been closed for replies.
    Correct answer TLCMediaDesign

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

    2 replies

    TLCMediaDesign
    TLCMediaDesignCorrect answer
    Inspiring
    September 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";

    Inspiring
    September 19, 2018

    Thanks David

    That worked well.

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

    TLCMediaDesign
    Inspiring
    September 19, 2018

    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.

    Lilybiri
    Legend
    September 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.

    Inspiring
    September 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

    Lilybiri
    Legend
    September 18, 2018

    OK, the it is up to the JS experts.