Thursday, September 22, 2011

Tracking Raptivity interactions using JavaScript

Raptivity provides various ways of tracking interactions while publishing an interaction. One of the popular ways used is JavaScript tracking. It helps users to track Raptivity interactions in their authoring tools which support JavaScript tracking.


To make the Raptivity interactivity tracking information available through JavaScript, one needs to publish the interactivity with specific settings. To do so, once the interactivity is created and saved follow the below steps:


1. Click the menu File ---> Publish. It opens the Publisher screen for you as shown in the Figure 1. given below.



File Menu
Figure 1. File Menu

2. On the publisher dialogue, select the option “Make tracking information available through JavaScript" and publish the interactivity as shown in the Figure 2. given below.



Publisher Dialogue
Figure 2. Publisher Dialogue

3. The published output is stored in JavaScript_Publish sub-folder under Publish directory.


4. After publishing, go to the Publish directory and you will see a JavaScript file with extension .js. JavaScript is available in the form of a .js file. The name of the .js file has the same name as that of your interactivity.


For example: C:\MyInteractivity\Publish\ JavaScript_Publish\MyInteractivity.js


5. When you open the .js file, you will find four JavaScript variables which store the tracking information. The variables are for capturing:


a. Score


b. Completion status


c. Result (as pass/ fail)


d. Maximum score for the interactivity.


The four JavaScript variables you would find in .JS are ‘raptivity_completionStatus’, ‘raptivity_score’, ‘raptivity_result’ and ‘raptivity_maxscore’.


6. The values of these variables change as the learner interacts with the interactivity. For example: In Flash cards interactivity, the value of completion status changes to ‘Incomplete’ when the learner flips any of the cards and it changes to ‘Completed’ when the learner flips all the cards.


7. The values of these variables are communicated from the Flash interactivity to the JavaScript function for populating the JavaScript variables.


You can use these four variables with the JavaScript code in your pages and create the results page. For interactivities which do not have a score, Raptivity would send only the ‘Completion Status'.


Hope this would give Raptivity geeks to get started with Raptivity tracking in their authoring tools!