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

Importing LMS variables into Captivate

Explorer ,
May 15, 2012 May 15, 2012

Copy link to clipboard

Copied

I would like to retrieve data from the LMS (Moodle) running my Captivate course - specifically, capture the students name from LMS and display it in Captivate. I have read a previous discussion on this, but it ended without a definitive answer it seemed.

Looks like first the SCORM data in the variable first has to be passed to an embedded Flash file through javascript, then passed on to Captivate from Flash. One suggestion from the post hinted it could be done without the javascript step.

Has anyone had success with this? And with SCORM 1.2 or 2004? I would greatly appreciate some advice if anyone has pulled this off...

SCORM variable (student's name) -> Javascript -> embedded Flash file -> displayed in Captivate....

Thank you in advance to anyone who can help!

TOPICS
Quizzing and LMS

Views

7.7K

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

Explorer , May 22, 2012 May 22, 2012

Why sure...this works with Flash AS3, CP5.5, and Moodle as the LMS...

First, I created a small 10x10 px, one frame flash file to import into Captivate (just want the AS code to run, its hidden in a black part of my background in slide 1...)

Then entered this code into the frame:

//Get LMS student name from SCORM

import flash.external.ExternalInterface;

try{

//Assigns the LMS student name to a string

var UserName:String = String(ExternalInterface.call('g_objAPI.LMSGetValue','cmi.core.student_name'));

//T

...

Votes

Translate

Translate
Advisor ,
May 18, 2012 May 18, 2012

Copy link to clipboard

Copied

It can definitely not be done without using JavaScript. SCORM relies on JavaScripts to do all of the communication so this is a key part of the solution.

Basically you want to create a JavaScript function that can grab the data from your LMS. Keep in mind that there are differences between the naming and location of SCORM database fields for SCORM 1.2 and SCORM 2004. Once you have a working function (just add an "alert" that will display what the javascript function returns when it is executed) you can go to the next step, which is getting the data into Captivate.

You probably want to create a Flash SWF that will do some processing on the retrieved value first. You see the SCORM specifications does not state HOW the LMS providers should implement the student name format so this will vary from LMS to LMS. The majority of LMS's would return something like "{lang=en}Doe, John" so you wouldn't be able to use that in Captivate.

Your flash file should strip away the language tag and probably also reverse the order of the names so you get "John Doe" as a result instead. Once you have done the processing in Flash you would create a user defined variable in Captivate to store the name in. The Flash file should then "pass" the data over to this variable and you could then use it in your course. Here - http://www.cpguru.com/adobe-captivate-5-system-variables/ - you can see a way to have a Flash file communicate with Captitvate.

Good luck ;o)


www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips and Tricks and much more..

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
Explorer ,
May 18, 2012 May 18, 2012

Copy link to clipboard

Copied

Thank you very much, I have a great starting point now! Question though-

can I put the Javascript function to get the data from LMS in the Script

window in Captivate? In other words, use the Execute Javascript feature in

Actions? Or do I have to add the function to the external .js file created

in the SCORM package?

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
Advisor ,
May 20, 2012 May 20, 2012

Copy link to clipboard

Copied

I guess that you could put the JavaScripts in the Execute JavaScript directly in Captivate, but I would add them to the standard.js or scorm.js file that Captivate produces.

In order to strip away the languag tag etc. you would need to get the value into your Flash file, so if you have the JS function in the standard.js you can just call that from your Flash file and get the return value for further processing.


www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips and Tricks and much more..

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
Explorer ,
May 21, 2012 May 21, 2012

Copy link to clipboard

Copied

Thanks for your input so far! But another question...how do I get a value

from a Flash variable into Captivate? In AS3??

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
Guest
May 21, 2012 May 21, 2012

Copy link to clipboard

Copied

Hello,

For more information on Michael's suggestion, you might want to visit and read further information on this thread.

This is in connection to what you want to achieve.

Cheers!

-Miguel

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
Explorer ,
May 21, 2012 May 21, 2012

Copy link to clipboard

Copied

Thanks for all your pointers, happy to report everything is working

perfectly, I am able to start my Captivate course in Moodle, pull usernames

from LMS into my embedded Flash file, and pass them to Captivate for

display. And didn't have to add anything to the .js files, all AS3. Thanks

again for the guidance all! Terry

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
Advisor ,
May 22, 2012 May 22, 2012

Copy link to clipboard

Copied

Okay - can you mark the topic as answered so that other users will find it more easily.

Also - it would be very helpful if you could post a brief explanation of how you got it to work. I'm especially interested in how you got the Flash file to pull the data without adding any Javascript, but perhaps you are calling the JS directly from the SWF?


www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips and Tricks and much more..

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
Explorer ,
May 22, 2012 May 22, 2012

Copy link to clipboard

Copied

Why sure...this works with Flash AS3, CP5.5, and Moodle as the LMS...

First, I created a small 10x10 px, one frame flash file to import into Captivate (just want the AS code to run, its hidden in a black part of my background in slide 1...)

Then entered this code into the frame:

//Get LMS student name from SCORM

import flash.external.ExternalInterface;

try{

//Assigns the LMS student name to a string

var UserName:String = String(ExternalInterface.call('g_objAPI.LMSGetValue','cmi.core.student_name'));

//To separate the first and last name...

var LastName:String = UserName.slice(0, UserName.indexOf(","));

var FirstName:String = UserName.slice(Number(UserName.indexOf(",")+2), UserName.length);

}catch(err:Error){

     trace("Not in an LMS Currently");

}

//Send first name to Captivate

var myRoot:MovieClip = MovieClip(root);

var mainmov:MovieClip = MovieClip(myRoot.parent.root);

mainmov.FirstName = FirstName;

Then, placed this flash file on slide 1 of my Captivate lesson, where I display the value of FirstName I get from Flash. You know, "Welcome, $$FIrstName$$"!! Then when I start my lesson in Moodle the FirstName shows up...

A quirk though, it didn't work at first - it seems that when Moodle would start the Captivate lesson  and the AS in the Flash file executes at the same time, it wouldn't pull the first name. So I set the Flash movie  to delay for .5 seconds in the timeline, so the Captivate lesson would start, a very brief pause, then the AS code executed and I got the FirstName. And also, the Captivate text box with the $$FirstName$$ variable display has to appear after the Flash code has got the FirstName from LMS, so I set it to delay 1 sec on the timeline.

That was it, I didn't add anything to the external .js file. Maybe this will help somebody! Thanks again for pointing me in the right direction...

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
New Here ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Any thoughts as to how to make this work in HTML5? Pure js and Advanced Actions maybe? Thanks in advance!

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
Advisor ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

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
New Here ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

Thank you Michael and Jim! I also posted on your site but I will repeat it here just in case you or someone else has the answer. Is the patch that to linked to recommended for 6.1 users or just 6.0?

Thanks,

Ryan

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 ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

The fix in Michael's article is just for 6.0.1.240, just got confirmation about that from Adobe. Fix for 6.1 will be there soon, I hope.

Lilybiri

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
New Here ,
Mar 26, 2013 Mar 26, 2013

Copy link to clipboard

Copied

LATEST

cubsfan2010 ...I could kiss you.

Although for anyone else using this, I noticed that there is a space in this line which should not be there:

var UserName:String = String(ExternalInterface.call('g_objAPI.LMSGetValue','cmi.core.studen t_name'));

Should be

var UserName:String = String(ExternalInterface.call('g_objAPI.LMSGetValue','cmi.core.student_name'));

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