Skip to main content
Participating Frequently
November 28, 2012
Question

Captivate 6 - Getting Values from LMS

  • November 28, 2012
  • 1 reply
  • 4217 views

The old var theval = g_objAPI.LMSGetValue(cmivalue); value doesn't seem to work in Captivate 6 since the rebuild of the SCORM wrapper.  Is there any way to do this setup with Captivate 6?  We are doing our best to get   cmi.core.student_name from our LMS and post it on a certificate within Captivate.

I'd like to see if anyone has figured out how to do the setup below with Captivate 6 and scormdriver.js file.

(This is done in Captivate 5 and 5.5)

In the scorm_support.js file I added the following:

     function scorm_get(cmivalue, whichval){

           //Get the name from SCORM 1.2
           var theval = g_objAPI.LMSGetValue(cmivalue);

           //Send the name to Captivate via ExternalInterface

document.getElementById("Captivate").cpEISetValue(whichval,theval );
     }

Thanks,
Jcole

This topic has been closed for replies.

1 reply

Legend
November 30, 2012

You can grab the student name like so:

var sName = GetStudentName();

The new driver has many of the needed functions hanging off of the main window object.  If you're in the chrome console (CTL + SHIFT + J), you can type "window.Get" and you'll see all the functions available by the driver.

Setting the Cp variable will be a bit different depending if you're publishing for SWF or HTML5 output... the JavaScript API is different for both.

http://captivatedev.com/2012/07/01/adobe-captivate-6-the-javascript-api/

Jim Leichliter

Legend
December 5, 2012

.... to take this a step further, suppose you had a Captivate User variable called "studentName".  You could do the following inside of Captivate 6.x to retrieve the student's Name from the LMS.  This is for SWF output.  HTML5 uses a different JavaScript API.

/* Obtain the student name from the LMS and put it into a JavaScript variable called sName */

var sName = GetStudentName();


/* Get the Captivate Object */

var objCp = document.getElementById('Captivate');


/* Set the studentName Captivate User variable with the JavaScript variabe, sName */

objCp.cpEISetValue('m_VarHandle.studentName', sName);

Once this code fires on a Slide Enter action, your caption with the $$studentName$$ should update to display the student name as given by the LMS.

Participating Frequently
December 17, 2012

Thanks Jim,  For the HTML5 output would you use

/* Obtain the student name from the LMS and put it into a JavaScript variable called sName */

var sName = SCORM_GetStudentName();

instead?