Run my quiz question randomly

i have an idea that i want to do a few quiz questions. But i want my question run randomly each time when different people play it.
Any idea to do it?

not sure if you want the answers displayed as well but i`ve set up the code to show answers slightly later.
Just 2 textfields answer & quest, this is typed on the timeline

questions = [];
question = [];
question.push(“first”);
question.push(“firstanswer”);
questions.push(question);
question = [];
question.push(“second”);
question.push(“secondanswer”);
questions.push(question);
question = [];
question.push(“third”);
question.push(“thirdanswer”);
questions.push(question);
question = [];
question.push(“forth”);
question.push(“forthanswer”);
questions.push(question);
//etc
delete question;
shuffle = function () {
return Math.round(Math.random());
};

questions.sort(shuffle);

var i = 0;
function changequestion() {
answer.text = “”;
quest.text = questions*[0];

otherInterval = setInterval(showanswer, 2000, questions*[1]);
i++;
if (i>questions.length) {
	clearInterval(myInterval);
}

}
function showanswer(thing) {
answer.text = thing;
clearInterval(otherinterval);
}
myInterval = setInterval(changequestion, 5000);

Hope this helps

http://www.gifsrus.com/testfile/arrayquestions.swf
keep refreshing and hopefully they should appear in a different order

a more simple aproach…hehehe

thankx …i will try out stringy method…
g-shock i understand ur coding but waht i want is the every question will be load but the sequence is different each time when different user answer the question…

i try out stringy method but what i want is i hav a ‘next’ button .When i click the button, the next random question will show.Each time any user answer those question ,the sequence of those question will be different.

delete the code you have put on the button and give it an instance name myButton, then back on the main timeline

questions = [];
question = [];
myButton.btn_txt = “Start”;
question.push(“first”);
question.push(“firstanswer”);
questions.push(question);
question = [];
question.push(“second”);
question.push(“secondanswer”);
questions.push(question);
question = [];
question.push(“third”);
question.push(“thirdanswer”);
questions.push(question);
question = [];
question.push(“forth”);
question.push(“forthanswer”);
questions.push(question);
//etc
delete question;
shuffle = function () {
return Math.round(Math.random());
};
questions.sort(shuffle);
var i = 0;
function changequestion() {
myButton.enabled = false;
clearInterval(otherinterval);
answer.text = “”;
quest.text = questions*[0];
otherInterval = setInterval(showanswer, 2000, questions*[1]);
i++;
if (i>questions.length) {
quest.text = “End of Quiz”;
myButton.btn_txt = “Finished”;
}
}
function showanswer(thing) {
answer.text = thing;
clearInterval(otherinterval);
myButton.enabled = true;
}
myButton.onPress = changequestion;

//you might also consider having a dynamic textfield in the button.(myButton.btn_txt)

thank you stringy…
i able to do that again…thousand of thank you and thank you…:panda: