How can I get using the API the questions and answers in the right order?

More
6 years 10 months ago #99335 by mike01
How can I get using the API the questions and answers in the right order?

I am trying to use the list_questions method but by far this is not working fine.

Any help?

Thanks !

Please Log in to join the conversation.

LimeSurvey Partners
More
2 months 6 days ago #198877 by Pharez
Hey man, really late to the party and hope you aren't still stuck on this question just decided to reply as I have been stuck on this for the best part of a week but I now know how to do this. You need to get question properties and groups for this to work. First populate an array with only parent questions and sort the parent questions by group_order - which you can link by using the questions gid property matching in your array of groups. Then sort the sub questions based on their respective question_order but make them separated by parent_qid. Finally, put the sub questions immediately after their respective parents in your now sorted array.
For some reason they seem to sort questions by a mixture of qid and parents but this rarely works as the qid is the order questions were created in and not necessarily the final order the user wanted.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now