예제 #1
0
        private SkillResponse TeachTheWord(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("WordFamilies", "TeachTheWord", "WORD: " + wordAttributes.Word);

            string[] decodedWord = wordAttributes.Word.Select(x => x.ToString()).ToArray();
            string   wordFamily  = wordAttributes.WordFamily;
            string   teachModel  = QuickReply;

            teachModel += SSML.PauseFor(1);
            teachModel += " This word is spelled ";
            foreach (string sound in decodedWord)
            {
                teachModel += SSML.PauseFor(0.2) + SSML.SayExtraSlow(sound) + SSML.PauseFor(0.2);
            }
            teachModel += SSML.PauseFor(.5);
            teachModel += "The sounds are ";
            teachModel += SSML.PauseFor(0.2) + SSML.SayExtraSlow(SSML.Phoneme(decodedWord[0])) + SSML.PauseFor(0.2);
            teachModel += SSML.PauseFor(0.2) + SSML.SayExtraSlow(wordFamily) + SSML.PauseFor(1.0);

            teachModel += SSML.SayExtraSlow(wordAttributes.Word);
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Now you try. Say the word. ";

            return(AlexaResponse.TeachFlashCard(wordAttributes.Word, teachModel));
        }
예제 #2
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("ShortVowels", "Introduction", "WORD: " + wordAttributes.Word);

            string teachModel = "In the alphabet, there are two types of letters.";
            string vowel      = wordAttributes.Vowel;
            string vowelSound = wordAttributes.VowelPhoneme;

            teachModel += SSML.PauseFor(0.5);
            teachModel += "Vowels and Consonants.";
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Can you say Vowels?";
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Can you say Consonants?";
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Vowels are " + SSML.SayExtraSlow("a") + SSML.PauseFor(0.5) +
                          SSML.SayExtraSlow("e") + SSML.PauseFor(0.5) + SSML.SayExtraSlow("i") + SSML.PauseFor(0.5) +
                          SSML.SayExtraSlow("o") + SSML.PauseFor(0.5) + SSML.SayExtraSlow("u");
            teachModel += SSML.PauseFor(0.5);
            teachModel += " and sometimes y. ";
            teachModel += " Right now we are going to work with the vowel " + vowel;
            teachModel += SSML.PauseFor(1.5);
            teachModel += " A short " + SSML.SpellOut(vowel) + " makes the sound " + SSML.SayExtraSlow(SSML.Phoneme(vowelSound)) + ".";
            teachModel += SSML.PauseFor(1.0);
            teachModel += " Are your ready to learn some words with " + vowel;

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #3
0
        public async Task <SkillResponse> HandleRequest()
        {
            LOGGER.log.INFO("LaunchRequest", "HandleRequest");

            await this.userProfile.GetUserProfileData();

            if (userProfile.RequiresPurchase())
            {
                LOGGER.log.DEBUG("LaunchRequest", "HandleRequest", "Schedule is premium content");

                await productInventory.GetAvailableProducts();

                string productName = this.userProfile.lesson.InSkillPurchaseName;

                if (productInventory.IsUnpaid(productName))
                {
                    LOGGER.log.DEBUG("LaunchRequest", "HandleRequest", "Premium content requires purchase");

                    this.sessionAttributes.ProductName = productName;
                    return(AlexaResponse.PurchaseContentUpsell(productInventory.GetProductId(productName),
                                                               CommonPhrases.Upsell(), productName));
                }
            }

            this.sessionAttributes.UpdateSessionAttributes(userProfile);
            this.sessionAttributes.SessionState = STATE.Introduction;

            WordAttributes wordAttributes = await WordAttributes.GetWordAttributes(this.sessionAttributes.CurrentWord, LOGGER.log);

            LOGGER.log.DEBUG("Launch", "HandleRequest", "Next word: " + sessionAttributes.CurrentWord);

            return(LessonFactory.GetLesson(this.sessionAttributes.LessonType).Introduction(wordAttributes));
        }
예제 #4
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("SightWords", "Introduction", "WORD: " + wordAttributes.Word);

            string teachModel = "There are words used over, and over, and over, and over, and ";

            teachModel += SSML.PauseFor(.5);
            teachModel += " Well " + SSML.PauseFor(.5) + " you get the point. These are called sight words. ";
            teachModel += " It is helpful to just memorize them by sight. To see them and know what they say.";
            teachModel += " Are you ready to start? ";

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #5
0
        public SkillResponse Dialogue(MODE mode, WordAttributes wordAttributes)
        {
            switch (mode)
            {
            case MODE.Assess:
                return(AssessTheWord(wordAttributes));

            case MODE.Teach:
                return(TeachTheWord(wordAttributes));

            default:
                return(ResponseBuilder.Tell("ERROR"));
            }
        }
예제 #6
0
        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));
        }
예제 #7
0
        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));
        }
예제 #8
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("WordFamilies", "Introduction", "WORD: " + wordAttributes.Word);

            string wf = wordAttributes.WordFamily;

            string teachModel = "Hello my Moycan! We are working with word families. ";

            teachModel += SSML.PauseFor(0.5);

            teachModel += "A word family is a group of words that are related " +
                          "because they have a common spelling or sound. Word families " +
                          "often rhyme or end the same.";
            teachModel += SSML.PauseFor(1.5);
            teachModel += " Lets begin with the " + wf + ", word family. ";
            teachModel += " Remember, all of these words will end with " + wf + ".";
            teachModel += " Are you ready to begin?";

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #9
0
        public SkillResponse TeachTheWord(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("ConsonantBlend", "TeachTheWord", "WORD: " + wordAttributes.Word);

            string[] decodedWord = wordAttributes.Word.Select(x => x.ToString()).ToArray();
            string   vowelSound  = wordAttributes.VowelPhoneme;
            string   teachModel  = QuickReply;

            teachModel += SSML.PauseFor(1);
            teachModel += " The word is spelled ";
            foreach (string sound in decodedWord)
            {
                teachModel += SSML.PauseFor(0.2) + SSML.SayExtraSlow(sound) + SSML.PauseFor(0.2);
            }
            teachModel += SSML.PauseFor(1.0);
            teachModel += SSML.SayExtraSlow(wordAttributes.Word);
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Now you try. Say the word ";

            return(AlexaResponse.TeachFlashCard(wordAttributes.Word, teachModel));
        }
