Example #1
0
        public Question(byte[] bytes, ref int position)
        {
            Title = DataManager.ReadStringFromByteArray(bytes, ref position);

            int numberOfAnswers = DataManager.ReadLengthForNextSection(bytes, ref position);
            int index = 0;
            for (index = 0; index < numberOfAnswers; index++)
            {
                Answer answer = new Answer(bytes, ref position);
                _answers.Add(answer);
            }
        }
Example #2
0
        internal bool AnswerQuestion(Answer a)
        {
            a.Choose();
            _hasAnswer = true;

            if (a.IsCorrect())
            {
                _isCorrect = true;
                return true;
            }
            _isCorrect = false;
            return false;
        }
Example #3
0
 private void AnswerTheQuestion(Answer answer)
 {
     if(_currentQuestion.AnswerQuestion(answer))
     {
         _currentQuizScore.Value += 1;
     }
     AdvanceQuestion();
 }