- Posts: 4
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
9 years 1 week ago #118109
by lauriek334
How to reference the sub-question of a single answer radio button list was created 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
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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
9 years 1 week ago - 9 years 1 week ago #118110
by Ben_V
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)
Replied by Ben_V on 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}
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
9 years 1 week ago #118111
by lauriek334
Replied by lauriek334 on 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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
9 years 1 week ago #118112
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on 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 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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
9 years 1 week ago #118134
by Ben_V
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)
Replied by Ben_V on 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)
The topic has been locked.
- mascarpone
- Offline
- Premium Member
Less
More
- Posts: 133
- Thank you received: 6
8 years 6 months ago - 8 years 6 months ago #124247
by mascarpone
Replied by mascarpone on 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!
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: )
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.