« November 2007 | Main | April 2008 »

March 05, 2008

Randomizing Captivate Quizzes

Captivate quizzes are easy to create, but they lack some often-requested features. Even using version 2, it is difficult, if not impossible, to randomize questions within Captivate. The following method will alter the html wrapper generated when you publish a Captivate project so that it chooses from a bank of alternate Captivate SWF files when the page opens.

Download example HTML wrapper file

When you publish to Flash (SWF) in Captivate, Captivate creates an HTML wrapper which contains the SWF file in an object tag. (Usually titled "ProjectTitle.htm") There is a variable, "strURLFile ," which determines which Captivate file is launched. In the unaltered file, this variable is set to the project title you set when you published.

To randomize the quizzes, you need to replace this hard-coded value with a function. So, around line 8 of the HTML file, insert the following lines:

	//********begin randomization function	
	       	 var strURLFile 
			function chooseSwf() {
			var number = 0;
			var swf = new Array()
	//********add your alternate SWF file names into this array
			swf[number++] = "TestQuiz01.swf"
			swf[number++] = "TestQuiz02.swf"
			swf[number++] = "TestQuiz03.swf"
			swf[number++] = "TestQuiz04.swf" 	
	//****** end of array
			var increment = Math.floor(Math.random() * number);
			strURLFile= swf[increment];
			return strURLFile;		 
			}
           strURLFile = chooseSwf();
 //********end randomization function
Be sure to add all the SWF names into the array where indicated.

Around line 25, be sure to comment out the original variable definition:

	// var strURLFile = "TestQuiz03.swf";		// Name of the flash file

That is all you have to do. Of course, the more alternate SWF's you create, the less likely someone will see the same one twice in a row. Create several alternate versions, output them all in the same format, and drop the alternate SWF's into the same folder as the custom HTML wrapper and the first SWF.


Posted by emeiselm at 06:42 PM | Comments (0)

Speed control widgets for Captivate

These 2 widgets allow your users to alter the speed (in frames per second) of the Captivate presentation they are viewing. To use them simply "Insert Animation" and set the animation Options:Timing to Display for rest of project, and no transition.

The first one is a slider which goes from 0-130 fps. Download file





The second is a set of buttons which increment and decrement the speed in units of ten fps, down to zero, with no ceiling. Download file




The slider is based on
Slider bar smart clip by Patrick Mineault"

Both files contain frames-per-second indicators, but you can hide them. Both widgets can be reskinned: I have included the source flash files in the zip archives.


Posted by emeiselm at 06:38 PM | Comments (0)