What I have is a small quiz applet that asks 9 questions using a group of 4 radio buttons ("Answergroup") and keeps track of the score (each button being worth 0-3 points). What i want to do is at the end, display each question and the score for each question as a summary on the last card.
I have all of the questions as strings prestored in an array designated as qArray[x]["question"] where x is the question number. and I am trying to further utilize that array by placing the points into qArray[x]["iscore"] where a numerical value is placed into each corresponding 'iscore". So for example, qArray[1]["question"] should be associated with qArray[1]["iscore"] and then I want to display these at the end of the quiz with
Question 1.- Score
Question 2 - score
etc.
Currently, the way I am building my score array and also grabbing the score from the radio button is with a "next question" button on the quiz applet, so that when one hilites a radio button, they can press next question and the score will be grabbed and stored into 2 variables (1/ qTab which is the sum of all the points, and the array qArray[x]["iscore"], which is the individual score for each question.
The nextbutton code is as follows:
Code: Select all
global qTab, qNbr, qArray
on mouseUp
add the last word of the hilitedButtonName of group "AnswerGroup" to qTab
put the last word of the hilitedButtonName of group "Answergroup" into qArray[qNbr]["iscore"]
nextQuestion
end mouseUp
and NextQuestion is the following handler on the card:
Code: Select all
command nextQuestion
global qNbr, qArray, qTab
if qNbr > 9 then go to card "Last"
else
put qArray[qNbr]["question"] into fld "Question"
add 1 to qNbr
set the hilitedButtonName of group "AnswerGroup" to empty
end if
end nextQuestion