unable to set parameters when context out from webhook - api.ai

Viewed 504

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:

enter image description here

view json of api.ai screen: enter image description 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)

enter image description here

api.ai screen: enter image description here

**api.ai screen json: ** enter image description here

0 Answers
Related