예제 #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);
            }
        }
예제 #2
0
        internal bool AnswerQuestion(Answer a)
        {
            a.Choose();
            _hasAnswer = true;

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