pipwerks SCORM Wrappers now available on GitHub

I’ve been considering adding my pipwerks SCORM wrappers to GitHub for a very long time, but my n00bness and general lack of free time were major obstacles. However, the time has finally come to buckle down and get these puppies OUT! So without further ado, I present:

https://github.com/pipwerks/scorm-api-wrapper

I should note that these are my original SCORM wrappers (JavaScript, ActionScript 2 and ActionScript 3); I’ve been (very slowly) working on a completely new SCORM support codebase that I plan to release separately. However, these oldies are still running like a champ, so don’t be afraid to use them.

Many people have contacted me over the last few years with suggestions for improvements, but due to my general busy-ness I haven’t really made any modifications for a long time; I recently made a few small tweaks, including updating the StringToBoolean function that caused problems in Plateau, but the bulk of the code remains largely the same.

If you’re one of those die-hards eager to tweak the source code, you’re in luck! This is a public repository, which means anyone and everyone is now free to fork and edit the code as they see fit. If you have any suggestions or ideas, please go to GitHub and show us what ya got!

And for the curious, I’m using Tower to handle my Git commits — command lines are not my cup of tea. Tower is a very nice Git GUI that integrates seamlessly with GitHub. I’m new to Tower, but so far I like it very much.

Advertisements

Complete List of Variables for Adobe Captivate 5

While updating my CaptivateController script I noticed there have been some changes to the Captivate variables available to Captivate developers. I figured I should document them for future reference.

Note that some variables available in CP3 and CP4 are no longer available. The following list should be exhaustive for CP5; variables for previous versions of Captivate have been purposely left off this list. I also purposely left off some publicly accessible (but useless) movieclips and objects.

While most people seem to focus on using Captivate variables natively within a Captivate project via the Variables menu or widgets, my focus has been figuring out how accessible/usable they are via JavaScript. Thus you may find small differences between my list and other people’s lists, and differing opinions regarding the usefulness of some variables and publicly accessible movieclips. Regardless, the items below should be accessible via every method: widgets, JavaScript, and the native Variables support in Adobe Captivate.

If you know of any variables that I missed, please leave a comment. Thanks!

Update: Kurt Melander has kindly converted this list to PDF format if you’d like to download or print it. Thanks, Kurt.

Variable Type Description

CPMovieType

[number] Informational variable. Indicates whether the queried SWF is a skin SWF (0) or the main content SWF (1).
CaptivateVersion [string] Informational variable. Indicates the version of Adobe Captivate that published the SWF
DoNotRegisterRightClickBecauseOfAggregator [boolean] Internal variable, no information available
LocalConnectionInUse [boolean] Internal variable, no information available
NoOfTOCEntries [number] Informational variable. Returns the number of items contained in the project’s Table of Contents

PlaybarProperties

[string]
in Chrome

[XML] in Firefox

Internal variable, no information available.

NOTE: This item is
:XML data type in AS3. Because browsers have different support for native XML data types, values returned from this variable should not be considered cross-browser. Use at your own risk.

__loadbase [string]

Informational variable. Returns project’s root file path.

NOTE: This value can only be obtained when the project uses an external skin.

contentHeight [number] Informational variable. Returns the height of the Captivate main SWF (in pixels)
contentLeft [number] Informational variable. Returns the distance of the Captivate main SWF from the leftmost edge of the project (in pixels).
contentSWF [string]

Informational variable. Returns the file name for the project’s main SWF.

NOTE: This value can only be obtained when the project uses an external skin.

contentTop [number] Informational variable. Returns the distance of the Captivate main SWF from the topmost edge of the project (in pixels).
contentWidth [number] Informational variable. Returns the width of the Captivate main SWF (in pixels)
cpAutoPlay [boolean] Informational variable. Indicates whether the project is set to auto-play.
cpCaptivateSkinSWF [boolean]

Informational variable. Indicates whether the SWF is a skin SWF or primary project SWF.

NOTE: This value can only be obtained when the project uses an external skin.

cpCmndCC [number] Command variable. Setting to 1 will enable captioning. Setting to 0 will disable captioning.
cpCmndFastForward [number] Command variable. Setting to 1 will fast-forward the movie (play the movie at a higher framerate). Setting to 0 will return the movie to the normal playback speed.
cpCmndGotoFrameAndResume [number]

Command variable. Will cause the movie to jump to the specified frame and resume playing (frame numbering begins at 0).

Note: frames are not the same as slides.

cpCmndGotoSlide [number]

Command variable. Will cause the movie to jump to the specified slide (slide numbering starts at 0).

Note: frames are not the same as slides.

cpCmndMute [boolean] Command variable. Setting to 1 will disable (mute) the audio. Setting to 0 will restore it to normal.
cpCmndNext [number] Command variable. Setting to 1 will cause the movie to jump to the next slide. Setting to 0 will do nothing.
cpCmndPlaybarMoved [boolean] Command variable. Internal variable. According to Captivate documentation, "Set to 1 if the playbar has moved."
cpCmndShowPlaybar [number] Command variable. Setting to 1 will cause the movie’s playbar to appear. Setting to 0 will make the palybar disappear.
cpCmndVolume [number] Command variable. Setting to a number will cause the volume to change. The volume ranges from 0 (muted) to 100 (maximum volume).
cpContentLoadStart [boolean]

Informational variable. Indicates whether the main project SWF has started.

NOTE: This value can only be obtained when the project uses an external skin.

cpContentLoaded [boolean]

Informational variable. Indicates whether the main project SWF has loaded.

NOTE: This value can only be obtained when the project uses an external skin.

