コード例 #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();
        }
コード例 #2
0
ファイル: TestController.cs プロジェクト: NingMoe/gcchallenge
 private void GetNextSet()
 {
     questionSet = navigator.GetNextSet();
 }
コード例 #3
0
 protected void GetNextSet()
 {
     questionSet = navigator.GetNextSet();
     //activSetNumber = questionSet.Id;
 }