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

flash (macromedia)

group:

Newbie Question


Newbie Question Stuart Maynard-Keene
11/30/2004 9:45:01 PM
flash (macromedia):
Hi forum,

Sorry if this is a really stupid question but I'm trying to create a quiz
that has got 6 questions and each question has 3 answers. At the end of the
quiz the answers get totalled and the result gets displayed depending on
your choices.

Anyone done anything like this or can point me in the right direction to a
tutorial.

Again apologies if it's a stupid question but I'm a flash newbie ;-)

I've looked at the Macromedia templates and I'm not sure it is the right
thing?

Thanks in advance
Stuart Maynard-Keene
Re: Newbie Question sideburn
12/1/2004 1:58:00 AM
I've done this before. Its easy.
Just use variables.


Say you have a question.. Like, "what color is grass?"

Then you have 3 buttons for the 3 answers "red" "green" "blue"

Then attach an answer variable onto each button

On Release {
questionOneAnswer = false;
}
On Release {
questionOneAnswer = true;
}
On Release {
questionOneAnswer = false;
}


Do that for as many questions as you want and then have a "continue" or
"finished" button to go to the results page. So make a label on the timeline
called "finished"

And attach a goto to that button like this:

On Release {
gotoAndPlay("finished");
}


Then on that frame test all the results like this:


If(questionOneAnswer)
totalCorrect++; //increment the total answers they got right

If(questionTWOAnswer)
totalCorrect++; //increment the total answers they got right

And on and on....

Then on the page you could make a dynamic text field with a variable name of
totalCorrect and it will display how many they got right.

You could do the same for total incorrect and subtract that number each time
one is correct.


That¹s just a quick and simple way to do it but that'll work.





On 12/1/04 12:01 AM, in article BDD32AEC.F40F%stu@maynard-keene.co.uk,
[quoted text, click to view]
Re: Newbie Question sideburn
12/1/2004 4:36:36 AM
Yeah

In each button add another variable on button Release like:

totalAnswers++;

And at the end tally up total correct answers vs total answers

So totalAnswers might end up being 12 and 6 were correct

So that would be "average"

You could do a test like

Score = totalAnswers - TotalCorrect;

In this case score would equal 6

Then you could say:

if (Score > 6 )
gotoAndPlay("good")
if (Score < 4 )
gotoAndPlay("bad")
else gotoAndPlay ("Average");

Again that¹s rough, but hopefully you get the idea..



On 12/1/04 2:49 AM, in article BDD35252.EAF2%stu@pageworks.co.uk, "Stuart
[quoted text, click to view]
Re: Newbie Question sideburn
12/1/2004 5:21:41 AM
Ill see what I can do tomorrow

Or later on today I mean..

On 12/1/04 5:08 AM, in article BDD372B9.FA46%stu@pageworks.co.uk, "Stuart
[quoted text, click to view]
Re: Newbie Question Stuart Maynard-Keene
12/1/2004 8:01:48 AM
in article BDD29A5D.EA40%stu@maynard-keene.co.uk, Stuart Maynard-Keene at
stu@maynard-keene.co.uk wrote on 30/11/04 9:45 pm:

[quoted text, click to view]

Anyone with any ideas, it's just I got to get this quiz out today :-(
Re: Newbie Question mc_clure
12/1/2004 8:43:33 AM
Hi,
I could be misreading your intent here, but quiz template #2, frame 6 has a multiple choice component that could be used (repeated) to allow for three answers per question.
Re: Newbie Question Stuart Maynard-Keene
12/1/2004 9:06:37 AM
in article cok07l$ap8$1@forums.macromedia.com, mc_clure at
webforumsuser@macromedia.com wrote on 1/12/04 8:43 am:

[quoted text, click to view]

Thank you J for your response, I looked at that earlier, not the thoroughly
mind, I take a look again, thank you.
Re: Newbie Question Stuart Maynard-Keene
12/1/2004 10:49:54 AM
On 1/12/04 9:58 am, in article BDD2D5A8.109C3%xxx@yyy.zzz, "sideburn"
[quoted text, click to view]

Thank you for your reply, what I'm actually trying to do it count their
answers so there isn't a right or wrong answer.

Depending on the result they will be defined as either Good, Average or Bad
from their answer count can this be done similar to how you've have
helpfully stated?
Re: Newbie Question Stuart Maynard-Keene
12/1/2004 1:08:09 PM
On 1/12/04 12:36 pm, in article BDD2FAD4.109FD%xxx@yyy.zzz, "sideburn"
[quoted text, click to view]

Thank you for this your help it is much appreciative. But I can't get the
syntax right and I'm probably not attaching the right thing anyway.

Do you have a sample I could possibly take a look at?

Once again thank you for your help ;-)
AddThis Social Bookmark Button