cpContentPositioned Internal variable. No information available.
cpContentScaled Internal variable. No information available.
cpHasSkinSWF [boolean] Informational variable. Indicates whether the Captivate project uses an external skin.
cpInfoAuthor [string] Informational variable. Returns the project author’s name, as entered in the movie’s properties before publishing.
cpInfoCompany [string] Informational variable. Returns the project company’s name, as entered in the movie’s properties before publishing.
cpInfoCopyright [number] Informational variable. Returns the project’s copyright notice, as entered in the movie’s properties before publishing.
cpInfoCourseID [number] Informational variable. Returns the project’s course ID, as entered in the movie’s properties before publishing.
cpInfoCourseName [string] Informational variable. Returns the project’s course name, as entered in the movie’s properties before publishing.
cpInfoCurrentDate [string] Informational variable. Returns the day portion of the current date.
cpInfoCurrentDateString [string] Informational variable. Returns today’s date (US English format).
cpInfoCurrentDay [string] Informational variable. Returns number indicating day of week (1 = Sunday, 2 = Monday, etc.)
cpInfoCurrentHour [string] Informational variable. Returns the current hour (24 hour clock format).
cpInfoCurrentMinutes [string] Informational variable. Returns the minutes portion of the current time.
cpInfoCurrentMonth [string] Informational variable. Returns the month portion of the current date.
cpInfoCurrentSlide [number] Informational variable. Returns the current slide number. (Uses 1-based index)
cpInfoCurrentSlideLabel [string] Informational variable. Returns the slide label for the current slide, if available.
cpInfoCurrentSlideType [string] Informational variable. Returns the slide type for the current slide.
cpInfoCurrentTime [string] Informational variable. Returns the current time, including seconds (24 hour clock format).
cpInfoCurrentYear [string] Informational variable. Returns the year portion of the current date.
cpInfoDescription [string] Informational variable. Returns the project’s description, as entered in the movie’s properties before publishing.
cpInfoElapsedTimeMS [number] Informational variable. Returns the amount of time (in milliseconds) that has elapsed since the project began playing.
cpInfoEmail [string] Informational variable. Returns the project author’s e-mail address, as entered in the movie’s properties before publishing.
cpInfoEpochMS [number] Informational variable. Returns the current time elapsed (in milliseconds) since January 01, 1970.
cpInfoHasPlaybar [number] Informational variable. Indcates whether the Captivate movie has a playbar. 1=true, 0=false
cpInfoIsStandalone [number] Informational variable. Indicates whether Captivate project is en .exe or .app file (1) or standard SWF (0).
cpInfoLastVisitedSlide [number] Informational variable. Returns the last visited slide number. (Unlike cpInfoCurrentSlide, this variable uses 0-based index)
cpInfoPercentage [number] Informational variable. Returns the current score as a percentage (if available).
cpInfoPrevSlide [number] Informational variable. Returns the number of the slide before the current slide. (Uses 1-based index)
cpInfoProjectName [string] Informational variable. Returns the project’s name, as entered in the movie’s properties before publishing.
cpInfoWebsite [string] Informational variable. Returns the project’s web addess, as entered in the movie’s properties before publishing.
cpLockTOC [number] Command variable. Setting to 1 disables user interaction on the Table of Contents. Setting to 0 re-enables (unlocks) user interaction.
cpMovieHeight [number] Informational variable. Returns the height of the Captivate project, in pixels.
cpMovieWidth [number] Informational variable. Returns the width of the Captivate project, in pixels.
cpMovieXForEmbededPlaybar [number] Informational variable. Returns the x coordinate (left position) of the Captivate project’s toolbar, if available.
cpMovieXForTOC [number] Informational variable. Returns the x coordinate (left position) of the Captivate project’s Table of Contents movieclip, if available.
cpMovieYForEmbededPlaybar [number] Informational variable. Returns the y coordinate (top position) of the Captivate project’s toolbar, if available.
cpMovieYForTOC [number] Informational variable. Returns the y coordinate (top position) of the Captivate project’s Table of Contents movieclip, if available.
cpOrgSWFPath [string]

Informational variable. Provides the file name for the project’s main SWF. Appears to duplicate functionality of cpOrgSWFPath.

NOTE: This value can only be obtained when the project uses an external skin.

cpQuizInfoAnswerChoice [string] Informational variable. Returns the chosen answer for the quiz question.
cpQuizInfoAttempts [number] Informational variable. Returns the number of times the quiz has been attempted.
cpQuizInfoLastSlidePointScored [number] Informational variable. Returns the score for the last visited quiz slide.
cpQuizInfoMaxAttemptsOnCurrentQuestion [number] Informational variable. Returns the number of attempts allowed for this quiz question.
cpQuizInfoNoQuestionsPerQuiz Informational variable. No information available. Best guess: returns the number of questions in the quiz.
cpQuizInfoPassFail [number] Informational variable. Returns the result of the quiz: pass or fail.
cpQuizInfoPointsPerQuestionSlide [number] Informational variable. Returns the number of points for this quiz question.
cpQuizInfoPointsscored [number] Informational variable. Returns the total number of points scored in the project.
cpQuizInfoQuestionSlideTiming [number] Informational variable. Returns the time limit for the current question (in seconds).
cpQuizInfoQuestionSlideType [string] Informational variable. Returns the current question’s type (multiple-choice, true-false, likert, etc.).
cpQuizInfoQuizPassPercent [number] Informational variable. Returns the passing percentage for the quiz.
cpQuizInfoQuizPassPoints [number] Informational variable. Returns the passing points for the quiz.
cpQuizInfoTotalCorrectAnswers [number] Informational variable. Returns the number of correctly answered quiz questions.
cpQuizInfoTotalProjectPoints [number] Informational variable. Returns the total number of points for the project.
cpQuizInfoTotalQuestionsPerProject [number] Informational variable. Returns the total number of questions for the project.
cpQuizInfoTotalQuizPoints [number] Informational variable. Returns the total number of quiz points for the project.
cpQuizInfoTotalUnansweredQuestions [number] Informational variable. Returns the total number of unanswered questions for the project.
endSwfAction [number] Internal variable. No information available.
expired [boolean] Internal variable. No information available. Best guess: Boolean indicating whether time limit has elapsed.
hasProjectFadeOut [boolean] Internal variable. No information available. Best guess: Boolean indicating whether last slide in project is set to fade out.
inAutoPlayState [boolean] Internal variable. No information available. Best guess: Boolean indicating whether project is set to auto-play.
isCPMovie [boolean] Informational variable. Indicates whether the SWF is a Captivate SWF.
isContiniousModeRecording [number] Internal variable. No information available. (Yes, that’s how it was spelled in the code.)
isCustomizable [boolean]

