Не уверен, но вроде как что-то типа такого должно быть:

Код AS3:
if(question_id == LANG.excercise.length -1) {
trace('end test');
return Math.floor( Math.random() * LANG.excercise.length)) ;
}
А вообще, если Вы вот этот код используете.

Код AS3:
function nextAnswer(event:MouseEvent) : void {
if(question_id == myList.excercise.length()) {
trace('end test');
return;
}
if (answerTxt.text == myList.excercise[question_id].answer) {
question_id++;
questionTxt.text = myList.excercise[question_id].question;
}
}
То вот как должно быть, вроде.

Код AS3:
function nextAnswer(event:MouseEvent) : void {
if(question_id == myList.excercise.length -1) {
trace('end test');
return;
}
question_id = Math.floor( Math.random() * myList.excercise.length);
if (answerTxt.text == myList.excercise[question_id].answer) {
question_id++;
}
questionTxt.text = myList.excercise[question_id].question;
}