GithubHelp home page GithubHelp logo

pipwerks / captivate-publishing-templates-redux Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 2.0 133 KB

Replacements for Adobe Captivate's Publishing Templates; cleaned, modernized, with extra functionality

Home Page: http://pipwerks.com/2012/01/11/cleaning-up-adobe-captivates-scorm-publishing-template-part-1-introduction/

JavaScript 100.00%

captivate-publishing-templates-redux's People

Contributors

pipwerks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

captivate-publishing-templates-redux's Issues

slide view completion not honored

This may be more of a captivate functionality issue, not necessarily related to your changes, but no matter what I try, it seems I can't get the slide view completion to be honored. I have a video containing no quizes, and have the following Captivate settings:
-Report Status: Complete/Incomplete
-Report to LMS as: Percent
-Report Data: Slide Views Only, Slide View Completion of 100
-Reporting Level: Report Score

When the video launches, if I take the progress bar and drag it all the way to the last slide and play the last bit, then close, the LMS will report it as completed. I've tried this with CyberU as well as Scorm Cloud. I've also tried the same settings in both scorm 2004 and 1.2.

Any ideas would be greatly appreciated.

cmiCache value store is never updated

This bit (line 66-69 in scorm_support.js) checks the value store but doesn't actually update it with new values:

//If cached value exists, return it
if(typeof value_store[property] !== "undefined"){
    return value_store[property];
}

Line 190 checks if the returned value from the cache matches the value Captivate is trying to set:

if(!cached_value || cached_value !== value){

... but never updates the value store either.

This means that the value store will always contain the first value that was set, which in turn means that:

  1. If e.g. cmi.location is set to "3", then "4", then "4" again, the second "4" won't be caught.
  2. (more serious) If it's set to "3", then "4", then "3", the last value sent to the LMS will be "4" (because the last value Captivate tries to send matches the first value it sent, and so will be ignored).

Easy fix: Move the check for value equality from line 190 to the cmiCache function:

cmiCache = function(property, value){
   var cachedValue;

   //Ensure we have a valid property to work with
   if(typeof property === "undefined"){ return false; }

   //Replace all periods in CMI property names so we don't run into JS errors
   property = property.replace(/\./g,'_');

   cachedValue = value_store[property];

   // ********* CHANGES START HERE ***************
   //If cached value exists and is the same as new value, return it
   if(typeof cachedValue !== "undefined" && cachedValue == value){
       return cachedValue;
   }

   //Otherwise add to - or replace - in cache
   if(typeof value !== "undefined"){
       value_store[property] = value;
   }

   return false;

};

Since we now return false if the values don't match, we don't need the check in Captivate_DoExternalInterface:

if(cached_value === false) { // strict equality - could be an empty string

    strErr = SCORM_API.SetValue(parameter, value);
    setValueWasSuccessful = (strErr === "true");

} else {
    ...

Missing files result in publishing error

Step 4 of the SCORM 2004 instructions (While you're in your SCORM_support folder, delete scorm_support.htm and scorm_support.swf, they won't be used anymore.) results in captivate throwing an error about these files not being present, when publishing the course.

I added them back in and then it published successfully.

Suggestion: Template Method in Default.htm for cpAllSlidesLoaded ExternalInterface Call

Hi Philip,

First, thank you for your amazing work redoing these templates. The console logging and updated features are fantastic improvements. I have one minor suggestion... this is not a bug/issue.

As you probably already know, Captivate has some internal processes that dynamically generate the slides once it's fully loaded by the browser. If a Captivate Developer executes a call to cpCmndGotoSlideAndResume inside the customJavaScript() function, it may or may not work depending if the Captivate swf has finished loading all of the slides.

In the CaptivateMainTimeline.as file, you'll see a call to EI:
ExternalInterface.call("cpAllSlidesLoaded");

Not too many folks know about this call and it would be awesome to have a JS template method they could use similar to the customJavaScript() template method you provided in the Default.htm file(s).

In addition to the cpAllSlidesLoaded, Captivate also calls "cpSlideLoaded" via EI when each slide has loaded. This makes for some pretty interesting possibilities. I'm sure we'll have some more JS goodness in Cp6 with HTML5 support!

Thank you for your awesome effort on this project!

Jim Leichliter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.