Internal variable. No information available. Best guess: Indicates whether the skin is customizable.

NOTE: This value can only be obtained when the project uses an external skin.

isForceMuteAudio [boolean] Internal variable. No information available. Best guess: Indicates whether the audio was muted by the user.
isPlayBarBtnClicked [boolean] Internal variable. No information available. Best guess: Indicates whether a specific action was performed via clicking the playbar (such as muting audio).
isPreview [number] Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).
isPreviewForAudioDialog [boolean] Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).
isPreviewSkin [boolean] Internal variable. No information available. Best guess: Indicates whether the project SWF’s skin is a preview SWF (used when previewing projects within the Captivate authoring environment).
lmsString [string] Internal variable. No information available. Best guess: The text displayed when Captivate initializes an LMS connection (SCORM, AICC, etc.).
loadedFromAggregator [boolean] Internal variable. No information available. Best guess: Indicates whether the Captivate SWF was loaded as part of an aggregator project.
m_quizPoolColl [object] Internal variable. No information available. Best guess: Object containing question pool questions.
movieQuality [string] Internal variable. No information available. Best guess: Indicates quality setting of SWF playback.

movieXML

[string] in Chrome

[XML] in Firefox

Internal variable, no information available.

NOTE: This item is
:XML data type in AS3. Because browsers have different support for native XML data types, values returned from this variable should not be considered cross-browser. Use at your own risk.

needToMuteAudioForAggregator [boolean]

Internal variable. No information available.

NOTE: This value can only be obtained when the project uses an external skin.

passwordPresent [boolean] Internal variable. Indicates whether a password has been supplied.
pbcBtnTips [object] Internal variable. Alias for pbcBtnTips_ENU.
pbcBtnTips_ENU [object] Internal variable (array). Returns list of tooltips used by the playbar buttons.
playbarBarAlign [number]

Internal variable. No information available.

NOTE: This value can only be obtained when the project uses an external skin.

playbarHeight [number] Informational variable. Returns height of playbar, in pixels.
playbarPosition [number]

Internal variable. No information available.

NOTE: This value can only be obtained when the project uses an external skin.

rdIsInLivePreviewMode [boolean] Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).
rdIsPreview [boolean] Internal variable. No information available. Best guess: Deprecated variable replaced by isPreview
rdIsPreviewInBrowser [boolean] Internal variable. No information available.
rdIsStandalone [boolean] Internal variable. No information available. Best guess: Deprecated variable replaced by cpInfoIsStandalone
rdcmndCC [number] Command variable (deprecated). Alias for cpCmndCC.
rdcmndExit [number] Command variable. According to Captivate documentation, "Exit the movie. Set to 1 to exit." Has never worked for me.
rdcmndGotoFrame [number] Command variable (deprecated). Alias for cpCmndGotoFrame.
rdcmndGotoFrameAndResume [number] Command variable (deprecated). Alias for cpCmndGotoFrameAndResume.
rdcmndGotoSlide [number] Command variable (deprecated). Alias for cpCmndGotoSlide.
rdcmndMute [boolean] Command variable (deprecated). Alias for cpCmndMute.
rdcmndNext [boolean] Command variable (deprecated). Alias for cpCmndNext.
rdcmndNextSlide [number] Command variable (deprecated). Alias for cpCmndNext.
rdcmndPause [number] Command variable. Setting to 1 will cause the movie to stop playing (pause). Setting to 0 will do nothing.
rdcmndPlaybarMoved [boolean] Command variable (deprecated). Alias for cpCmndPlaybarMoved.
rdcmndPrevious [number] Command variable. Setting to 1 will cause the movie to stop playing (pause). Setting to 0 will do nothing.
rdcmndResume [number] Command variable. Setting to 1 will cause the movie to go backwards to the previous slide. Setting to 0 will do nothing.
rdinfoCurrentFrame [number] Informational variable. Returns current frame number using 0-based index.
rdinfoCurrentSlide [number] Informational variable (deprecated). Alias for cpInfoCurrentSlide.
rdinfoCurrentSlideInProject [number] Informational variable. No information available. Best guess: Alias for cpInfoCurrentSlide.
rdinfoFPS [number] Informational variable. Returns the SWF’s frame rate (in seconds).
rdinfoFrameCount [number] Informational variable. Returns the number of frames in the SWF.
rdinfoHasPlaybar [boolean] Informational variable (deprecated). Alias for cpInfoHasPlaybar.
rdinfoSlideCount [number] Informational variable. Returns the number of slides in the Captivate movie.
rdinfoSlidesInProject [number] Informational variable. No information available. Best guess: An unused/deprecated variable.
rdinfocurrFrame [number] Informational variable. No information available. Best guess: Alias for rdinfoCurrentFrame.
skinHeight [number]

