I'm working with a quiz chatbot, first it will ask user for his name, roll number and passcode, then start asking quiz questions one by one
problem is when i'm doing context out from webhook with some parameters, what i want to set is question index when i'm doing context out after authentication i will set question index to zero, and then increment it on every quiz question, i want to keep track on what question user is with questionIndex parameter
context out from webhook(code snippet):
var fulfilment = {
speech: "you are authenticated, say start quiz to start",
contextOut: [
{
"name": "input-name-rollnumber",
"lifespan": 0,
},
{
"name": "quiz",
"lifespan": 10,
"parameters": {
"questionIndex": 0,
"name": "inzi"
}
}
]
}
console.log("response: ", fulfilment);
response.json(fulfilment);
after sending context out from webhook, api.ai screen is here:
then if i said "yes start quiz", it goes to server I'm not getting that parameters there
have a look of webhook: (here i want to increment in question index and send it back for another question)




