Skip to main content
Participating Frequently
July 24, 2015
Answered

Need javascript to send completion on SCORM lesson_status

  • July 24, 2015
  • 4 replies
  • 9434 views

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

This topic has been closed for replies.
Correct answer TLCMediaDesign

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.

4 replies

Participant
October 16, 2020

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

set in javascript :- SetReachedEnd();

Inspiring
December 7, 2018

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()

TLCMediaDesign
TLCMediaDesignCorrect answer
Inspiring
July 29, 2015

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.

Participating Frequently
July 29, 2015

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

TLCMediaDesign
Inspiring
July 29, 2015

I always use the default "current"

dan_tasota
Inspiring
July 24, 2015

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

Participating Frequently
July 24, 2015

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

dan_tasota
Inspiring
July 24, 2015

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)