Internal variable. No information available.

NOTE: This value can only be obtained when the project uses an external skin.

skinWidth [number]

Internal variable. No information available.

NOTE: This value can only be obtained when the project uses an external skin.

swfCmtAutoPlay [boolean] Internal variable. No information available. Best guess: Indicates whether the SWF will auto-play when in commenting mode.
swfCommenting [boolean] Internal variable. No information available. Best guess: Indicates whether the SWF is in commenting mode.
tocInitDone [boolean] Internal variable. Indicates when the Table of Contents has finished initializing.
waitCount [number] Internal variable. Indicates how long the SWF has been waiting (used for internal timer-related functions).

CaptivateController Updated to Support Adobe Captivate 5

By popular demand, I’ve updated my CaptivateController to work with Adobe Captivate 5 (CP5). Since this is an open-source project, there’s no upgrade fee. (What? “Adobe” and “no upgrade fee” in the same paragraph?!) I kid, I kid… I’m a kidder.

As you may have heard, Adobe Captivate 5 is a complete re-write of the Adobe Captivate application. As such, there are a few significant changes under-the-hood. For example, Adobe Captivate 5 does not support ActionScript 2, and will only publish to ActionScript 3. The Captivate developers eliminated a few of the old system variables while adding a few new ones. Showing and hiding the playbar now works very reliably (yay!). Most notably, the developers added extra ExternalInterface support via the cpEIGetValue and cpEISetValue callback functions while eliminating the cpSetValue callback, which explains why the previous version of the CaptivateController didn’t work with CP5 SWFs.

As for the updated CaptivateController, it works the same as the previous version. Most of the changes were under-the-hood, so you shouldn’t need to edit any of your code, and should be able to drop this new version on top of your old one. No system restart required!

If you encounter any bugs, please let me know by posting in the comments. I’d also be happy to hear any success stories you may have.

Captivate 4 variables gone wild

Update (August 2010): I have published a new list of Captivate variables that are specific to Adobe Captivate 5. Check it out.

The folks at Adobe recently published a list of Captivate 4 variables. While it’s a solid list, it’s not really a complete list.

Here is a list of variables I dug up while combing through Captivate 4’s source AS files. I tried to add descriptions where I could, and will continue to revise this list as I get more information. Kudos to Michael at www.cpguru.com for posting his helpful list, too.

Notes:

  • I’ve tested each of these variables in JavaScript to ensure they exist and are accessible, and have weeded out variables that return errors.
  • I’ve also included Captivate 3 variables at the bottom of this page.

Update: Kurt Melander was kind enough to clean up this list and convert it to PDF format for those who’d like to print it out. Download PDF version.

Captivate 4 Variables

Functional variables (perform an action)

Variable Returns Default values Description (if available)
cpAutoPlay boolean true Toggles auto-play on (true) or off (false). Movie auto-plays by default.
cpCmndCC number 0 Toggles closed captioning on (1) or off (0). Replaces rdcmndCC.
cpCmndFastForward number 0 Setting to 1 increases speed of playback.
cpCmndGotoFrameAndResume number -1 Jumps to the specified frame number (NOT slide number) and resumes playback.

Replaces rdcmndGotoFrameAndResume.

cpCmndMute boolean false Toggles audio. Setting to true mutes the audio, setting to false unmutes the audio.

Replaces rdcmndMute.

cpCmndNext number 0 Setting value to 1 will jump to the next slide in project.

Replaces rdcmndNext

cpCmndShowPlaybar number 1 Toggles playbar visibility. Setting to 0 will hide the playbar, setting to 1 will restore it.

Replaces rdcmndHidePlaybar.

cpCmndVolume number 100 Sets audio volume (if applicable). Range is 0-100, where 0 is off and 100 is full volume. Querying cpCmndVolume will return the current volume level.
rdcmndGotoSlide number -1 Jumps to the specified slide number. Takes slide number (0-based index) as argument.
rdcmndPlaybarMoved boolean false

Informational variables (retrieve or set data)

Variable Returns Sample values Description (if available)
CaptivateVersion string 4.0.0 Returns version of Captivate that published the SWF.
cpCmndPlaybarMoved boolean false Replaces rdcmndPlaybarMoved.
cpHasSkinSWF boolean false Returns boolean indicating whether the movie is using a SWF-based skin.
cpInfoAuthor string Philip Hutchison Returns the project author’s name, if available.
cpInfoCompany string pipwerks Returns the project company’s name, if available.
cpInfoCopyright number 2009 Returns the project’s copyright notice, if available.
cpInfoCurrentDate string 11 Returns the day of the month using the client’s system clock.

String(now.getDate())

cpInfoCurrentDateString string 5/11/2009 Returns the calendar date in mm/dd/yyyy format using the client’s system clock.

Returns (now.getMonth() + 1 + “/” + now.getDate() + “/” + now.getFullYear());

cpInfoCurrentDay string 2 Returns the numerical day of the week using the client’s system clock (Sunday is day 1).

Returns String(now.getDay()+ 1);

cpInfoCurrentHour string 19 Returns the current hour using the client’s system clock.

Returns String(now.getHours());

cpInfoCurrentMinutes string 59 Returns the current minute using the client’s system clock.

Returns String(now.getMinutes());

