Abc.NCrafts.App.ViewModels.Questions.Quiz.MoveToNextQuestion C# (CSharp) Method

MoveToNextQuestion() public method

public MoveToNextQuestion ( ) : bool
return bool
        public bool MoveToNextQuestion()
        {
            var currentQuestion = Questions[CurrentQuestionIndex];

            var answer = currentQuestion?.SelectedAnswer;
            if (answer == null || !answer.IsCorrect)
                return false;

            CurrentQuestionIndex++;
            if (CurrentQuestionIndex < Questions.Count)
                return true;

            IsSuccess = true;
            return false;
        }
    }