private void CheckNavigator(INavigator navigator) { QuestionSetSet.QuestionSetsRow qs; QuestionAnswerSet qd = new QuestionAnswerSet(); while (navigator.HasNextSet) { if (navigator.HasPreviousSet && random.Next(3) == 1) { qs = navigator.GetPreviousSet(); } else { qs = navigator.GetNextSet(); } while (navigator.HasNextQuestion) { if (navigator.HasPreviousQuestion && random.Next(3) == 1) { navigator.GetPreviousQuestion(qd); } else { navigator.GetNextQuestion(qd); } QuestionAnswerSet.QuestionsRow q = qd.Questions[0]; if (q.SubtypeId == (byte)Question.Subtype.ReadingComprehensionPassage) { Assert.Fail("Set cannot directly contain question of type ReadingComprehensionPassage"); } if (q.SubtypeId == (byte)Question.Subtype.ReadingComprehensionQuestionToPassage) { navigator.GetPasssageToQuestion(q.Id); } QuestionAnswerSet.AnswersRow[] a = q.GetAnswersRows(); navigator.SetUserAnswer(a[random.Next(a.Length)].Id); } } navigator.CommitResult(); }
private void GetNextSet() { questionSet = navigator.GetNextSet(); }
protected void GetNextSet() { questionSet = navigator.GetNextSet(); //activSetNumber = questionSet.Id; }