Esempio n. 1
0
    async def confirm_suspectedcasecontact_step(
        self, step_context: WaterfallStepContext
    ) -> DialogTurnResult:

        # Set the last contact date to a confirmed case to what they entered in response to the name prompt.
        self.FIRST_DATE = "value-firstDate"
        if step_context.result:
            step_context.values[self.FIRST_DATE] = str(step_context.result[0].value)
        else:
            step_context.values[self.FIRST_DATE] = None

        print("[DEBUG] First date is " + str(step_context.values[self.FIRST_DATE]))

        await step_context.context.send_activity(
            MessageFactory.text(
                "Finden wir heraus, ob Sie engen Kontakt zu einem Covid-19-Verdachtsfall hatten.")
        )
        #time.sleep(1)
        await step_context.context.send_activity(
            MessageFactory.text(
                f"Als enger Kontakt gilt Kontakt von Angesicht zu Angesicht länger als 15 Minuten, oder direkter, physischer Kontakt (Berührung, Händeschütteln, Küssen), oder Kontakt mit oder Austausch von Körperflüssigkeiten, oder Teilen einer Wohnung.")
        )
        #time.sleep(2)
        return await step_context.prompt(
            ChoicePrompt.__name__,
            PromptOptions(
                choices=[Choice("Ja"), Choice("Nein")],
                prompt=MessageFactory.text("Hatten Sie engen Kontakt zu einem **Covid-19-Verdachtsfall**?")
            ),
        )
Esempio n. 2
0
 async def icon_checkin_step(
         self, step_context: WaterfallStepContext) -> DialogTurnResult:
     return await step_context.prompt(
         ChoicePrompt.__name__,
         PromptOptions(
             prompt=MessageFactory.text(
                 "Overall, How are you feeling right now?"),
             choices=[Choice("💚"), Choice("💛"),
                      Choice("❤️")],
         ),
     )
Esempio n. 3
0
 def _to_choices(self, choices: dict) -> List[Choice]:
     """Converts the list of strings to the list of instances of Choice objects
         Args:
             choices (List[str]): list of strings to be converted
         Returns:
             List[Choice]: list of Choice objects which can now be passed to a prompt method.
     """
     choice_list: List[Choice] = []
     for key in choices:
         choice_list.append(Choice(value=key))
     choice_list.append(Choice(self.DONE_OPTION))
     return choice_list
Esempio n. 4
0
 async def DisplayChoiceList(self, waterfall_step: WaterfallStepContext):
     listofchoice = [
         Choice("MTech"),
         Choice("BTech"),
         Choice("MCA"),
         Choice("PhD")
     ]
     return await waterfall_step.prompt(
         (ChoicePrompt.__name__),
         PromptOptions(
             prompt=MessageFactory.text("Please select the your education"),
             choices=listofchoice))
 async def select_delivery_mode_step(
         self, step_context: WaterfallStepContext) -> DialogTurnResult:
     # Create the PromptOptions with the delivery modes supported.
     message = "What delivery mode would you like to use?"
     reprompt_message = (
         "That was not a valid choice, please select a valid delivery mode."
     )
     options = PromptOptions(
         prompt=MessageFactory.text(message, message,
                                    InputHints.expecting_input),
         retry_prompt=MessageFactory.text(reprompt_message,
                                          reprompt_message,
                                          InputHints.expecting_input),
         choices=[Choice("normal"),
                  Choice("expectReplies")],
     )
     return await step_context.prompt(
         self.select_delivery_mode_step.__name__, options)
Esempio n. 6
0
    async def confirm_confirmedcasecontact_step(
        self, step_context: WaterfallStepContext
    ) -> DialogTurnResult:

        await step_context.context.send_activity(
            MessageFactory.text(
                "Finden wir heraus, ob Sie engen Kontakt zu einem bestätigten Covid-19-Fall hatten.")
        )
        #time.sleep(1)
        await step_context.context.send_activity(
            MessageFactory.text(
                f"Als enger Kontakt gilt Kontakt von Angesicht zu Angesicht länger als 15 Minuten, oder direkter, physischer Kontakt (Berührung, Händeschütteln, Küssen), oder Kontakt mit oder Austausch von Körperflüssigkeiten, oder Teilen einer Wohnung.")
        )
        #time.sleep(2)
        return await step_context.prompt(
            ChoicePrompt.__name__,
            PromptOptions(
                choices=[Choice("Ja"), Choice("Nein")],
                prompt=MessageFactory.text("Hatten Sie engen Kontakt zu einem **bestätigten Covid-19-Fall**?")
            ),
        )
    async def select_skill_step(
            self, step_context: WaterfallStepContext) -> DialogTurnResult:
        # Set delivery mode.
        self._delivery_mode = step_context.result.value
        await self._delivery_mode_property.set(step_context.context,
                                               step_context.result.value)

        # Create the PromptOptions from the skill configuration which contains the list of configured skills.
        message = "What skill would you like to call?"
        reprompt_message = "That was not a valid choice, please select a valid skill."
        options = PromptOptions(
            prompt=MessageFactory.text(message, message,
                                       InputHints.expecting_input),
            retry_prompt=MessageFactory.text(reprompt_message,
                                             reprompt_message),
            choices=[
                Choice(value=skill.id)
                for _, skill in sorted(self._skills_config.SKILLS.items())
            ],
            style=ListStyle.suggested_action)

        return await step_context.prompt(self.select_skill_step.__name__,
                                         options)