public void CreateQuestion_Always_WillreturnAFreeTExtQuestion()
        {
            QuestionFactory questionFactory = new QuestionFactory();

            var question = questionFactory.CreateQuestion("Q1 FT Numele");

            Assert.IsInstanceOf(typeof(FreeTextQuestion), question);
        }
        public void CreateQuestion_WillReturnAFreeTextQuestion()
        {
            QuestionFactory questionFactory = new QuestionFactory();

            var question = questionFactory.CreateQuestion(new StringReader("Q1 Name"));

            Assert.IsInstanceOf(typeof(FreeTextQuestion), question);
        }
        public void CreateQuestion_WillCreateAQuestion()
        {
            IQuestionFactory questionFactory = new QuestionFactory();

            var question = questionFactory.CreateQuestion("Q1 FT Numele");

            Assert.IsInstanceOf(typeof(IQuestion), question);
        }
예제 #4
0
        public void CreateQuestion_WithFT_WillCreateAFreeTExtQuestion()
        {
            QuestionFactory questionFactory = new QuestionFactory();

            var question = questionFactory.CreateQuestion(new StringReader("Q1 Name"));

            Assert.IsInstanceOf(typeof(FreeTextQuestion), question);
            Assert.AreEqual("Name", question.Text);
        }
예제 #5
0
        public void CreateQuestion_WWithFT_WillCreateAFreeTextQuestion()
        {
            QuestionFactory questionFactory = new QuestionFactory();

            var question = questionFactory.CreateQuestion("Q1 FT Numele");

            Assert.IsInstanceOf(typeof(FreeTextQuestion), question);
            Assert.That("Numele", Is.EqualTo(question.Text));
        }
예제 #6
0
        public async Task <bool> NewQuestion(Question.Type type)
        {
            question = await QuestionFactory.CreateQuestion(type);

            if (question.CorrectProfile != null)
            {
                return(true);
            }
            return(false);
        }
예제 #7
0
        /// <summary>
        /// Creates and adds a new Dynamic Question to the area
        /// based on information about the question.
        /// </summary>
        /// <param name="iQuestionID"></param>
        /// <param name="QuestionText"></param>
        /// <param name="Type"></param>
        /// <param name="Sequence"></param>
        /// <returns></returns>
        public Question AddQuestion(int iQuestionID,
                                    string QuestionText,
                                    QuestionTypes Type,
                                    int Sequence)
        {
            Question question = null;

            question = QuestionFactory.CreateQuestion(Type,
                                                      Sequence,
                                                      iQuestionID,
                                                      QuestionText,
                                                      _parent);
            _questions.Add(question);
            question.Changed += new System.EventHandler(this.HandleQuestionChange);
            return(question);
        }
예제 #8
0
        private void LoadQuestions()
        {
            questions.Clear();
            for (int i = 0; i < numberOfQuestions; i++)
            {
                questions.Add(QuestionFactory.CreateQuestion(level, subjects[PublicRandom.Next(subjects.Length)], goManager.R3D, goManager.CollidableGameObjects, questions));
            }

            goManager.AddObject(questions[questions.Count - 1]);
            questionHeader.Text = questions[questions.Count - 1].Header;

            ResetAnswersDisplay();
            CreateAnswersSupports();

            questions[questions.Count - 1].Player   = player;
            questions[questions.Count - 1].Position = new Vector3(0, 0f, 5);
        }
예제 #9
0
        public void CreateQuestion_WithFT_WillCreateAFreeTextQuestion()
        {
            var question = _questionFactory.CreateQuestion("Q1 FT Numele");

            Assert.IsInstanceOf(typeof(FreeTextQuestion), question);
        }