all groups > flash actionscript > august 2004 >
You're in the

flash actionscript

group:

i need help on this


i need help on this imlazuli
8/17/2004 9:05:47 PM
flash actionscript:
i have created a test with multiple choices its working fine now if a user has
to make 2 selections for an answer and he has only marked one yet, then how to
tell him that plz select one more choice any code for it???
any help would be appreciated
Re: i need help on this kglad
8/18/2004 2:26:01 AM
Re: i need help on this imlazuli
8/18/2004 5:37:41 AM
thats how i have made my Multiple Questions Test in flash
first i declaread a global variable in timeline like the following.

// Init main timeline variables
var q1answer; // User's answer for question 1
var q2answer; // User's answer for question 2
var totalCorrect = 0; // Counts number of correct answers
var displayTotal; // Text field for displaying user's score

// Stop the movie at the first question
stop( );

after setting variables i made a button and set its code (these buttons are
for multiple answers)
on (release) {
q1answer = 1;
}
for another button
on (release) {
q1answer = 2;
}
and so on

now if the question have two right answers and the user has selected only one
then he gets notified that Please select one more choice.
Waiting for a sooner response
Re: i need help on this kglad
8/18/2004 6:10:30 PM
my guess is that each frame of your movie contains one question and several
buttons that correspond to the users answers. ie, if a user thinks the answer
is submitted by pressing button 1, they press button1. if they think the
correct answer is submitted by pressing button 4, they press button 4. once
the correct number of responses is submitted you do something. this set-up
essentially tells the user how many answers are correct.

is that your set-up?
Re: i need help on this imlazuli
8/19/2004 6:44:05 AM
Re: i need help on this kglad
8/19/2004 1:53:16 PM
attached to each frame initialize a variable that contains the number of
correct answers and initialize a variable that contains the number of answers
your user has submitted. with each button press increment the submitted
answers variable and compare it to the expected number. when they are equal do
something. for example, attached to a frame that contains a question with 3
correct answers use:

correctAnswers=3;
usersAnswers=0;

attached to a typical button in this frame:

on(release){
usersAnswers++;
qManswer=M;
if(usersAnswers==correctAnswers){
// do something
}
}
AddThis Social Bookmark Button