- What is FlashVars?
- How to use FlashVars for CTAT tutors
- FlashVars Parameters and Values
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:
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.
|question_file||myGraphName.brd||The Behavior Recorder file (a.k.a. graph) to be loaded. This path is relative to the HTML document.|
|media_file||c.flv||The 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|
|TutorCuePointName||TutorCuePoint||The name of the cue point. The video pauses at this time. Used by the video component, CommAudioVideo.|
|TutorCuePointTime||5||The time of the cue point in seconds. The video pauses at this time. Used by the video component, CommAudioVideo.|
|BehaviorRecorderMode||RunTime||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.|
|MediaPath||The path to media files (MP3, JPG, etc) used in the problem. Used by Jumble, MediaMultipleSelection, and MultipleSelection. Relative to the HTML document.|
|VideoPath||The path to FLV (Flash Video) files used in the problem. Relative to the Flash movie (SWF).|
|RandomizeAnswers||Used by Jumble. Can be true or false. When true, the order of answer items will be random.|
|study_name||The name of the study. Used by TutorShop and inserted by the TutorShop servlet.|
|curriculum_service_url||Used by TutorShop and inserted by the TutorShop servlet.|
|log_service_url||http://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_name||myProblemName||The 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_name||mySubjectMatter_Arithmetic||The course or curriculum name to appear in logs. When stored in PSLC DataShop, this becomes the dataset name.|
|unit_name||myUnitName__Fractions||The unit name, related to the course.|
|section_name||mySectionName__Addition||The section name, related to the course.|
|user_guid||myUniqueUserIdentifier||A 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_name||CMU||The name that identifies the university or school.|
|session_id||mySessionID||A unique session id. If using the OLI course delivery system, OLI supplies this.|
|auth_token||myAuth_token||A unique authorization token. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.|
|container_id||myContainer||A unique ID. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.|
|source_id||PACT_CTAT_FLASH||The name of the tutor source. Can be changed to identify your project.|
|external_object_id||myExternalId||A unique object id. If using the OLI course delivery system, OLI supplies this; otherwise, it's not required.|
|LoggingLibraryPath||CommLoggingLibrary.swf||The path to the logging library SWF. Required for logging to an OLI log server. Relative to the HTML document.|
|DeliverUsingOLI||false||Set 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.
|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_disk||true||Whether or not to log to disk.|