Welcome to the LimeSurvey Community Forum

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

[SOLVED] Generate a list of questions by question group?

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #233286 by blocka
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.32+221011
Own server or LimeSurvey hosting: Own
Survey theme/template: Vanilla
==================
I'm looking for a method to export a list of all the questions in a survey, grouped by question group, and including question code. Need this as a helpful reference for reviewing CSV exported responses.
Basically, looking for a report like:

Group 1 title
[Q1} text of the question
[Q2] text of this question
[Q3] text of question 3
Group 2 title
[Q4} text of the question
[Q5] text of this question
etc...

Where the question code is rendered between the square brackets.

Is there a way to do this?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 months ago #233290 by tpartner

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.

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago - 2 years 3 months ago #233292 by blocka
I suck at SQL (lol)... I can run this query:
SELECT type,gid,title,question FROM `lime_questions` where sid = 975285 and type <> "T" order by gid

But ideally I'd like gid to be replaced with the column "group_name" from the _groups table...

Anyone smarter than me that can provide the query?
Last edit: 2 years 3 months ago by blocka.

Please Log in to join the conversation.

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 3 months ago #233311 by blocka
For anyone who has access to mySQL, here's a query that will return group name, question code, and question text:
Code:
SELECT hq.type, hg.group_name, hq.title, hq.question
    FROM `lime_questions` hq
        INNER JOIN `lime_groups` hg ON hq.gid = hg.gid
    WHERE hq.sid = 999999 and hq.type NOT IN ('T')
    ORDER BY hg.group_name

Replace 999999 with your survey ID.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose