Skip to content

Instantly share code, notes, and snippets.

Philip Hutchison pipwerks

Block or report user

Report or block pipwerks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pipwerks
pipwerks / scorm_support.js
Created Jan 14, 2012
Captivate SCORM 2004 Output, preventing redundant GetLastError calls
View scorm_support.js
/*global CaptivateSWF */
var SCORM_API = null,
unloaded = false,
isInitialized = false,
isTerminated = false,
courseStatus,
value_store = [],
lastCommand,
setValueWasSuccessful = true;
@pipwerks
pipwerks / captivate.js
Created Jan 14, 2012
Captivate SCORM 2004 Output, improved SCORM handling
View captivate.js
/*global swfobject, SCORM_API, initializeSCORM */
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var strURLFile = "sample.swf", // Name of the flash file
flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
CaptivateSWF; //Cache the reference to the SWF to avoid future lookups
@pipwerks
pipwerks / log.txt
Created Jan 14, 2012
Captivate SCORM 2004 Course -- logged calls to Captivate_DoExternalInterface
View log.txt
Captivate_DoExternalInterface: Initialize, , ''
Captivate_DoExternalInterface: GetValue, cmi.entry, ''
Captivate_DoExternalInterface: GetLastError, , ''
Captivate_DoExternalInterface: SetValue, cmi.exit, suspend
cmi.exit(suspend) is not cached. Sending to LMS.
Captivate_DoExternalInterface: GetLastError, , ''
Captivate_DoExternalInterface: GetValue, cmi.location, ''
Captivate_DoExternalInterface: GetLastError, , ''
Captivate_DoExternalInterface: GetErrorString, 403, ''
Captivate_DoExternalInterface: GetValue, cmi.score._children, ''
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, replaced unload handler
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var strURLFile = "sample.swf", // Name of the flash file
flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
CaptivateSWF; //Cache the reference to the SWF to avoid future lookups
function callbackFn(e){
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, replaced findAPI and getAPI code
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var strURLFile = "sample.swf", // Name of the flash file
flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
CaptivateSWF; //Cache the reference to the SWF to avoid future lookups
function callbackFn(e){
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, removed getAPI timer, only embed SWF if API found
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var strURLFile = "sample.swf", // Name of the flash file
flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
CaptivateSWF; //Cache the reference to the SWF to avoid future lookups
function callbackFn(e){
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, cleaned up Captivate_DoExternalInterface
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var strURLFile = "sample.swf", // Name of the flash file
flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
CaptivateSWF; //Cache the reference to the SWF to avoid future lookups
function callbackFn(e){
@pipwerks
pipwerks / scorm_support.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, removed non-ExternalInterface communication code
View scorm_support.js
var g_objAPI = null,
g_nAPI = 0, // type of API to start searching for; allowable values: 0 - SCORM 2004; 1 - SCORM 1.2 (or 1.1)
g_aAPI = ["1.0", "0.2"], // Array that stores the API versions
g_zAPIVersion = -1,
g_bFinishDone = false,
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLParams = "";
timeCurrent_int = new Date().getTime(),
timeLimit_int = new Date().getTime() + (intIntervalSecs * 1000);
@pipwerks
pipwerks / launch log
Created Jan 13, 2012
Console.log results for simple Captivate SCORM 2004 course
View launch log
Captivate_DoFSCommand invoked: cpSlideLoaded sample.htm:75
Captivate_DoFSCommand invoked: cpSlideChanged
Captivate_DoExternalInterface invoked: Initialize sample.htm:134
Captivate_DoExternalInterface invoked: GetValue sample.htm:134
Captivate_DoExternalInterface invoked: GetLastError sample.htm:134
Captivate_DoExternalInterface invoked: SetValue sample.htm:134
Captivate_DoExternalInterface invoked: GetLastError sample.htm:134
Captivate_DoExternalInterface invoked: GetValue sample.htm:134
Captivate_DoExternalInterface invoked: GetLastError sample.htm:134
Captivate_DoExternalInterface invoked: GetErrorString sample.htm:134
@pipwerks
pipwerks / scorm_support.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, begin cleanup of scorm_support.js
View scorm_support.js
var g_objAPI = null,
g_nAPI = 0, // type of API to start searching for; allowable values: 0 - SCORM 2004; 1 - SCORM 1.2 (or 1.1)
g_aAPI = ["1.0", "0.2"], // Array that stores the API versions
g_zAPIVersion = -1,
g_bFinishDone = false,
g_intAPIType = 0, // Specifies SCORM 2004
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLParams = "";
You can’t perform that action at this time.