I took the time to look into your problem in more detail. I created three classes as models for the Question, User & Answer and an AnswerEvent class.
The main class serves as a central point to manipulate data. When a user answers a question , the user's answer(Answer class ) dispatches an event to inform the main class. The answer has a user property , a question property and a isCorrect property, the AnswerEvent contains an Answer object that can be stored in the main class.
After the event has been dispatched , the answer is stored in an array of answers. Since each answer contains the user data as well as the question answered & how it was answered , you can use this array to answer your a, b & c questions.
As for the classes, I followed a similar principle to that exposed in my first reply. I don't think there's enough space here to post all the code so I just posted some excerpts.
//Inside the main class
private var answers:Array = [];
private function init():void
{
this.addEventListener(AnswerEvent.ANSWER , answerEventListener );
var q1:Question = new Question( 0 , ["Sweden" , "Denmark"] , 0 );
var q2:Question = new Question( 1 , ["Norway" , "Finland"] , 1 );
var q3:Question = new Question( 2 , ["Iceland" , "Ireland"] , 0 );
var user1:User = new User( 5 , 25 , 0 , "Lorem" );
var user2:User = new User( 6 , 45 , 1 , "Ipsum" );
var user3:User = new User( 7 , 32 , 1 , "Dolor" );
//if the answer is correct , the totalCorrect property is incremented
// in the User class, check the Answer class below for an explanation of the
//parameters
user1.answer( new Answer( this , user1 , q1 , 1 ));
}
private function answerEventListener(event:AnswerEvent):void
{
answers.push(event.answer);
trace( this , event.answer.isCorrect );
trace( this , event.answer.user.age );
}
Here's a model for the Answer class, I didn't add the getters for lack of space. The AnswerEvent extends the Event class and add an answer property of type Answer
public class Answer
{
private var _question:Question;
private var _answer:int;
private var _user:User;
private var _isCorrect:Boolean;
public function Answer(dispatcher:EventDispatcher , user:User , question:Question , answer:int)
{
this._user = user;
this._question = question;
this._answer = answer;
// not essential but will help iterate thru correct answers
// the _answer property should be _answerIndex really, in order not to be confused
// with an Answer object ( quick job ! )
if( question.correctAnswer == answer )
_isCorrect = true;
// the this keyword corresponds to this answer
dispatcher.dispatchEvent( new AnswerEvent(AnswerEvent.ANSWER , this) );
}
}