예제 #10
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("LongVowels", "Introduction", "WORD: " + wordAttributes.Word);

            string vowel      = wordAttributes.Vowel;
            string vowelSound = wordAttributes.VowelPhoneme;

            string teachModel = "Not every letter in a word makes a sound. In the following words, the " + SSML.SpellOut("e") +
                                " is silent but " + SSML.Excited("bossy", "medium") + ". ";

            teachModel += SSML.PauseFor(1);
            teachModel += " This means the bossy " + SSML.SpellOut("e") + " makes the other vowel say its name.";
            teachModel += SSML.PauseFor(1);
            teachModel += "Right now we are going to work with the vowel " + vowel;
            teachModel += SSML.PauseFor(1.5);
            teachModel += " A long " + SSML.SpellOut(vowel) + " makes the sound " + SSML.SayExtraSlow(SSML.Phoneme(vowelSound)) + ".";
            teachModel += SSML.PauseFor(1.0);
            teachModel += " Are your ready to learn some words with " + vowel;

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #11
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("ConsonantBlend", "Introduction", "WORD: " + wordAttributes.Word);

            string[] cBLetters  = wordAttributes.ConsonantBlend.Select(x => x.ToString()).ToArray();
            string   teachModel = "When consonants are stuck together and both make their sounds, we call that a consonant blend.";

            teachModel += SSML.PauseFor(.5);
            teachModel += "The letters still make their individual sounds.";
            teachModel += SSML.PauseFor(1.5);
            teachModel += "This blend is made up of these two letters:";
            teachModel += SSML.SayExtraSlow(cBLetters[0]) + " and a " + SSML.SayExtraSlow(cBLetters[1]) + ".";
            teachModel += SSML.PauseFor(1.5);
            if (SSML.cbPhoneme.TryGetValue(wordAttributes.ConsonantBlend, out string cbp))
            {
                teachModel += " The sound they make is " + SSML.PauseFor(.5) + SSML.SayExtraSlow(SSML.Phoneme(cbp));
            }
            teachModel += SSML.PauseFor(1.5);
            teachModel += " Are you ready to begin?";

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #12
0
        public SkillResponse TeachTheWord(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("LongVowels", "TeachTheWord", "WORD: " + wordAttributes.Word);

            string[] decodedWord = wordAttributes.Word.Select(x => x.ToString()).ToArray();
            string   vowelSound  = wordAttributes.VowelPhoneme;
            string   teachModel  = QuickReply;

            teachModel += SSML.PauseFor(1);
            teachModel += " The word is spelled ";
            teachModel += SSML.SpellOut(wordAttributes.Word);

            teachModel += SSML.PauseFor(1);
            teachModel += " Remember, the " + SSML.SpellOut("e") + " is silent and the " +
                          SSML.SpellOut(wordAttributes.Vowel) + " says its name. ";
            teachModel += SSML.PauseFor(1.0);
            teachModel += SSML.SayExtraSlow(wordAttributes.Word);
            teachModel += SSML.PauseFor(0.5);
            teachModel += "Now you try. Say the word ";

            return(AlexaResponse.TeachFlashCard(wordAttributes.Word, teachModel));
        }
예제 #13
0
        public SkillResponse Introduction(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("ConsonantDigraph", "Introduction", "WORD: " + wordAttributes.Word);

            string[] cdLetters  = wordAttributes.ConsonantDigraph.Select(x => x.ToString()).ToArray();
            string   teachModel = "When two consonants work together to make one sound, this is called a digraph.";

            teachModel += SSML.PauseFor(.5);
            teachModel += "Can you say digraph?";
            teachModel += SSML.PauseFor(1.5);
            teachModel += "The digraph we are learning now is made up of these two letters:";
            teachModel += SSML.PauseFor(1);
            teachModel += SSML.SayExtraSlow(cdLetters[0]) + " and a " + SSML.SayExtraSlow(cdLetters[1]) + ".";
            teachModel += SSML.PauseFor(1.5);
            if (SSML.cdPhoneme.TryGetValue(wordAttributes.ConsonantDigraph, out string cdp))
            {
                teachModel += " The sound they make is " + SSML.PauseFor(.5) + SSML.SayExtraSlow(SSML.Phoneme(cdp));
            }
            teachModel += SSML.PauseFor(1.5);
            teachModel += " Are you ready to begin?";

            return(AlexaResponse.Introduction(teachModel, " Please say yes to continue or no to quit"));
        }
예제 #14
0
        private SkillResponse AssessTheWord(WordAttributes wordAttributes)
        {
            string output = QuickReply + " Say the word";

            return(AlexaResponse.PresentFlashCard(wordAttributes.Word, output, CommonPhrases.TryAgain));
        }
예제 #15
0
        public SkillResponse TeachTheWord(WordAttributes wordAttributes)
        {
            LOGGER.log.INFO("SightWords", "TeachTheWord", "WORD: " + wordAttributes.Word);

            throw new NotImplementedException();
        }