public async Task <SkillResponse> HandleIntent() { LOGGER.log.INFO("Yes", "HandleIntent"); if (base.sessionAttributes.SessionState != STATE.Introduction) { LOGGER.log.DEBUG("Yes", "HandleIntent", "Yes was said, but not in introduction"); WordsToRead wordsToRead = new WordsToRead(this.skillRequest); return(await wordsToRead.HandleIntent()); } base.sessionAttributes.SessionState = STATE.FirstWord; LOGGER.log.DEBUG("Yes", "HandleIntent", "Current Word: " + base.sessionAttributes.CurrentWord); WordAttributes wordAttributes = await WordAttributes.GetWordAttributes(this.sessionAttributes.CurrentWord, LOGGER.log); return(LessonFactory.GetLesson(this.sessionAttributes.LessonType).Dialogue(sessionAttributes.LessonMode, wordAttributes)); }
public async Task <SkillResponse> HandleIntent() { LOGGER.log.INFO("WordsToRead", "HandleIntent", "Current Schedule: " + this.sessionAttributes.Schedule); ILesson lesson = LessonFactory.GetLesson(this.sessionAttributes.LessonType); this.sessionAttributes.SessionState = STATE.Assess; var request = (Alexa.NET.Request.Type.IntentRequest)skillRequest.Request; string currentWord = this.sessionAttributes.CurrentWord; LOGGER.log.INFO("WordsToRead", "HandleIntent", "Current Word: " + currentWord); bool wordWasSaid = ReaderSaidTheWord(request); LOGGER.log.DEBUG("WordsToRead", "HandleIntent", "Reader said the word? " + wordWasSaid); if (wordWasSaid) { lesson.QuickReply = CommonPhrases.ShortAffirmation; GradeBook.Passed(sessionAttributes); bool sessionFinished = !sessionAttributes.WordsToRead.Any(); if (sessionFinished) { LOGGER.log.DEBUG("WordsToRead", "HandleIntent", "Session Finished"); await this.userProfile.IncrementUserProfileSchedule(); return(ResponseBuilder.Tell(CommonPhrases.LongAffirmation + CommonPhrases.SessionFinished)); } } else { lesson.QuickReply = CommonPhrases.ConstructiveCriticism; GradeBook.Missed(sessionAttributes); } WordAttributes wordAttributes = await WordAttributes.GetWordAttributes(this.sessionAttributes.CurrentWord, LOGGER.log); return(lesson.Dialogue(sessionAttributes.LessonMode, wordAttributes)); }