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:
- the location of the Tutoring Service
- the path to the behavior graph (.BRD) file
- logging parameters
How to specify FlashVars for CTAT tutors
The way in which you specify flashvars for your tutors depends on the delivery framework you are using.
- TutorShop: flashvars are generated dynamically based on tutor information contained in the TutorShop database
- No delivery application (standalone pages): Use the CTAT_FlashPublish template from the Flash IDE to generate HTML, which contains a FlashVars stub that you can modify.
- Your own application: Use the CTAT_FlashPublish template from the Flash IDE to generate HTML, which contains a FlashVars stub that you can examine for learning the flashvars syntax.
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.
Include as many or as few flashvars as you'd like. Consult the tables below for deciding which parameters to include.
FlashVars Parameters and Values
The tables below present a list of FlashVars parameters that are commonly used by CTAT Flash tutors (ActionScript 3).
Name | Default Value | Description |
---|---|---|
question_file | The path to the behavior graph to load. Can be a relative path (if the BRD is located on the same machine as the Tutoring Service), in which case the path is relative to the Tutoring Service, or a full URL—the BRD does not need to be located on the same machine running the Tutoring Service. | |
BehaviorRecorderMode | AuthorTimeTutoring | The mode of the Flash tutor. Possible values are: AuthorTime (for connecting to the Behavior Recorder) and AuthorTimeTutoring (for connecting to a Tutoring Service). |
remoteSocketURL | localhost | The host name of the machine running the Tutoring Service. If remoteSocketURL is not set in FlashVars, the tutor will use the property from the CommShell. |
remoteSocketPort | 1502 | The port on which the Tutoring Service is listening. |
session_id | Generated by the learner management system (LMS) and used in all log messages. | |
source_id | Possible values are 'FLASH_PSEUDO_TUTOR' or 'CTAT_JAVA_TUTOR'. Used in all log messages. | |
collaborators | a comma separated list of user ids of one collaborating team. See the user_guid flashvar in the logging table below. When the collaborators flashvar is specified and when a group of user ids is present, the tutoring service will wait until all users are connected before starting any collaboration. From that point all tutored and untutored messages will be echoed to the participants (excluding the originating user) |
Show fewest parameters required for logging
Name | Default Value | Description | |
---|---|---|---|
Logging | None | Specify logging source and destination. Possible values:
| |
log_service_url | http://pslc-qa.andrew.cmu.edu/log/server | The URL of a web service for logging. Required for ClientToLogServer logging. The default value is the URL of the Pittsburgh Science of Learning Center (PSLC) QA logging server, 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 | |
auth_token | A unique authorization token. | ||
class_name | Name of the class | ||
container_id | A unique ID. | ||
dataset_level_name[1-9] | Required for logging. Can specify multiple nested levels. Example: dataset_level_name1=Fractions dataset_level_type1=Unit | ||
dataset_level_type[1-9] | Required for logging. Can specify multiple nested levels. Example: dataset_level_name2=FractionAddition dataset_level_type2=Section | ||
dataset_name | Required for logging. Appears in DataShop as the name of the dataset | ||
DeliverUsingOLI | true | If delivering the tutor outside of the OLI course delivery system, set this to false and specify values for the following parameters:
| |
external_object_id | A unique object id. | ||
instructor_name | Name of the instructor | ||
log_to_disk_directory | . (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. | |
problem_context | A text description of the problem or how the problem is being used. | ||
problem_name | Defaults to the value of question_file | The name of the problem. | |
problem_tutorflag | A description of the problem type. DataShop prefers one of: tutor, test, pre-test, post-test, or other. | ||
school_name | School where these data will be collected. | ||
SessionLog | 'true' or 'false'. Determines whether or not to send a session log message at the beginning of a session. If true, Flash should send the session log, not the LMS. | ||
study_condition_name[1-9] | Name to identify the study condition; can specify multiple conditions that apply to these data (e.g., study_condition_name1=mycondition). | ||
study_condition_type[1-9] | Type of study condition; can specify multiple conditions that apply to these data. | ||
study_condition_description[1-9] | A description of the study condition; can specify multiple conditions that apply to these data. | ||
user_guid | A unique user id used for logging. |
These parameters map to elements in the tutor message DTD, version 4.
Name | Default Value | Description |
---|---|---|
authenticity_token | needed for authenticating POST messages | |
curriculum_service_url | '[host]/process_problem_set/[parameters]' or '[host]/process_student_assignment/[parameters]'. Command that processes the problem summaries | |
expire_logout_url | '[host]/admin/logout?type=expire'. Command that logs the user out on session expiration. | |
info | html containing the problem caption. | |
problem_state_status | 'empty', 'complete', or 'incomplete'. Used for problem review. | |
refresh_session_url | '[host]/admin/refresh_session' | |
restore_problem_url | '[host]/restore_student_assignment/[parameters]' | |
reuse_swf | 'true' or 'false'. Should we reuse the SWF from problem to problem? | |
run_problem_url | '[host]/run_student_assignment/[parameters]' or '[host]/run_problem_set/[parameters]'. Command that starts the next tutor. Location from which to receive the next problem (as HTML) if the Flash SWF is not being reused. | |
session_timeout | number of seconds to wait before the session times out | |
skills | XML containing the set of skills of interest for the current tutor | |
student_interface | current tutor's full .swf path. Used for loading assets given a relative path, and for reuse_swf. | |
target_frame | name of html frame where tutor is runname of html frame where tutor is run | |
tutoring_service_communication | 'socket' or 'javascript' |
Name | Default Value | Description |
---|---|---|
instrumentation_log | 'off', 'on', or 'verbose' | |
show_debug_traces | 'on' or 'off'. Determines whether to send ActionScript debug messages. |