randomizing question options
Hello. I am trying to create a multiple choice quiz using an array for the questions and answers data. Each array has 4 answer options which I have put the correct answer as the first option. I would like to randomize each question's answers so the correct answer isn't always answer A. Here is some of the code. Thanks for you time
var testModel: Array = [{
num: "30",
q: “what color is red?",
a1: " red ",
a2: " blue ",
a3: " green ",
a4: " pink"
}];
a_btn.addEventListener(MouseEvent.CLICK, goclick_a);
b_btn.addEventListener(MouseEvent.CLICK, goclick_b);
c_btn.addEventListener(MouseEvent.CLICK, goclick_c);
d_btn.addEventListener(MouseEvent.CLICK, goclick_d);
var user_Test_ans: Array = new Array();
var newtestModel: Array = shuffle1Array(testModel);
var index1: int = 0;
var userTanswer: String = "";
questions_txt.text = newtestModel[index1]["q"];
a1_txt.text = newtestModel[index1]["a1"];
a2_txt.text = newtestModel[index1]["a2"];
a3_txt.text = newtestModel[index1]["a3"];
a4_txt.text = newtestModel[index1]["a4”];
