Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-30-2014, 10:41 PM   #1
J.G.
Registered User
 
Join Date: Jun 2014
Posts: 1
Default Quiz repeated questions

Hello, i am new at the forum and at AS3.
I am doing a quiz with a series of 10 questions. For each series there is repetition of questions but if i play a second serie of questions there are some repeated questions.
How can i do to avoid repeated questions after second series? Should i do an array of an array of 10 questions and randomise the arrays? What could i do?

var answer_cliked:String;
var qno:int = 0;
var rnd2:Number;

function changequestion()
{
if (qno==10)
{
gotoAndStop(2);
}
else
{
rnd2 = Math.ceil(Math.random() * questions.length) - 1;
box.text = questions[rnd2];


if (questions[rnd2] == "x")
{
changequestion();
}
questions[rnd2] = "x";
bt_pt.mouseEnabled = true;
bt_cv.mouseEnabled = true;
bt_frt.gotoAndStop(1);
bt_frt.mouseEnabled = false;
}
}

changequestion();

bt_frt.addEventListener(MouseEvent.CLICK, clicarFrt1);
function clicarFrt1(eventObject:MouseEvent)
{
paltimetro.nextFrame();


if (answer_cliked == answers[rnd2])
{
removeChild(true);
chanel1.stop();
}
else
{
removeChild(false);
chanel.stop();
}

changequestion();

}
J.G. is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:49 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Quiz repeated questionsQuiz repeated questions
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.