Skip to main content
Known Participant
November 20, 2015
Question

addressing SCORM variables in different versions of Captivate

  • November 20, 2015
  • 2 replies
  • 1026 views

I know since Captivate 6, Captivate has used the Rustici SCORM engine which is by far the best that I know of, and this has continued to my knowledge through to version 9.  But, the difficulties come in when you do ANYTHING outside the norm in terms of slides, pages and assessments, for example using a single slide with numerous frames which match the frames of an imported video. Trying to get ANY information or specific examples of interacting with SCORM between the various versions is like milking a gerbil. I am specifically using Captivate 9, and I've tried SCORM_Call, etc. since I'm using SCORM 1.2 but no code that I've tried is doing what I want, which is simply detecting if the entire movie has been watched based on current frame, and bouncing that against total frames of the slide the SCO would set either "completed" or "incomplete" setting resume data as appropriate and then calling an LMSFinish().  TO exacerbate the problem, I'm forced to used a significantly customized version of an older LMS that displays SCORM 1.2 content in a pop-up window, first with a frameset that has course description on top , outline parsed from manifest on left frame, and any metadata info tied to each SCO within the right frame. Either the window closes entirely, closing the SCORM Session, and not allowing the user to choose the next SCO, or it just sits there at completion of video, and the user ultimately has to close the window manually via top right window controls, with same result, entire SCORM session is closed, instead of simply the SCO closing via a properly interpreted LMSFinish() and if completed, the SCO gets it's little "checkmark" and you would go onto the next SCO. I have tried so many differing iterations at this point, I'm just getting frustrated, and I need to reach out to the Captivate Users here on Adobe forums to try and get me going in the right direction.

Here's and example of the last thing I tried, and as I said, I don't know if in Captivate 9 I MUST user JSInterface or not!? Here's a few different versions of what I have tried to no avail.

var CpObj = document.Captivate;
var cpFC = cpInfoFrameCount;
var cpCF = cpInfoCurrentFrame;

if (this.CpObj.cpCF == this.CpObj.cpFC) {
SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');
SCORM_CallLMSSetValue('cmi.core.suspend_data','');
SCORM_CallLMSSetValue('cmi.core.exit','');
SCORM_CallLMSFinish();
SetReachedEnd();
}

else {
SCORM_CallLMSSetValue('cmi.core.lesson_status', 'incomplete');
SCORM_CallLMSSetValue('cmi.suspend_data', this.CpObj.cpCF);
SCORM_CallLMSSetValue('cmi.core.exit','suspend');
SCORM_CallLMSFinish();
}


V2

var CpObj = document.Captivate;
var cpFC = cpInfoFrameCount;
var cpCF = cpInfoCurrentFrame;

if (this.CpObj.cpCF == this.CpObj.cpFC) {
SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');
SCORM_CallLMSSetValue('cmi.core.suspend_data','');
SCORM_CallLMSSetValue('cmi.core.exit','');
SCORM_CallLMSFinish();
SetReachedEnd();
window.history.go(0);
}

else {
SCORM_CallLMSSetValue('cmi.core.lesson_status', 'incomplete');
SCORM_CallLMSSetValue('cmi.suspend_data', this.CpObj.cpCF);
SCORM_CallLMSSetValue('cmi.core.exit','suspend');
SCORM_CallLMSFinish();
window.history.go(0);
}

    This topic has been closed for replies.

    2 replies

    TLCMediaDesign
    Inspiring
    November 20, 2015

    When are you calling the JavaScript? Unless you call it at the exact moment, the if will never register;

    if (this.CpObj.cpCF == this.CpObj.cpFC) {

    You need to set up an event listener for onVariableChange using the commonJSInterface and check it on every frame.

    Known Participant
    November 20, 2015

    Hi, That makes sense, But I had the script tied to the EXIT_Btn, so I'm going to have to place the new script with the JSInterface eventHandler onVariableChange for CurrentFrame onto the main slide itself, I assume I can still have the Lesson_Status call on the EXIT_Btn I'm not sure how to handle that end of it, unless I add an OnExit function to the eventHandler on the main slide as well, which would take care of the "completed" or "incomplete" based on what frame the slide was on when the "DoFinish()" or "SCORM_CallLMSfinish()" that syntax is what has me a bit confused, I see examples using ObjAPI, SCORM_API, if I want to communicate with SCORM using the Common JS Interface Which call should be used, and what would the dot notation look like, what scope would it have? eg., "this.cpObj. or would it be better if possible to actually query the video itself eg., this.cpObj.video1?  I'm not as much concerned with any bookmarking function, although it would be nice, all I really care about is if the user exits before viewing the entire video it's marked "incomplete" and set resume (Although, there's if there's no way to document tracked frames, don't know other than setting exit to "suspend") and if the video hits its last frame, the set some variable as "Completed" and pass that as cmi.core.lesson_status, this also brings up the windowing issue, if you want to close out a SCO being displayed in a SCORM Player popup, obviously top.window.close (); is going to close the whole window, but I've tried simply window.close (): and it didn't work, that's why I thought to try the Windows history using a back function, but I don't know if onbeforeunload or onunload will fire off the "DoFinish ();" that's set in the HTML shell page.

    I signed up as a member of your Site (TLCMediaDesign) I thought I has seen that you folks were also dealing with monitoring videos, how did you handle these issues to document SCO status and properly close it out??  That's for your advice, it does make sense, now I just have to figure out where and when the listener should be for EXIT_btn, etc.

    Eric Thanks for your feedback/info as well, much appreciated....

    TLCMediaDesign
    Inspiring
    November 20, 2015

    We don't use Captivates SCORM at all. We create our own Manifest and have SCORM functions in Flash Navigation widgets. For HTML 5 we use the slideEnter and variable change events to make SCORM calls for bookmarking and resume data.

    I think you need to make the SCORM calls if your current frame is within 100 frames of the total frames. I would start the variable change listener only if on the last slide. Just add a slide enter listener and test if cpInfoCurrentSlide = cpInfoSlideCount , if not remove the listener and return.

    If you are publishing to Captivates SCORM it is making calls at the same time depending on what criteria you are using for completion.

    Also, I don't know if you are using swf or html5, but I've found discrepancies with currentFrame and totalFrames being off by a couple in swf. To test for the end of a slide I always check if currentFrame > totalFrames (endFrame) - 5 so I'm sure to catch the end.

    Erik Lord
    Inspiring
    November 20, 2015

    This sort of detailed JS integration is over my head, so I was going to paste links to Jim L's older JS references, but see from here:

    http://www.infosemantics.com.au/adobe-captivate-advanced-elearning-tutorials/javascript-guide

    That you've already been down that road.

    Maybe Rod can be of more direct assistance...

    BUT I don't think you can do what you want.. Even if you could customize the value of 'completed/incomplete' via JS - so it was based on how many frames of a video were watched, Captivate can't resume to a specific frame in a slide...

    Best you could probably do is break up the video across CP slides - maybe average 15 seconds per slide. If the video is not 'Event' but is embedded on the timeline itself, then CP could resume to the last slide, so at worst the viewer repeats the 14 seconds they've already seen.

    Keep completion based on if they've seen all slides or not...

    ?