Check out the LimeSurvey source code on GitHub!

Change question mix for different subsets of the overall survey?

More
5 years 6 months ago - 5 years 6 months ago #64387 by stevek23
Can we divide our respondents into groups and give them different questions?

For instance... if we invite 2000 prospects and then get 500 responses..

..could we divide those 500 actual respondents into 5 groups and have each 100 participants get a somewhat different question set?

Ideally the initial questions at the top of survey would be same for all 5 groups of respondents.. but later questions would be different depending on which block of 100 they are in.

This might work easily if an auto increment ID could be assigned to each respondent.. ie each respondent gets a unique number .. the first 100 get Question set 1.. the next 100 get question set 2.. etc.. but its all part of the same survey for reporting purposes..

Thanks much! Steve
Last Edit: 5 years 6 months ago by stevek23. Reason: typo

Please Log in to join the conversation.

More
5 years 6 months ago #64388 by atiut
Use token attributes to register the variations for each token, and then send invitations to unique IDs. Then insert the attribute field in your question text.

A token attribute field can store a word, a phrase, a Youtube ID (tested!) or an image URL(not tested!).

If you have an anonymous survey or public registration, you will likely need to program 4 surveys and imagine some kind of redirect

Please Log in to join the conversation.

More
5 years 6 months ago #64389 by stevek23
Thank you for the helpful answer. Token attributes could help a lot..

So I guess the real question is: how do we use ID and/or token attributes to divide respondents into equal sized groups after they respond?

If we divide users into question groups before we send invites.. the respondent groups may not be the same size..

Thanks

Please Log in to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #64390 by atiut
1. create an ID for each group in the attribute fields (say group1 to group4)

2. create a hidden question that will auto-fill with the group ID (look up the forum/documentation to see how it's done, i have never done it but others have)

3. set quotas to that question

you will not be able to re-direct from a full group to an empty group, but it is better than manual management.

Anyways, let me know how it works
Last Edit: 5 years 6 months ago by atiut.
The following user(s) said Thank You: stevek23

Please Log in to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #64411 by tpartner
Using JavaScript, you should be able to:

1) Get the "Response ID" using the {SAVEDID} placeholder (see - docs.limesurvey.org/The+template+editor&...+LimeSurvey#Keywords )

2) Do some math to see if it is evenly divisible by 2, 3, 4 or 5

3) Load the result into a hidden question

4) Display the appropriate follow-up questions using conditions

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 5 years 6 months ago by tpartner.

Please Log in to join the conversation.

More
5 years 6 months ago #64438 by stevek23
@tpartner.. thanks for the excellent thinking.. this would allow us to rotate question groups for each new respondent sequentially with simple math..

but when I go to the page you referenced, I don't see Response or Save ID tokens or variables.... please advise

Steve

Please Log in to join the conversation.

More
5 years 6 months ago #64449 by tpartner
Oh, I guess that placeholder isn't listed there.

{SAVEDID} will return the "Response ID" from the database providing:
- The survey is active
- At least one question page has been submitted

So, if you want to load your "respondent group number" into a text question and then hide it for use with conditions you could:

1) Set up your survey to use JavaScript .

2) Create your text question in at least the second page of the survey (don't hide it with advanced settings - we'll do it with JavaScript). If you need the hidden question on the first page of questions, you can move your welcome message to a text-display question in the first page (group) and then use survey properties to skip the welcome screen. This effectively turns page 1 of questions into page 2 of the survey.

3) Add the following script to the source of the hidden question. Replace "QQ" with the hidden question ID .
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var qHiddenID = QQ;
		var savedID = '{SAVEDID}';
 
		// Hide the hidden question
		$('#question'+qHiddenID+'').hide();
 
		// Generate a "group number" from the savedID
		var group = (savedID % 5);
		if(group == 0) {
			group = 5;
		}
 
		// Load the hidden question
		$('#question'+qHiddenID+' input.text').val(group);
 
	});
 
</script>

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.

More
5 years 6 months ago #64453 by atiut
OFFTOPIC: Hmm, are there other placeholders that are not listed? And, om a different note, can we create our own placeholders in the configuration files....?

Please Log in to join the conversation.

More
5 years 6 months ago #64455 by stevek23
we have been making good progress with this code..

one quick follow up question: what's the best way to hide a whole question group with the same response ID approach ?

ie.. in this case we would have several question groups to rotate through..

thanks much

Please Log in to join the conversation.

More
5 years 6 months ago #64484 by tpartner

Hmm, are there other placeholders that are not listed?

This placeholder is actually listed as a Token Email Placeholder . I found it also works in the survey while developing another workaround. I'll update the wiki when I get a chance.

And, om a different note, can we create our own placeholders in the configuration files....?

No but TMSWhite is introducing the Expression Manager Module (hopefully in v1.92) which may suit your needs.

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.

More
5 years 6 months ago #64486 by tpartner

...what's the best way to hide a whole question group with the same response ID approach ?

The group will be automatically hidden if all questions in the group are hidden by conditions. (watch out for chained conditions )

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: stevek23

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form