Index > Teachers Animation Toolkit > Quiz > Category Quiz

As you can see in the example below, objects fall and are dragged by the user into the appropriate category. There are three degrees of difficulty and the aim is to drag a given target number to the correct destinations.




Download the category example flash document

Start by thinking of a quiz relevant to your own subject. The instructions below take you through how to adapt the Flash document to your own context. The number of categories does not have to be three, it can be any number (although one would be a bit easy).


Changing the number of the categories


Less Categories (i.e. 2)

  1. The code checks the stage for movie clips beginning with target as the movie starts. This means that so long as you place them on the stage somewhere and the instances are named conventionally e.g. target1, the movie takes care of the rest.

  2. Go to the stage and find the instance of target3 called target3 (click on each target and look at the instance name in the properties window). Tap the delete key to remove it.

  3. You could also delete the movie clip called target3 from the library but you can safely leave it there if you prefer.

  4. You will need to alter the name of the categories in code (see below).


More categories (e.g. 4)

  1. The code deals with any targets on the stage automatically so go to the library (F11 toggles the window on and off) and duplicate one of the existing target movie clips (e.g. target1), making sure that you rename the duplicate (target4) and that the movie clip behavior is selected before you click on OK.

  2. Edit the new target movie clip in the library. Single-click on the dynamic text box in its centre and look for the var property in the properties window. Alter its name to match the target it is on (e.g. _root.targetText4).

  3. Drag the new target movie clip onto the stage onto the targets layer and arrange them all where you would like the user to drag items onto them.

Changing the names of the categories

  1. In the code on frame 1 of the scripts layer, scroll down to find this bit of code.

    targetText1 = "Alkali metal";
    targetText2 = "Halogen";
    targetText3 = "Noble gas";

  2. Edit the values of the targetText variables. The value of each is displayed in dynamic text boxes in the target movie clips. You can also delete the last one if you now have two targets or add additional ones at the bottom if you have more than three targets e.g.

    _root.targetText1 = "Verb";
    _root.targetText2 = "Adjective";
    _root.targetText3 = "Noun";
    _root.targetText4 = "Adverb";

  3. At this point, you might find that the category names you have chosen are too long for the text boxes in the target movie clips. You might have to edit the targets and alter the font size or even, make the whole target bigger so that you can fit a bigger text box inside.

Changing the items that fall from the top

  1. Find this bit of code. It defines an array of variables containing the text to add to falling boxes and the correct destination for each one.

    var item1 = ["Li",1];
    var item2 = ["Na",1];
    var item3 = ["K",1];
    var item4 = ["F",3];
    var item5 = ["Cl",3];
    var item6 = ["Br",3];
    var item7 = ["I",3];
    var item8 = ["He",2];
    var item9 = ["Ne",2];
    var item10 = ["Ar",2];
    var items = [item1,item2,item3,item4,item5,item6,item7,item8,item9,item10];

  2. Edit the items between the square brackets. The first part (e.g. "Li") is the text displayed in a falling object and the second part (e.g. 1) is the target that it belongs in (i.e. 1 is movie clip instance target1).

  3. If you want to add more objects, add them to the bottom of the list, making sure that you name the items properly (item11 etc). You can have less items by deleting from the bottom (item10 upwards).

  4. If you have added or removed items you must finish by editing the final part of the statement e.g.

    var items = [item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12];


    var items = [item1,item2,item3,item4,item5,item6];

Altering the comments and feedback


If you scroll down through the code, you will find the various pieces of text that provide feedback as the game runs.


Each has the format - variableName = "Piece of text to be displayed";


The variables are given in the list below.


var openingComment = "Catch the falling elements and put them in the correct group.";
var correctComment = "Well Done!";
var wrongComment = "Hard Luck!";
var feedback1 = " is an alkali metal.";
var feedback2 = " is a noble gas.";
var feedback3 = " is a halogen.";
var readyComment = "Get ready...";
var slowComment = "Too Slow!";
var finishComment = "Well Done - You have completed the game.";


Put whatever you like between the quotes and it will be displayed in the dynamic text box at the top of the playing area. This is probably the best way to find out the job that each does in the movie.


Editing the three levels of difficulty

  1. Look for the function called setLevel().

  2. It has three sections, each between a pair of curly brackets ({}). These sections contain sets of variables that determine how the level runs. You alter the values of the variables to change the level of difficulty.

  3. Here are the variables and what they do in red.

    speed = 5; determines the speed that the items fall - bigger value = faster
    maxObjects = 3; the maximum number of items that can be falling at once
    intervalTime = 2000; the time delay (in milliseconds) before the next item appears and starts to fall
    swapTargets = true; sets if the targets can swap places - true = yes, false = no
    swapTargetTime = 5000; the time delay (milliseconds) before swapping target places if swapTargets is true
    rotateFlag = true; sets if the items rotate as they fall - true = yes, false = no
    rotateSpeed = 10; the speed of rotation given as degrees if rotateFlag is true (0 - 360)
    holdTime = 2000; the time limit that the user can hold an item before it is marked wrong
    maxQ = 20; the target number of correct responses to complete the game
    subtract = false; sets whether to subtract 1 for wrong answers (including timeouts)

  4. Try some different settings and test the movie to see their effect. The settings in the template are definitely not appropriate and need testing with a real whiteboard on some real students!