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

More
3 years 7 months ago #118109 by lauriek334
lauriek334 created the topic: How to reference the sub-question of a single answer radio button list
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

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #118110 by Ben_V
Ben_V replied the topic: How to reference the sub-question of a single answer radio button list
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: 3 years 7 months ago by Ben_V.
The following user(s) said Thank You: lauriek334

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118111 by lauriek334
lauriek334 replied the topic: How to reference the sub-question of a single answer radio button list
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.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118112 by holch
holch replied the topic: How to reference the sub-question of a single answer radio button list
The manual is a wiki, anyone who can post here in the forum can adapt the wiki...

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118134 by Ben_V
Ben_V replied the topic: How to reference the sub-question of a single answer radio button list

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)

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #124247 by mascarpone
mascarpone replied the topic: How to reference the sub-question of a single answer radio button list
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: 3 years 1 month ago by mascarpone.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!