Hi friends.
I have this wonderful modified Multiple Choice Quiz coded in AS2.
It chooses from 14 questions from en xml file and randomly picks 5 questions
everytime you run the quiz. That works fine.
The thing I would like to improve is that now I do get “duplicates or repeats”!
F. eks questions 2 appears twice in a set. So I would prefer to have only unique random and
different questions everytime the quiz runs, but I dont have the expertise to solve this.
Can you help?
The code that randomises looks like this:
// Randomize order
for (i=0; i<quizItems.length; i++)
{
var indexToSwap=int(Math.random()quizItems.length);
var temp=quizItems[indexToSwap];
quizItems[indexToSwap]=quizItems;
quizItems*=quizItems[indexToSwap];
}
You can find the complete code in Frame 1 in the attached .fla.
I would appreciate any suggestions and improvements - THANKS!