Highlighted

Need javascript to send completion on SCORM lesson_status

New Here ,
Jul 24, 2015

Copy link to clipboard

Copied

I need help with Captivate 7.0.1.237 - on Windows 7

I don't want to use slides viewed OR quiz score to send a completion to the LMS

I have researched javascript - on the web - and the best I can come up with is shown below

var CaptivateObj = document.Captivate;

g_objAPI.LMSSetValue('cmi.core.lesson_status', 'completed');

g_objAPI.LMSCommit('');

g_objAPI.LMSFinish('');

I have tried setting the script to Top, parent, current, new - and have tested a TEST Captivate SCORM package on SCORM Cloud

I have created a simple 5 slide package - with the javascript executing ON EXIT for slide 2 - on slide 3 I have an exit button

IT doesn't work - that is, it doesn't send a completion

I can send the sample Captivate file with the embedded javascript if that would help

Phil Camillo

philcamillo@gmail.com

Adobe Community Professional
Correct answer by TLCMediaDesign | Adobe Community Professional

Those are old SCORM calls. The "g_objAPI" doesn't exist.

use:

SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');

SCORM_CallLMSCommit();

SCORM_CallLMSFinish();

Since these functions exist outside of Captivate, you do not need to funs the Captivate object.

TOPICS
Advanced, Editing, Quizzing and LMS

Views

4.8K

Likes

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

Need javascript to send completion on SCORM lesson_status

New Here ,
Jul 24, 2015

Copy link to clipboard

Copied

I need help with Captivate 7.0.1.237 - on Windows 7

I don't want to use slides viewed OR quiz score to send a completion to the LMS

I have researched javascript - on the web - and the best I can come up with is shown below

var CaptivateObj = document.Captivate;

g_objAPI.LMSSetValue('cmi.core.lesson_status', 'completed');

g_objAPI.LMSCommit('');

g_objAPI.LMSFinish('');

I have tried setting the script to Top, parent, current, new - and have tested a TEST Captivate SCORM package on SCORM Cloud

I have created a simple 5 slide package - with the javascript executing ON EXIT for slide 2 - on slide 3 I have an exit button

IT doesn't work - that is, it doesn't send a completion

I can send the sample Captivate file with the embedded javascript if that would help

Phil Camillo

philcamillo@gmail.com

Adobe Community Professional
Correct answer by TLCMediaDesign | Adobe Community Professional

Those are old SCORM calls. The "g_objAPI" doesn't exist.

use:

SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');

SCORM_CallLMSCommit();

SCORM_CallLMSFinish();

Since these functions exist outside of Captivate, you do not need to funs the Captivate object.

TOPICS
Advanced, Editing, Quizzing and LMS

Views

4.8K

Likes

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
Jul 24, 2015 0
Explorer ,
Jul 24, 2015

Copy link to clipboard

Copied

Try putting the javascript in the onEnter for slide 2.  Using onExit is a little tricky to wrap your head around.

Likes

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
Reply
Loading...
Jul 24, 2015 0
New Here ,
Jul 24, 2015

Copy link to clipboard

Copied

Thanks Dan

I will try this right now - I have really struggled to find ANYTHING out there on script to send a SCORM completion

Do you think the javascript I wrote looks like it will work?

P

Likes

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
Reply
Loading...
Jul 24, 2015 0
Explorer ,
Jul 24, 2015

Copy link to clipboard

Copied

Looks reasonable.

Add console.log ("hello javascript");  and then check your console in chrome (F12) to ensure that your code is running.

(remove any console.log() statements from production code since IE will throw an error on it)

Likes

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
Reply
Loading...
Jul 24, 2015 0
New Here ,
Jul 24, 2015

Copy link to clipboard

Copied

OK - will try this

BTW - I am not a javascript guy - I just happened to know about SCORM - and through searching a number of sites - gobbled together the script - which, like you said - looks "reasonable"

Phil

Likes

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
Reply
Loading...
Jul 24, 2015 0
New Here ,
Jul 24, 2015

Copy link to clipboard

Copied

Hi Dan - same result with adding to ON ENTER - still getting an incomplete when tested at SCORM cloud

testjava.PNG

Likes

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
Reply
Loading...
Jul 24, 2015 0
Explorer ,
Jul 24, 2015

Copy link to clipboard

Copied

Like I said, add the console.log statement to ensure that your code is even running, and/or there are no errors showing up in the console

