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);
        }
Exemple #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);
        }
Exemple #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));
        }
Exemple #6
0
        public async Task <bool> NewQuestion(Question.Type type)
        {
            question = await QuestionFactory.CreateQuestion(type);

            if (question.CorrectProfile != null)
            {
                return(true);
            }
            return(false);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #9
0
        public void CreateQuestion_WithFT_WillCreateAFreeTextQuestion()
        {
            var question = _questionFactory.CreateQuestion("Q1 FT Numele");

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