// constructor public MultipleQuiz(VocAppModel core, Word word) : base(core) { this.word = word; this.answer = core.Translate(word.Wordstring); Word ranWord = core.GetRandomWord(); List<Word> addedWords = new List<Word>(); for (int i = 0; i < 5; i++) { while (addedWords.Contains(ranWord) || ranWord == word) { if (i > 0) { ranWord = core.GetRandomWord(); } } allAnswers[i] = core.Translate(ranWord.Wordstring); addedWords.Add(ranWord); this.attempts = 0; } // place the answer in the list of words Random index = new Random(); this.ansIndex = index.Next(0, 5); allAnswers[ansIndex] = answer; }
public Quiz(VocAppModel core) { this.core = core; }