Likes

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
Reply
Loading...
Jul 24, 2015 0
Adobe Community Professional ,
Jul 29, 2015

Copy link to clipboard

Copied

Those are old SCORM calls. The "g_objAPI" doesn't exist.

use:

SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');

SCORM_CallLMSCommit();

SCORM_CallLMSFinish();

Since these functions exist outside of Captivate, you do not need to funs the Captivate object.

Likes

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
Reply
Loading...
Jul 29, 2015 2
New Here ,
Jul 29, 2015

Copy link to clipboard

Copied

Thanks so much for the new code - I will try this right away

Question - does it make any difference in the javascript settings - if I set it to either top, parent, current or new?

Thanks again

Phil

Likes

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
Reply
Loading...
Jul 29, 2015 0
Adobe Community Professional ,
Jul 29, 2015

Copy link to clipboard

Copied

I always use the default "current"

Likes

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
Reply
Loading...
Jul 29, 2015 0
New Here ,
Jul 29, 2015

Copy link to clipboard

Copied

AWESOME - AWESOME - AWESOME!!!!

IT WORKED - thank you so much - WOW

The only thing is that it exited at the completion - which is probably the SCORM_CallLMSFinish(); command

I will take that out - so I just have Commit

javacomplete.PNG

Likes

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
Reply
Loading...
Jul 29, 2015 0
Explorer ,
Mar 25, 2018

Copy link to clipboard

Copied

HI,

I was looking out for similar solution and found you have answered it.

I am newbie and not from programming background. Can you help me what is current and when should we paste the code to let LMS know the course status is complete.

Thanks in advance.

Likes

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
Reply
Loading...
Mar 25, 2018 0
Adobe Community Professional ,
Mar 26, 2018

Copy link to clipboard

Copied

Just paste the code on Enter of the slide where you want to register completion.

If I understand you correctly "current" is the window the script should be executed in. In this case and almost all cases, it should be "current".

Likes

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
Reply
Loading...
Mar 26, 2018 0
Engaged ,
Mar 28, 2018

Copy link to clipboard

Copied

Hi there, I wanted to share my experiences.

Using Captivate 2017 and SharePoint LMS.

The following works well with SCORM 1.2 but NOT with SCORM 2004. Need to specify that I hook the script to a button, not to OnEnter event.

SCORM_objAPI.LMSSetValue("cmi.core.lesson_status", "completed");

SCORM_objAPI.LMSCommit('');

SCORM_objAPI.LMSFinish('');

The following works neither with 1.2 nor with 2004

SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');

SCORM_CallLMSCommit();

SCORM_CallLMSFinish();

I am ok with it since 1.2 works well for me. However, from purely theoretical point of view, what is that I am missing?

Thanks

Bobby

PS. Great blog TLC guys! BTW, can one use the Console of the F12 Developper tools change the status from there?

Likes

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
Reply
Loading...
Mar 28, 2018 1
New Here ,
Nov 23, 2015

Copy link to clipboard

Copied

Hey All, Nice to see this for SCORM, any chance there is a version that will work with AICC?

Thanks,

  Tim Munroe

Likes

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
Reply
Loading...
Nov 23, 2015 0
Adobe Community Professional ,
Nov 23, 2015

Copy link to clipboard

Copied

Never used AICC, but you can try this:

AICC_TranslateLessonStatusToAICC("C")

Likes

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
Reply
Loading...
Nov 23, 2015 0
Community Beginner ,
Jan 23, 2018

Copy link to clipboard

Copied

Thanks, TLC. This worked perfectly with SCORM and EdApp.

Much better than Captivate's Success/Complete Criteria.

Put your code on an EXIT button, and the course is exited and a "completion" is recorded. PERFECT!

Likes

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
Reply
Loading...
Jan 23, 2018 0
Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Most of the solutions provided here are dependent on the particular protocol (SCORM 1.2 / 2004, AICC, etc)

I have found that if you simply the run the line below built in functionality will use whichever protocol is appropriate and send the completion status.

SetReachedEnd()

Likes

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
Reply
Loading...
Dec 07, 2018 0
New Here ,
Oct 16, 2020

Copy link to clipboard

Copied

For scorm 2004 set completion status use below code in the end of the slide.

set in javascript :- SetReachedEnd();

Likes

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
Reply
Loading...
Oct 16, 2020 0