Configuring CTAT Flash Tutors with FlashVars

Last updated July 11, 2013

This page is out of date. See the latest Flashvars reference.

What is FlashVars?

FlashVars is a common way to assign variables for a Flash movie from an HTML document. This method is used extensively by CTAT Flash tutors, which are commonly included in HTML pages for viewing over the web (see Delivering CTAT Flash Tutors for instructions on how to generate such an HTML file). When the Flash tutor (ie, the SWF) loads in a browser, it looks for the FlashVars parameter in HTML and, if found, converts the name-value pairs into variables that the Flash tutor can use. This mechanism is not unique to CTAT tutors, and can be used by any Flash movie for initializing data (see Adobe's FlashVars documentation for more information).

CTAT uses the flashvars parameter for a variety of things. These include setting:

  • logging parameters needed to satisfy the OLI logging DTD and the PSLC logging DTD;
  • the path to the logging library (CommLoggingLibrary.swf);
  • the path to the question (.BRD) file; and
  • the path to the video file (.FLV) when using the Video Component.

How to use FlashVars for CTAT tutors

To create flashvars, use the CTAT_FlashPublish template from the Flash IDE to generate a FlashVars stub that you can then modify.

From Adobe's documentation:

The format of [FlashVars] is a set of name=value combinations separated by '&'. Special and/or non-printable characters can be escaped with a '%' followed by a 2 digit hexadecimal value. A single blank space can be represented using the '+' sign.

FlashVars is given in a single string enclosed by double quotes. In HTML, it will look like:

<object ...>
<param name="FlashVars" value="log_service_url=http://www.loggingserver.com&
question_file=media/problemFileName.brd&problem_name=fractionaddition&
..."
</object>

In the above simplified example, the first name=value combination consists of log_service_url for the name, and http://www.loggingserver.com for the value.

FlashVars Parameters and Values

The tables below present a list of FlashVars parameters that are commonly used by CTAT Flash tutors. For a simple, non-logging tutor, only question_file is required.

Table 1. FlashVars parameters - Tutoring
NameDefault ValueDescription
question_filemyGraphName.brdThe Behavior Recorder file (a.k.a. graph) to be loaded. This path is relative to the HTML document.
media_filec.flvThe name and path of the video file that plays. The path is relative to the Flash movie (SWF). The media file should be a .FLV or .MP3 format file
TutorCuePointNameTutorCuePointThe name of the cue point. The video pauses at this time. Used by the video component, CommAudioVideo.
TutorCuePointTime5The time of the cue point in seconds. The video pauses at this time. Used by the video component, CommAudioVideo.
BehaviorRecorderModeRunTime The data mode of the commShell component. This corresponds to the commShell property named BehaviorRecorder. If this parameter is missing from flashvars, the commShell will default to RunTime when in a browser.
MediaPathThe path to media files (MP3, JPG, etc) used in the problem. Used by Jumble, MediaMultipleSelection, and MultipleSelection. Relative to the HTML document.
VideoPathThe path to FLV (Flash Video) files used in the problem. Relative to the Flash movie (SWF).
RandomizeAnswersUsed by Jumble. Can be true or false. When true, the order of answer items will be random.
study_nameThe name of the study. Used by TutorShop and inserted by the TutorShop servlet.
curriculum_service_urlUsed by TutorShop and inserted by the TutorShop servlet.
Table 2. FlashVars parameters - Logging*
NameDefault ValueDescription
log_service_urlhttp://pslc-qa.andrew.cmu.edu/log/server The URL of a web service for logging. The default value is the URL of the Pittsburgh Science of Learning Center (PSLC) Quality Assurance logging service, which should be used for testing. When logging for a PSLC study, log to the LearnLab production machine: http://learnlab.web.cmu.edu/log/server
problem_namemyProblemNameThe name of the problem to appear in logs. Generally, use the same name as the question_file (i.e, the .BRD file name without the BRD extension).
course_namemySubjectMatter_ArithmeticThe course or curriculum name to appear in logs. When stored in PSLC DataShop, this becomes the dataset name.
unit_namemyUnitName__Fractions The unit name, related to the course.
section_namemySectionName__AdditionThe section name, related to the course.
user_guidmyUniqueUserIdentifierA unique user id used for logging. If using the OLI course delivery system, OLI supplies this. If serving outside OLI, consider writing this value in with a server-side scripting language.
school_nameCMUThe name that identifies the university or school.
session_idmySessionIDA unique session id. If using the OLI course delivery system, OLI supplies this.
auth_tokenmyAuth_tokenA unique authorization token. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.
container_idmyContainerA unique ID. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.
source_idPACT_CTAT_FLASHThe name of the tutor source. Can be changed to identify your project.
external_object_idmyExternalIdA unique object id. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.
LoggingLibraryPathCommLoggingLibrary.swfThe path to the logging library SWF. Required for logging to an OLI log server. Relative to the HTML document.
DeliverUsingOLIfalseSet this to false if delivering in a environment outside of the OLI course delivery system. This affects logging. See the LoggingLibrary javadoc for details. If this parameter is missing from flashvars, the commShell will default to OLI.

* OLI-supplied values are inserted by the OLI course delivery system when the XML workbook pages are transformed to HTML.

Table 3. FlashVars parameters - Tutoring Service
NameDefault ValueDescription
disk_log_dir. (a single dot)The path name for the directory in which disk logging files will be stored. If the value is a relative path, it is relative to the value of the Projects dir preference at LauncherServer startup.
log_to_disktrueWhether or not to log to disk.
question_file