Exemple #1
0
        private async Task <DialogTurnResult> AskQuestionDialogStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            // Read in the passed down values from the parent dialog
            ScoreState ss = stepContext.SetStateAs(stepContext.GetOptionsAs <ScoreState>());

            await stepContext.Context.SendTextActivity(
                $"Question {ss.GetCurrentPositionGame() + 1} coming up");

            await Task.Delay(2500);

            switch (ss.CurrentGame.GameType)
            {
            case "Maths":

                return(await stepContext.BuildNumberPrompt(ss.GetCurrentQuestion(), cancellationToken));

            case "Phonics":

                return(await stepContext.BuildTextPrompt(ss.GetCurrentQuestion(), cancellationToken));
            }

            return(await stepContext.BuildTextPrompt("Something went wrong here, you don't seem to be following one of our standard games", cancellationToken));
        }