cpInfoCurrentMonth string 5 Returns the numerical month using the client’s system clock (January is 1).

Returns String(now.getMonth() + 1);

cpInfoCurrentSlide number 1 Returns the current slide number. Unlike rdinfoCurrentSlide, cpInfoCurrentSlide uses 1-based indexing, so slide 1 of the project will return 1.

Returns (rdinfoCurrentSlide + 1);

cpInfoCurrentSlideLabel string SlideLabel:0 Returns the label of the slide, if available.
cpInfoCurrentSlideType string NormalSlide Returns a string indicating the current slide’s type. There are currently three possible results: “NormalSlide”, “QuestionSlide”, and “RandomQuestionSlide”
cpInfoCurrentTime string 19:59:27 Returns the current time in HH:MM:SS format using the client’s system clock. Note: uses 24-hour clock.

Returns (now.getHours() + “:” + now.getMinutes() + “:” + now.getSeconds());

cpInfoCurrentYear string 2009 Returns the current year in YYYY format using the client’s system clock.

Returns String(now.getFullYear());

cpInfoDescription string This demonstration will teach you the… Returns the project description, if available.
cpInfoElapsedTimeMS number 1537 Returns the amount of time (in milliseconds) that has elapsed since the movie began playing.

Returns (cpInfoEpochMS – movie.m_StartTime)

cpInfoEmail string hello@world.org Returns the project author’s email address, if available.
cpInfoEpochMS number 1242097167686 Per Adobe [link no longer available]: “returns the number of milliseconds since midnight January 1, 1970, universal time, for the specified Date object. Use this method to represent a specific instant in time when comparing two or more Date objects.”

Returns now.getTime();

cpInfoHasPlaybar number 1 Returns a boolean (in number format) indicating whether the Captivate file was published with playback controls (a playbar).
cpInfoIsStandalone number 0
cpInfoLastVisitedSlide number 0 Returns the index number of the last visited slide. Uses zero-based numbering (0 = slide 1, 1 = slide 2).
cpInfoPercentage number 0
cpInfoPrevSlide number -1 Returns the index number of the slide that comes before the current slide. Uses zero-based numbering (0 = slide 1, 1 = slide 2).
cpInfoProjectName string CaptivateController Returns the project name, if available.
cpInfoWebsite string www.pipwerks.com Returns the website listed in the project properties, if available.
cpMovieHeight number 432 Returns the movie’s original height, regardless of how it has been sized via HTML or CSS.
CPMovieType number 1
cpMovieWidth number 551 Returns the movie’s original width, regardless of how it has been sized via HTML or CSS.
cpQuizInfoAnswerChoice string
cpQuizInfoAttempts number 1
cpQuizInfoLastSlidePointScored number 0
cpQuizInfoMaxAttemptsOnCurrentQuestion number 0
cpQuizInfoNoQuestionsPerQuiz number 0
cpQuizInfoPointsPerQuestionSlide number 0
cpQuizInfoPointsscored number 0
cpQuizInfoQuestionSlideTiming number 0
cpQuizInfoQuestionSlideType string choice
cpQuizInfoQuizPassPercent number 0
cpQuizInfoQuizPassPoints number 0
cpQuizInfoTotalCorrectAnswers number 0
cpQuizInfoTotalProjectPoints number 0
cpQuizInfoTotalQuestionsPerProject number 0
cpQuizInfoTotalQuizPoints number 0
cpQuizInfoTotalUnansweredQuestions number 0
inAutoPlayState boolean false
isCPMovie boolean true Returns a boolean indicating whether this movie was published using Adobe Captivate.
isPreview number 0 Returns a boolean (in number format) indicating whether this is a preview. Primarily used internally by Captivate when previewing a project. Replaces rdIsPreview.
isPreviewSkin number 0 Returns a boolean (in number format) indicating whether this is a skin for a preview. Primarily used internally by Captivate when previewing a project.
loadedFromAggregator boolean false Returns a boolean indicating whether the SWF has been loaded by Captivate’s aggregator.
LocalConnectionInUse boolean false Returns a boolean indicating whether the movie is using LocalConnection. This is primarily used internally by Captivate.
NoOfTOCEntries number -1 Returns a count of entries in the Table of Contents, if available.
pbcBtnTips object [array] Rewind, Back, Play,
Pause, Forward,
Closed Captioning,
Audio On, Audio Off,
Exit, Information,
Dummy for slider,
Table Of Contents,
2x Fast Forward Speed,
4x Fast Forward Speed,
Normal Speed, Print
Returns the label values used in the playback controller’s tool tips.
playbarHeight number 31 Returns the height of the playbar in pixels, if applicable.
playbarPosition number 3 Returns the position of the playbar in pixels, if applicable.
rdIsPreview boolean false Deprecated. Replaced by isPreview.
rdinfoCurrentFrame number 41 Returns the number of the current frame (NOT slide), counting from the beginning of the movie’s timeline.
rdinfoCurrentSlide number 0 Deprecated. Replaced by cpInfoCurrentSlide.
rdinfoCurrentSlideInProject number 0
rdinfoFPS number 30 Returns the SWF’s frames per second rate.
rdinfoFrameCount number 90 Returns the number of frames in the entire SWF.
rdinfoSlideCount number 1
rdinfoSlidesInProject number 1 Returns the number of slides in the project.
rdinfocurrFrame number 2
swfCmtAutoPlay boolean false Returns boolean indicating whether SWF commenting auto-play is enabled. This is only used by the SWF Commenting AIR application.
swfCommenting boolean false Returns boolean indicating whether SWF commenting auto-play is enabled. This is only used by the SWF Commenting AIR application.
tocInitDone boolean true Returns boolean indicating whether the Table of Contents has finished initializing.

Captivate 3 Variables

Functional variables (perform an action)

Variable Returns Default values Description (if available)
rdcmndCC string 0 Toggles closed captioning on (1) or off (0).
rdcmndGotoSlide string -1 Jumps to the specified slide number. Takes slide number (0-based index) as argument.
rdcmndMute string 0 Toggles audio. Setting to 1 mutes the audio, setting to 0 unmutes the audio.
rdcmndNext string 0 Setting value to 1 will jump to the next slide in project.
rdcmndHidePlaybar string 0 Toggles playbar’s visibility

Informational variables (retrieve or set data)

Variable Returns Sample values Description (if available)
CaptivateVersion string 2.0.0 Returns version of Captivate that published the SWF.
rdIsPreview string 0 Returns a boolean (in number format) indicating whether this is a preview. Primarily used internally by Captivate when previewing a project.
rdinfoCurrentFrame string 1 Returns the number of the current frame (NOT slide), counting from the beginning of the movie’s timeline.
rdinfoCurrentSlide string 1 Returns the current slide number using zero-based indexing (slide 1 of the project will return 0).
rdinfoCurrentSlideInProject string 1
rdinfoFPS string 24 Returns the SWF’s frames per second rate.
rdinfoFrameCount string 2889 Returns the number of frames in the entire SWF.
rdinfoHasPlaybar string 1 Returns a boolean (in number format) indicating whether the Captivate file was published with playback controls (a playbar).
rdinfoSlideCount string 13
rdinfoSlidesInProject string 13 Returns the number of slides in the project.
rdinfocurrFrame string 0
rdcmndPlaybarMoved string 0

LegacyCaptivateLoader example updated

Just a note to point out that I updated the LegacyCaptivateLoader example to use SWFObject 2.1 (dynamic publishing). It has been successfully tested in the following systems:

  • Mac OS X:
    • Firefox 3.0.7
    • Opera 9.6.3
    • Safari 3.2.1
  • Windows XP:
    • Internet Explorer 6
    • Firefox 3.0.6
  • Windows Vista Business:
    • Internet Explorer 7
    • Firefox 3.0.2
    • Opera 9.5.2
    • Safari 3.2.1
  • Windows 7 Experimental
    • Internet Explorer 8 (Beta)

Note: the LegacyCaptivateLoader will probably fail if you embed the SWF using SWFObject 2’s static publishing option, as the nested elements will cause problems for the JavaScript.

ECMAScript vs JavaScript vs ActionScript: Do you know the difference?

If you’re trying to use SCORM in your e-learning, you’ve undoubtedly heard of JavaScript and ActionScript. But do you know the different between ECMAScript, JavaScript, and ActionScript?

Alex Russell has provided definitions for many of the ECMAScript-related names you might be reading about these days, including ECMAScript (3, 3.1, 4), ActionScript 3, Harmony, and JavaScript 2.

Very helpful!

Via Ajaxian.

Unpublished Captivate variables

There is a newer list of variables available, which includes new Captivate 4 variables.

A recent post [link no longer available] in the elearning development forum [link no longer available] reminded me that I forgot to post some unpublished Captivate variables I dug up a while back.

These were gathered from the class file captivate.monalisa.rdMovie.as. Anything marked with a (?) means I don’t know what this variable does. 🙂

For this table, “containerMC” refers to whatever Flash movieclip you’ve loaded the Captivate SWF into.

Variable What it does (or best guess)
Captivate Functions (commands)
containerMC.rdcmndResume = 1; resume()
containerMC.rdcmndPause = 1; pause()
containerMC.rdcmndPrevious = 1; gotoPreviousSlide()
containerMC.rdcmndNextSlide = 1; gotoNextSlide()
containerMC.rdcmndRewindAndStop = 1; rewindAndPause()
containerMC.rdcmndRewindAndPlay = 1; rewindAndPlay()
containerMC.rdcmndExit = 1; exit()
containerMC.rdcmndInfo = 1; showInfo()
containerMC.rdcmndCC = 1; showCC()
containerMC.rdcmndMute = 1; mute()
Captivate Functions (queries)
containerMC.rdinfoFrameCount; getFrameCount() returns number
containerMC.rdinfoSlidesInProject; getSlidesInProject() returns number
containerMC.rdinfoCurrentFrame; getCurrentFrame() returns number
containerMC.rdinfoCurrentSlide; getCurrentSlide() returns number
containerMC.rdinfoSlideCount; getMovieSlideCount() returns number
containerMC.rdinfoHasPlaybar; hasPlaybar() returns boolean
containerMC.rdinfoFPS; getFrameRate() returns number
containerMC.CaptivateVersion; getVersion() returns number (?)
Assorted properties (variables)
containerMC.rdinfocurrFrame; Stores current frame number
containerMC.rdinfostate; “State” of movie (?)
containerMC.rdinfoCurrentSlideInProject; Stores index # of current slide
containerMC.rdinfoCurrentSlide; Stores index # of current slide
containerMC.rdcmndPlaybarMoved Boolean (1 or 0) indicating whether playbar has moved
containerMC.isWaiting() Returns boolean indicating playback state (?)
containerMC.rdIsPreview Returns boolean indicating if SWF is a preview (?)
containerMC.info_mc.playInfo(); (?)
containerMC.m_Sub_mc_array Array containing info for nested MCs (?)
Assorted properties (commands)
containerMC.rdcmndGotoFrame = num; Jumps to specified frame #
containerMC.rdcmndGotoSlide = num; Jumps to specified slide #
containerMC.rdcmndGotoFrameAndResume = num; Jumps to specified frame and resumes play (?)
containerMC.rdcmndNext = 0; Same as next slide, or is next frame (?)
containerMC.endMovieFunction(); Used by Captivate to select appropriate end of movie action
Question pool props
containerMC.m_quizPoolColl[slideInfo.selectedPoolName]; var quizPoolData = …
containerMC.cpQuestionPoolsInitialized; Boolean indicating whether cpQuestionPools is ready

