Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

problem with multiple choice and array questions SGQA in database

  • bellagambad
  • bellagambad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 1 week ago - 2 months 1 week ago #256646 by bellagambad
LimeSurvey version: 5.4.3.+
Own server or LimeSurvey hosting: own server
Survey theme/template: custom fruity
==================
Hello LS community,

My organization wants to build a dashboard on safety culture (healthcare setting) based on a longitudinal survey. So I need to be able to refresh data directly from databases, as opposed to manual extraction from LimeSurvey. With MySQL queries, I have access to all the tables described here . My problem concerns multiple choice questions and arrays. With the SGQA identifier, I can find the label of the question in the table 'lime_question_l10ns' but I cannot find the labels of multiple choice options or subquestions in other tables. They seem to be in the same table, with a qid that I cannot find in the 'lime_survey_######' table. Here are four headers of a same question (qid 5988) which represent subquestions of an array question, found in the 'lime_survey_822716' table :

822716X468X5988Q7    822716X468X5988Q8    822716X468X5988Q9    822716X468X5988Q10

In the 'lime_question_l10ns' table, I can find the qid 5988, but the Q7, Q8, Q9 and Q10 subquestions are nowhere to be found. There seem to be qid with the correct labels (6260 to 6263) but I cannot find a key to join the tables and decode the subquestions: Q7 isn't 6260, Q8 isn't 6261 and so on.
Does anyone know what I am missing ? Please tell me if I need to provide more information.

Thank you in advance,

David
 
Last edit: 2 months 1 week ago by bellagambad. Reason: formatting and title

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 1 week ago #256811 by tpartner
Q7 is the subquestion code, not the ID.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • bellagambad
  • bellagambad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 1 week ago - 2 months 6 days ago #256825 by bellagambad
Yes absolutely, and that's my problem. The 'lime_survey_######' table only show the code of the subquestion (array) or of the option (multiple choice), not the id. how can I find the id ?
EDIT : I finally found a solution. So if you're having the same problem as I did, in 'lime_survey_######' you have the SGQA identifier with the subquestion code (array) or option code (multiple choice). In 'lime_questions', you can find those options or subquestions in the 'title' column. So the key in 'lime_questions' is 'parent_qid' + 'title'.

An example : 
in 'lime_survey_822716' I can find the header 822716X468X5988Q9 (a subquestion of an array). 
in 'lime_questions' I can find 'parent_qid' = 5988 and 'title' = Q9, with a corresponding 'qid' = 6262
So I can go back the the 'lime_question_l10ns' and now I have the question label.
Last edit: 2 months 6 days ago by bellagambad. Reason: found a solution

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose