Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 private void GetPrevSet()
 {
     questionSet = navigator.GetPreviousSet();
 }
Ejemplo n.º 3
0
 protected void GetPrevSet()
 {
     questionSet = navigator.GetPreviousSet();
     //activSetNumber = questionSet.Id;
 }