private Pergunta RandomizeAlternatives() { Pergunta tempQuestion = new Pergunta(questionGroup[dificulty].GetQuestion(0).GetNumberOfAlternatives()); List <int> alt = new List <int>(); int selNumb; for (int i = 0; i < questionGroup[dificulty].GetLenght(); i++) { tempQuestion = new Pergunta(questionGroup[dificulty].GetQuestion(0).GetNumberOfAlternatives()); RestartNumberList(ref alt, answerMeshText.Length); for (int j = 0; j < answerMeshText.Length; j++) { if (alt.Count != 0) { selNumb = alt[Random.Range(0, alt.Count - 1)]; } else { selNumb = alt[0]; } alt.Remove(selNumb); if (j == questionGroup[dificulty].GetQuestion(i).GetCorrectAnswer()) { tempQuestion.SetCorrectAnswer(selNumb); } tempQuestion.SetAlternative(selNumb, questionGroup[dificulty].GetQuestion(i).GetAlternative(j)); } questionGroup[dificulty].GetQuestion(i).OverrideQuestion(tempQuestion); } return(tempQuestion); }