Standard MC props are also available: _width, _height, _xscale, _yscale, etc.

Another unpublished but useful variable is rdcmndHidePlaybar.

You can see the official list of Captivate 3 variables here (page 201 in PDF link), and you can also see Paul’s famous list of Captivate variables here.

How to add basic SCORM code to a Flash movie

Update 10/2011: The Planets example has been updated (almost completely rewritten) and no longer strictly adheres to the steps and screenshots in this tutorial. The general concepts are the same, but the project files have been substantially refined. To prevent confusion about which files to use, I have removed the original project files and replaced them with the updated version. Sorry for any inconvenience, and you’re welcome!

Here’s a quick tutorial for adding basic SCORM functionality to an existing Flash file. This tutorial aims to demonstrate just how easy it can be to add SCORM functionality to an existing Flash movie.

In this tutorial, we’re going to keep things very simple; our SCORM code will only check the LMS for a prior completion, and if no completion is found, will set the course to complete at the appropriate point in the movie.

Here are the work files (ZIP, approx 615KB) if you’d like to add the code yourself while reading the tutorial. The zip file also contains the completed product.

Important note: This tutorial uses ActionScript 3 and SCORM 1.2, but the same principles apply for ActionScript 2 and SCORM 2004

The steps:

  1. Add the SCORM wrapper to the head of the HTML file
  2. Import the SCORM class into the Flash file
  3. Add some variables and create a SCORM instance
  4. Initialize the SCORM connection and check for prior course completion
  5. Add the SCORM completion code
  6. Publish the FLA
  7. Modify the manifest

Step one: Add the SCORM wrapper to the head of the HTML file

Open the index.html file in your HTML editor of choice. Note that we’re NOT using the standard HTML file produced by Flash’s publishing feature. It’s my opinion that the HTML produced by Flash is ugly, bloated, and doesn’t support standards well enough. We’ll roll our own using stripped-down markup, external CSS file for simple styling, and SWFObject for embedding (feel free to use another embedding method if you prefer).

Once you’ve opened the HTML file, add a link to the SCORM wrapper script in the document’s <head>:

<script type="text/javascript" src="SCORM_API_wrapper.js"></script>

Your HTML file should look something like this:

Add a link to the wrapper JavaScript file in your HTML

Update: This screenshot is slightly out-of-date; the SCORM wrapper file no longer includes the version number in the filename, and should just be SCORM_API_wrapper.js

You may want to specify the targeted SCORM version using JavaScript (this can help avoid problems with some LMSs). To do so, simply add the following line of code to the head of the document after the SCORM_API_wrapper.js link:

<script type="text/javascript">pipwerks.SCORM.version = "1.2";</script>

Believe it or not, that’s the only change that needs to be made to the HTML file! Save and close the file.

Update: The JavaScript in the project files has been expanded to include a few other best practices, including using an onunload handler.

Step two: Import the SCORM class into the Flash file

Open the planets.fla file in Flash. Add the SCORM class to the Flash file using an import statement in Frame 1’s frame script:

import fl.controls.Button;
import flash.events.MouseEvent;
import com.pipwerks.SCORM;

The file should look something like this:

Add the import statement

Update: The latest version of the SCORM Wrapper for ActionScript uses a slightly different path than the one in the screenshot: com.pipwerks.SCORM instead of pipwerks.SCORM.

This is a good time to test the FLA to ensure you have the correct file path for the SCORM class (it should be in a folder named com, which is inside a folder named pipwerks; this pipwerks folder should be located in the same folder as the FLA file). To test the FLA, go to Control > Test Movie. If the movie plays without errors, your file paths are ok.

Step three: Add some variables and create a SCORM instance

Declare the following variables in the first frame of your Flash file, after the import statements:

import fl.controls.Button;
import flash.events.MouseEvent;
import com.pipwerks.SCORM;

var lessonStatus:String;
var lmsConnected:Boolean;
var success:Boolean;

Next, you’ll need to create a new SCORM instance using the pipwerks.SCORM class. You can create a new SCORM object using the following code:

import fl.controls.Button;
import flash.events.MouseEvent;
import com.pipwerks.SCORM;

var lessonStatus:String;
var lmsConnected:Boolean;
var success:Boolean;
var scorm:SCORM = new SCORM();

Update: The FLA’s ActionScript has been rewritten and has a slightly different structure than the code presented in the rest of this post, but the same principles apply.

Step four: Initialize the SCORM connection and check for prior course completion

Add a scorm.connect() call, which returns a boolean indicating whether it succeeded or not.

import fl.controls.Button;
import flash.events.MouseEvent;
import pipwerks.SCORM;

var lessonStatus:String;
var lmsConnected:Boolean;
var success:Boolean;
var scorm:SCORM = new SCORM();

lmsConnected = scorm.connect();

If the connection was successful, lmsConnected will evaluate to true. That means we can start requesting data from the LMS. Start by requesting the current completion status.

