# Random Quiz

**URL:** <https://forum.kirupa.com/t/random-quiz/163646>\
**Category:** flash\
**Created:** [September 24, 2005, 11:08am UTC](https://forum.kirupa.com/t/random-quiz/163646 "2005-09-24T11:08:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mashi](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mashi](https://forum.kirupa.com/u/mashi)\
**Post date:** [September 24, 2005, 11:08am UTC](https://forum.kirupa.com/t/random-quiz/163646/1 "2005-09-24T11:08:52Z")

</div>

I have this quiz script that randomize questions and answers. But I only want it to randomize the questions. Can anyone help me on that, how should i change the script to juz randomize questions. Thanks!

**Here the script :**

stop();  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
here we include the external file with  
the list of our question and answers  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
#include “questions.as”  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
toDisplay = 7; // how many question to display

// Random generation Questions  
Object.prototype.nextAnswer = function(){  
ranQuestion = random(domande.length)  
for(var i = 0; i \< domande.length; i++){  
if(ranQuestion == tempArray\*){  
var prosegui = false;  
nextAnswer();  
break;  
}  
var prosegui = true;  
}  
if(prosegui){  
tempArray.push(ranQuestion);  
return ranQuestion;  
}  
}

// Remove the old points  
Object.prototype.removePoints = function(what,keep){  
for(var clips in \_root.box){  
if(\_root.box[clips].\_name.substring(0,\_root.box[clips].\_name.length -1) == what.substring(0,what.length-1) && \_root.box[clips] != \_root.box[what]){  
\_root.box[clips].point.\_visible = 0  
}  
}  
}

// remove old answers  
Object.prototype.removeAllAnswer = function(){  
for(var answer in \_root.box){  
removeMovieClip(\_root.box[answer])  
}  
}  
// Build the Question  
Object.prototype.buildQuestion = function() {  
creaNuovoArray();  
countAnswer++;  
delete myChoice;  
// call function to generate a random unique question  
nextAnswer();  
numero\_domanda = “domanda #” + countAnswer; // current Question  
domanda = (domande[ranQuestion][0]) // Assing Question txt  
removeAllAnswer();  
// build answers;  
for(var i = 0 ; i \< domande[ranQuestion][2].length ; i++){  
nextRisposta();  
duplicateMovieClip(“box.answer”,“answer”+i,i)  
box[“answer”+i].y\_fin = answer0.\_y + (20_i)  
box[“answer”+i].txt = domande[ranQuestion][2][ranAns]  
if(ranAns == domande[ranQuestion][1]){  
box[“answer”+i].thisChoice = true  
} else {  
box[“answer”+i].thisChoice = false  
}  
}  
box.answer.\_visible = 0  
}  
// Building random answers  
function creaNuovoArray(){  
delete tempRis;  
tempRis = new Array();  
}  
Object.prototype.nextRisposta = function(){  
ranAns = random(domande[ranQuestion][2].length)  
for(var i = 0; i \< domande[ranQuestion][2].length; i++){  
if(ranAns == tempRis_){  
var prosegui = false;  
nextRisposta();  
break;  
}  
var prosegui = true;  
}  
if(prosegui){  
tempRis.push(ranAns);  
return ranAns;  
}  
}
