# Quiz-mutiple choice-xml-random questions

**URL:** <https://forum.kirupa.com/t/quiz-mutiple-choice-xml-random-questions/331867>\
**Category:** flash\
**Created:** [November 12, 2013, 7:51pm UTC](https://forum.kirupa.com/t/quiz-mutiple-choice-xml-random-questions/331867 "2013-11-12T19:51:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomaslanger](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@thomaslanger](https://forum.kirupa.com/u/thomaslanger)\
**Post date:** [November 12, 2013, 7:51pm UTC](https://forum.kirupa.com/t/quiz-mutiple-choice-xml-random-questions/331867/1 "2013-11-12T19:51:51Z")

</div>

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!
