all groups > flash (macromedia) > january 2004 >
You're in the

flash (macromedia)

group:

Multiple Fiil-In-The-Blank Questions in a Single Frame?


Multiple Fiil-In-The-Blank Questions in a Single Frame? Mr. Myers
1/11/2004 6:26:29 PM
flash (macromedia): I am a third grade teacher who runs an educational classroom website. (http://www.mrmyers.org) I am very new to the Flash MX quiz template, but see a tremendous amount of potential for its use in the classroom. I am trying to create a quiz consisting of only one testing frame, but 100 individual questions within that single frame. I am creating a math fact timed test. For an example of what I want I am trying to do, please see http://www.mrmyers.org/Math_Mania/ttmult.html. Is this possible? Eventually, I would like to add a timer to the test, however, I would like to just get it up and running first. Thank you for your time and energy.


Re: Multiple Fiil-In-The-Blank Questions in a Single Frame? pazzoboy
1/11/2004 10:17:21 PM
basically, you would just have 100 input textboxes, each with an individual instance name. Let's say a1, a2, a3 ... a100.
On the first frame of the timeline, you would have something like:

answers = new Array(9,13,-2,50, ... ,answer100); //You would have all 100 answers in this array
correctAnswers=0; //this is the counter for the answers that the kids get right
stop(); // To keep the timeline in this frame;
---------
To grade the kids' tests, you would have something like a button at the end, with this actionscript:

on(release){
for(x=0;x<=99;x++){
nextQuestion = "_root.a"+ x+1 +".text";
if(nextQuestion==answers[x]){
correctAnswers++;
nextQuestion="";
}
}
}

Of course, the timer is easy, but let's get you through the test first. Test the above code out, and then we'll work on getting the kids names and number of correct answers emailed to you upon completion of the test.

Re: Multiple Fiil-In-The-Blank Questions in a Single Frame? pazzoboy
1/12/2004 2:57:22 AM
An even better answer will come when someone looks at my other post about pushing object references. Here goes:

Let's start out with four input textFields for now, with instance names a1, a2, a3, a4. In the main timeline, put this actionscript:

answers = new Array(1,2,3,4); // Let's just say that the sums of addition problems are these
correctAnswers = 0; //this will be used to count correct answers
stop();

Now, make a button and put this actionscript on it:
on(release){
responses = new Array();
responses.push(_root.a1.a1.text);
responses.push(_root.a2.a2.text);
responses.push(_root.a3.a3.text);
responses.push(_root.a4.a4.text);
for(x=0;x<=3;x++){ //remember, arrays start at 0
trace(responses[x]);
if(responses[x] == _root.answers[x]){
correctAnswers++;
correctAnswerTotal = " --- " + correctAnswers + " correct answers so far!";
}
}
}

Now, once you test this, add a dynamic textField (but instead of an instance name, type correctAnswerTotal in the "var" field.) I haven't tested this part yet, but it should show the number of correct answers in the dynamic textField.
We'll work out the timer after you get this part...



AddThis Social Bookmark Button