How to make Alexa ask a list of questions one by one and get a response from a predefined set of responses.
Hello,
I am developing an Alexa Skill to fill out a survey. Following are the components of the survey.
1. list_of_persons: We have a list of persons who can fill this survey.
2. list_of_questions: The survey has a set of questions which need to be answered by a person selected from the "list_of_persons"
2a. list_of_responses: Each question has a set of valid responses, a person(user) must select from this set of responses for a given question.
e.g. There are 10 questions and each of them has their own set of responses.
I have the following REST APIs which will fetch me the required list.
/persons : will get me the list_of_persons
/questions: will get me the list_of_questions
/questions/{id}/responses : will get me the list_of_responses for a question with given "id"
e.g: /questions/7/responses: will get me the list of responses associated with the question with id 7.
/questions/10/responses: will get me the list of responses associated with the question with id 10.
/survery : This is a POST API which will post the "person_name", "question" and its "response" to the backend(db).
Sample interaction:
#Currently working
# Invoking the skill
User: Alexa open survery skill
Alexa: "Welcome to the Alexa Survey Skill ....etc "
User: get list of persons
Alexa: 1. John Doe, 2. Jane Doe, etc...
#Req1: This is pending#
User: Start survey for John Doe with id 1.
Alexa: Ok, lets start!
Alexa: Here is a list of questions
Alexa: Question 1: How was your day?
Alexa: Here are the valid set of responses for Question 1
Alexa: 1. It was amazing
2 It was good
3 It was ok
4. It was bad
Alexa: Choose a response or response id
User: 1
or
User: It was amazing.
Alexa: Alright, moving to next question.
Alexa: How do you feel about your daily work routine?
Alexa: Here are the valid set of responses for Question 2.
Alexa: 1. It's perfect, well balanced.
2. It's slightly challenging, but manageable
3. It's hectic and needs improvement.
4. It's terrible and I need a break.
......etc
This should continue for all 10 questions. And at the end Alexa should read out all questions and the selected response to get confirmation and submit the "survey" for that person using /surveyAPI
How do I manage the Req1 transaction with Alexa, I have my lambda function in Python 3.6 and have read about dialog directive but I have no clue how to tie/connect all of this together.
Please help.
I can share my lambda_function if required.