Radio list labels based on previous answers

More
11 months 1 week ago #176371 by EdenResident
Hello, I'd like to create a survey that works like this.

A1. Please enter the names of the household members (multiple text input)
Person 1: [Textbox]
Person 2: [Textbox]
Person 3: [Textbox]
...

Person 10: [Textbox]


B1. Please select which HH member you would like to interview (Radio list)
  • Name of person 1 entered from A1
  • Name of person 2 entered from A1
  • ...
  • Name of person 10 entered from A1

Please let me know if this is possible. Thanks.

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

LimeSurvey Partners
More
11 months 1 week ago #176382 by jelo
LimeSurvey is currently lacking answer relevance (multichoice answers are subquestions, which already have sub-question-relevance). You could use a multi-choice question with a answer limit of 1 (which would be the same as a radio button question) instead.

Displaying the entered text in a different question is not the problem.

There might be other workarounds, but the answer-relevance is overdue.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: EdenResident

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

More
11 months 1 week ago #176387 by EdenResident
Hi jelo, thanks for the workaround. That works great for me. I have another question if you don't mind.

So after the user selects the member he wants to interview (from the multiple choice), I want to get and store that name. Provided that my variables are coded like this

A1:
PERSON
01 (subquestion)
02
...

B1:
SELECTEDPERSON
01 (subquestion - multiple choice)
02 (subquestion - multiple choice)
..

Then, to get the name of the selected person, I'd assume that the syntax would be like this {PERSON_{SELECTEDPERSON}}

However, the nesting of variables obviously didn't work for me. So, is there like an eval function in Limesurvey?

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

More
11 months 1 week ago #176391 by jelo
Start reading from here:
manual.limesurvey.org/Expression_Manager#Access_to_Variables

Implemented functions in ExpressScript (still called Express_Manager):
manual.limesurvey.org/Expression_Manager#Access_to_Functions

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

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

More
11 months 1 week ago #176394 by tpartner
You can use nested IF statements to display the value from the first question. So, given the question and sub-question codes indicated above, something like this (line-breaks inserted for clarity):

{if(!is_empty(SELECTEDPERSON_01), PERSON_01, 
	if(!is_empty(SELECTEDPERSON_02), PERSON_02, 
		if(!is_empty(SELECTEDPERSON_03), PERSON_03, 
			if(!is_empty(SELECTEDPERSON_04), PERSON_04, 
				if(!is_empty(SELECTEDPERSON_05), PERSON_05, '')))))}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: EdenResident

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

More
11 months 1 week ago - 11 months 1 week ago #176395 by tpartner
Regarding using a multiple-choice question with maximum answers of 1 to replicate a radio question, you can insert this script in the question source to automatically uncheck other options as options are checked.

<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Listener on the checkboxes
		$('input:checkbox', thisQuestion).on('change', function(e) {
			if($(this).is(':checked')) {
				$('input:checkbox', thisQuestion).not(this).prop('checked', false).trigger('change');
			}
		});
	});
</script>

Here is a small sample survey incorporating both of these concepts:

File Attachment:

File Name: limesurvey...4872.lss
File Size:23 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:
Last edit: 11 months 1 week ago by tpartner.
The following user(s) said Thank You: EdenResident

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

More
11 months 1 week ago #176402 by jelo
Tony, since I forgot to ask the thread-starter what LS version is in use, we should add that your nice workaround is for LS 3.X.

That answer-relevance is not available in LS3 and LS4 as well, is a pity (or more).

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: tpartner

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

More
11 months 1 week ago #176406 by holch
Answer option relevance now!

;-)

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
11 months 1 week ago #176451 by EdenResident
Thanks, tpartner. I was able to do that with nested ifs.

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!