Ravi Bhandari
Ravi Bhandari

Reputation: 4698

Lime Survey Submit answer from Android app

In an Android app i have implement LimeSurvey,in which list of different Survey are displayed from lime survey admin panel. I am able to display questions of a survey but not getting any structure to submit user answer's of survey to LimeSurvey database. Any one can please help me how can i submit answer and in what structure lime survey accept response of survey.

As document suggest to add response in format -

sSessionKey (string) - The session key

iSurveyID (integer) - The survey id

aResponseData (array) - array/structure containing your response data

so my query is what the structure for aResponseData (array) , so it properly store in lime survey database.

Edit:

How to add answer of sub-questions.I am able to submit answer of simple question but how to send answer of subquestion and in Survey question type-L(List of radio with comment)how to submit comment.

Thanks in advance.

Upvotes: 3

Views: 1444

Answers (2)

oscar.rpr
oscar.rpr

Reputation: 678

The only way I found to solve this was downloading the .sql database backup from the main taskbar and look for your table, which is *lime_survey_IDSURVEY*, and check for the columns which match with your questions, and use them for your mapping in the aResponseData. I'll leave you an example of that:

{"method": "add_response", "params": {"sSessionKey ": "ey2bv8v7zaw7uwj6fa9a8mmx9xqiikja", "iSurveyID ": 588636, "aResponseData ": {"588636X1X1":"Aja","588636X1X22":"Y" } }, "id": 1}

This will be the JSON that I send with my POST request, where 588636X1X1 is a column that match with a question, and "Aja" is the answer (in that case is a text-string), meanwhile, the other one, it's the same but it's a multiple choice question. As you can see, there is a pattern for the column names, 588636 it's my survey ID, X1 it's the group of the question, and X1 it's the ID for my question.

Hope it's useful.

Upvotes: 4

Amit Kumar
Amit Kumar

Reputation: 97

You should be using the limesurvey remote control feature to call the webservices api for various tasks you want to perform: add_response in this case . Its documentation is here


--
amit

Upvotes: 1

Related Questions