prathamudeshmukh / friends-quiz

Simple personalized quiz for friends :)
0 stars 1 forks source link

Add CreateQuiz controller #8

Open prathamudeshmukh opened 6 years ago

prathamudeshmukh commented 6 years ago

/create-quiz This endpoint should accept:

POST: { "profileId": "123", "quiz": { [{ "question": "What is my favourite pet?" "choices": [ "Dog","Cat" ], "answer": ["Cat"] }, { "question": "What is my favourite color?" "choices": [ "Red","Yellow" ], "answer": ["Yellow"] }] } }

anandchaugule commented 6 years ago

Hello @prathamudeshmukh I have slighted changed the structure of json for create the question Please follow the herewith new json format

1. Single option answer question json format

{ "profile_id": "0001", "question": { "what is your fav color ? ": [ { "choice": "Red", "isAnswer": "No" }, { "choice": "Blue", "isAnswer": "No" }, { "choice": "Yellow", "isAnswer": "Yes" }, { "choice": "White", "isAnswer": "No" } ] } }

2. Multi choice answer question json format

{ "profile_id": "0001", "question": { "what is your fav color ? ": [ { "choice": "Red", "isAnswer": "No" }, { "choice": "Blue", "isAnswer": "No" }, { "choice": "Yellow", "isAnswer": "Yes" }, { "choice": "White", "isAnswer": "Yes" } ] } }