Welcome to the LimeSurvey Community Forum

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

How to reference the sub-question of a single answer radio button list

  • lauriek334
  • lauriek334's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 week ago #118109 by lauriek334
I cannot get the syntax correct in order to reference the first sub-question of a list-item question with two subquestions answers.
surveyID = 913529
GroupID = 34
QuestionID = 343
Subquestion answer #1: A1
Subquestion answer #2: A2

Here's a couple of examples of the last part of the End URL I have tried:

?q1_answer={INSERTANS:913529X34X343A1}
?q1_answer={INSERTANS:913529X34X343A1.shown}

I keep getting a red box outlining this as an invalid variable when I test the survey and hit the submit button.
I've reviewed the Expression Manager and QCode Variable naming but am very confused.
Any pointers would be much appreciated.

ps. I'm running Version 2.05+ Build 141229
The topic has been locked.
More
9 years 1 week ago - 9 years 1 week ago #118110 by Ben_V
1) Use the question code (defined by you) rather than Question ID (defined by the system)
2) Forget {INSERTANS:xxxXxxXxx}

If "QQ" is the question code for QuestionID = 343

For basic radio question:
{QQ.shown} (display or grab the given response)

For arrays:
Answer to your 1st subquestion: {QQA1.shown}
Answer to your 2nd subquestion: {QQA2.shown}

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 9 years 1 week ago by Ben_V.
The following user(s) said Thank You: lauriek334
The topic has been locked.
  • lauriek334
  • lauriek334's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 week ago #118111 by lauriek334
This worked! thank you.
The documentation for End of Survey URL Fields only describes how to use the {INSERTANS:SGQA} mechanism. It would be worth updating it to mention that the QCodes could be used instead.
It would be worth noting that the answers of a list question with radio buttons can only be accessed using the QuestionCode mechanism.
e.g. {QQ.shown} where QQ is the question code.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 week ago #118112 by holch
The manual is a wiki, anyone who can post here in the forum can adapt the wiki...

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
9 years 1 week ago #118134 by Ben_V

lauriek334 wrote: It would be worth noting that the answers of a list question with radio buttons can only be accessed using the QuestionCode mechanism.


For the moment both syntax are working. "QuestionCode mechanism" is only easier and helps to avoid typo...

{INSERTANS:913529X34X343} <=> {QQ.shown}
{INSERTANS:913529X34X343A1} <=> {QQA1.shown}

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
More
8 years 6 months ago - 8 years 6 months ago #124247 by mascarpone
Hi Ben, Folks,

Any idea whether comments of a "multiple choice with comments" question can be referenced in another question?

Thanks!

Ben_V wrote: 1) Use the question code (defined by you) rather than Question ID (defined by the system)
2) Forget {INSERTANS:xxxXxxXxx}

If "QQ" is the question code for QuestionID = 343

For basic radio question:
{QQ.shown} (display or grab the given response)

For arrays:
Answer to your 1st subquestion: {QQA1.shown}
Answer to your 2nd subquestion: {QQA2.shown}


Hmmm read a bit more about EM, etc. and doesn't seem to be an option (I'm probably the only one thinking to do that as well... :lol: )
Last edit: 8 years 6 months ago by mascarpone.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose