Esempio n. 1
0
 public SpellingViewModel AnswerQuestion(string answer)
 {
     _current.FinalAnswer = answer;
     if (answer.ToUpper() == _current.Word.ToUpper())
     {
         _current.CorrectCount += 1;
         _current.AnswerStatus  = Entities.QuestionResult.Correct;
         _speachService.Say("Correct.", false);
     }
     else
     {
         _current.ErrorCount  += 1;
         _current.AnswerStatus = Entities.QuestionResult.Wrong;
         _speachService.Say("Wrong.", false);
     }
     return(NextQuestion());
 }
Esempio n. 2
0
        private void OnAnswer(Window window)
        {
            var next = _spellTestService.AnswerQuestion(CurrentAnswer);

            CurrentSpelling = next;
            CurrentAnswer   = "";

            if (next == null)
            {
                // All questions answered
                _speachService.Say("Test Completed", true);
                SaveAnswers();
                OnQuit(window);
                return;
            }

            RequestSpelling(CurrentSpelling);
        }
Esempio n. 3
0
        private void OnAnswer(Window window)
        {
            var next = _spellTestService.AnswerQuestion(CurrentAnswer);

            CurrentSpelling = next;
            CurrentAnswer   = "";

            if (next == null)
            {
                // All questions answered
                _speachService.Say("Test Completed", true);
                OnQuit(window);
                return;

                // Appears that setting the property to null was not triggering an evaluation of CanExecuteChanged post command execution.
                // It was being called just before command invocation but the command is already triggered at that point so what's the point.
                //AnswerCommand.RaiseCanExecuteChanged();
                //SkipCommand.RaiseCanExecuteChanged();
            }

            RequestSpelling(CurrentSpelling);
        }