A few things to note: If the course status is “completed” or “passed”, we won’t need to keep the LMS connection active — we need to be careful not to overwrite the previous completion by accident. So, if the course has already been completed, we’ll just disconnect and call it a day.

If the completion status isn’t “completed” or “passed”, we’ll need to explicitly set the course to “incomplete”.

import fl.controls.Button;
import flash.events.MouseEvent;
import pipwerks.SCORM;

var lessonStatus:String;
var lmsConnected:Boolean;
var success:Boolean;
var scorm:SCORM = new SCORM();

lmsConnected = scorm.connect();

if(lmsConnected){

   lessonStatus = scorm.get("cmi.core.lesson_status");

   if(lessonStatus == "completed"){

      //Course has already been completed.
      scorm.disconnect();

   } else {

      //Must tell LMS course has not been completed yet.
      success = scorm.set("cmi.core.lesson_status", "incomplete");

   }

} else {

   trace("Could not connect to LMS.");

}

Step five: Add the SCORM completion code

Find the appropriate place in your movie to call the completion code. In this example, we’ll call the completion code when all four planets have been visited. There is already a ‘check’ for this condition in the function resetPlanets, so we can just add the code there.

function resetPlanets():void {

if(visitedMercury && visitedVenus && visitedEarth && visitedMars){

   success = scorm.set("cmi.core.lesson_status", "completed");
   scorm.disconnect();
   lmsConnected = false;

   gotoAndPlay("end");

} else {

[ ... ]

Step six: Publish the FLA

Publish the FLA. Be sure to turn OFF the “HTML” option since we’re using our own HTML file. You should also ensure the target Flash version is Flash 9, since the “Planets” movie uses ActionScript 3 and a few filters that are only supported by Flash 9+.

Save and close the FLA.

Step seven: Modify the manifest

All SCORM-based courses require a manifest file (imsmanifest.xml) that contains important metadata about the course. For our example, we’ll simply grab an existing imsmanifest.xml file and update it to match our course.

  1. Open the imsmanifest.xml file
  2. Change the identifier attribute of the manifest element (at the top of the file) to something suitable for this course (no spaces): identifier="MyPlanetsCourse"
  3. Find the organizations element (and organization child element) starting at line 15. Change the “default” and “identifier” attributes to something suitable for your organization. I’ll use “pipwerks”. Be sure to avoid spaces and illegal characters, such as punctuation (other than the underscore _)
  4. Find the two title elements, starting at line 17. Change both of them to something suitable for your course. For this example, I’ll change them both to “Planets!”
  5. You’ll need to list the files used by this course in the resource node. For this example, we need to make sure “href” is set to “index.html”, then we need to list the other files using file elements:
    
    <resource identifier="SCO_Resource_01" type="webcontent" adlcp:scormtype="sco" href="index.html">
       <file href="index.html"/>
       <file href="planets.swf"/>
       <file href="SCORM_API_wrapper.js"/>
       <file href="swfobject.js"/>
    </resource>
    
  6. Save and close the imsmanifest file

Wrap-up

That’s all there is to it! As you can see, adding simple SCORM code is much easier than many people realize. It may seem daunting at first, but in reality all we’ve done here is:

  • Added a little JavaScript to the HTML file
  • Added a few variables and functions to the ActionScript
  • Edited a few IDs and file links in the imsmanifest.xml file

In my opinion, SCORM only becomes difficult if you try and use it to handle a course’s sequencing and navigation, which even SCORM experts are hesitant to do (it’s considered a “broken” feature by many key figures in the industry).

The bottom line is that if your existing FLA is self-sufficient before SCORM comes into the picture — it’s already set up to handle its own navigation internally via ActionScript and already has a mechanism for determining whether the user has ‘finished’ the movie, be it completing an activity or simply reaching the last frame of the SWF — SCORM becomes more of drop-in item, almost an afterthought. It doesn’t need to be a nightmare that scares developers away.

It’s my hope that my SCORM wrapper and ActionScript classes encourage more people to embrace SCORM as a simple, easy way to ensure their course(s) use standards and work in almost any LMS.

Adding SCORM functionality to your existing Flash file

There seems to be a lot of people interested in making their existing Flash movies SCORM-compatible lately; while I know of a few good resources explaining how to use SCORM in a Flash-based e-learning course, I haven’t seen many resources for explaining how to add some simple, bare-bones SCORM code to an existing Flash movie.

What if someone just wants to be able to say “the learner launched the course and watched the whole thing?” In a case like this, SCORM is super-easy to use, especially if you use my SCORM wrapper and ActionScript class (that’s why I wrote them!).

You may be interested to know that I’m currently working on a tutorial explaining how to add the SCORM code. Here’s a teaser: a very simple Flash movie I made using some images from NASA. It’s called PLANETS!


</p> <p>This movie requires Flash Player version 9 or higher.</p> <p>

It’s nothing fancy, just a timeline-based Flash movie with a bit of ActionScript (3.0) for buttons and timeline navigation.

The tutorial will explain how to add the basic SCORM code to the “planets.fla” Flash file and related HTML file, and will also explain how to make very basic edits to an imsmanifest.xml template in preparation for uploading to an LMS.

Hopefully I’ll have time to finish the tutorial this weekend. I’ll keep you posted.

Update: The tutorial is available here

SCORM ActionScript 3 ZIP file fixed

A few people have contacted me to let me know the ZIP file for the SCORM ActionScript 3 example was missing the FLA file.

Whoopsies!

I’ve added the source files back to the FLA. You can download it from the downloads page.

Thanks to everyone for letting me know. I usually work on this stuff at night after I get home from work, so sometimes I get sleepy and mix my files up. 🙂