As part of our core randomization options, you have the ability to display x number of random questions on the page. Unfortunately, there is not a built-in way to do the same with pages in a survey. Never fear! Fortunately, it's pretty easy to script. We'll cover the steps to use a pretty simple script to accomplish just this. These steps assume a basic familiarity with SurveyGizmo and programming.
See this script in action in an example survey.
OR
Add a survey with this setup to your account!
Features and functions used in this script:
The Script and Setup
Set up your survey pages as you wish. This script supports static pages throughout the pages that are being randomized.
For our example, we're conducting a community services survey. The survey has an initial page where we collect demographic information from the respondent and a thank you page. These pages will always display to each survey respondent.
Following the initial page, there are four pages where we collect information about the following four community services:
- waste collection (page ID 3)
- recycling program (page ID 4)
- city parks (page ID 5)
- dog parks (page ID 6)
In the interest of reducing respondent fatigue and survey abandonment and ultimately getting better data, we only want to burden each respondent with responding to two of the four community services pages.
To set this up we added a custom script action to the initial page (which everyone will see) and pasted the below script.
--Pages to be randomly hidden go here. Make sure they are comma separated, no spaces.
pagesHideRan = {3,7,5,6}
--Amount of pages you want shown from the list above. No quotes or commas are needed.
shown = 2
--Do not change after this line.
shuffled = tableshuffle(pagesHideRan)
for key,page in pairs(shuffled) do
hidepage(page,true)
end
for i=1, shown do
hidepage(shuffled[i],false)
end
Required Customizations
In the script above you will need to customize the following variables in order to make the script work in your survey:
- pagesHideRan - PageIDs of the pages you wish to be randomized. Not sure where to get your IDs?
- shown - Number of random pages you wish to show.
Scripting and Other Custom Solutions
We’re always happy to help you debug any documented script that is used as is. That said, we do not have the resources to write scripts on demand or to debug a customized script.
If you have customization ideas that you haven't figured out how to tackle, we're happy to be a sounding board for SurveyGizmo features and functionality ideas that might meet your needs. Beyond this, check out our Professional Services; these folks have the scripting chops to help you to achieve what you are looking for!
Admin
— Dave Domagalski on 08/29/2019
@Bonnie: Thank you for your question!
In general, this example script was not designed with logic in mind. Having said that, depending on where in your survey the logic is placed, it may not cause issues.
Ultimately, it is likely something that you will need to test with your specific scenario to see if this script will cooperate with your survey's logic settings.
My apologies for the ambiguous answer, but I hope this helps!
David
Technical Writer
SurveyGizmo Learning & Development
— Bonnie on 08/29/2019
Hi there, What if the pages they see is dependent on their previous answers? Will it work okay if the page logic is set to show to only those who responded accordingly? Will those be skipped? Thank you!
Admin
— Bri Hillmer on 09/14/2018
@Willem: Yes, in order to contain the randomization like you describe you would need to run multiple randomization scripts.
I hope this helps!
Bri Hillmer
Documentation Coordinator
SurveyGizmo Customer Experience Team
— Willem on 09/14/2018
Hey. We're trying to run multiple page randomization scripts for one survey. We have multiple sections which chronologically follow purchase funnel stages. Per stage we want only want to show 'x' pages, do we need to run a script for each stage?
Admin
— Bri Hillmer on 06/14/2018
@Zoe: Logic trumps randomization so you would need to remove any logic that might interact with randomization or modify the script to include the logic. Our Programming Services team can help with customizations like this for a fee. You can learn more here:
https://www.surveygizmo.com/programming-services/
Bri Hillmer
Documentation Coordinator
SurveyGizmo Customer Experience Team
— Zoe on 06/14/2018
Hi - we have a multi-select list where we ask for awareness of a series of brands, and then for each brand they're aware of we'd like to ask a follow up question. If participants are aware of all the brands, there will be too many follow-up questions, which is why we want to use this function to limit the number of follow-up questions they see.
Will the script take the logic on each of the follow-up questions into account when determining which pages participants are shown, or do we run the risk that those who are only aware of a couple of brands end up not being shown any of the follow-up questions (because the script has randomly selected questions that they are excluded from answering by the logic)?
Thanks!
Admin
— Bri Hillmer on 04/17/2018
@Varumärkesgruppen: By non-static pages do you mean you wish to also shuffle the page order as well? We do not recommend using this script in combination with the built-in randomization features however, the script shuffles the order as well!
I hope this helps!
Bri Hillmer
Documentation Coordinator
SurveyGizmo Customer Experience Team
— Varumärkesgruppen on 04/17/2018
Hi!
Very helpful article! Is it possible to do this with non static pages as well?
Many thanks!
Admin
— Dave Domagalski on 01/29/2018
@Mourad.boudia: Thank you for your question!
This example uses a randomization function which means that the result is truly random.
Becuase the result is truly random, there is not a way to ensure that each page/question is shown exactly the same number of times.
There may be some additional custom options that you could explore with our Programming Services Team if you are interested:
https://www.surveygizmo.com/programming-services/
I hope this helps!
David
Documentation Specialist
SurveyGizmo Customer Experience
— Mourad.boudia on 01/29/2018
Hello,
In the randomized pages process, do we have anyway to ensure a good balance between the questions displayed. Let say if we have three questions to test randomly, is it possible to ensure that we have them equitably displayed (1/3 for each)
Thanks
Mourad
Admin
— Bri Hillmer on 09/29/2015
@Renanthome10: Your best bet is to use our built-in randomize page feature. Here is a tutorial with more info:
http://help.surveygizmo.com/help/article/link/randomize-pages
Thanks for checking out our documentation!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Renanthome10 on 09/29/2015
Hi, i'm not an english speaker, so i'll try my best:
i have about 250 (audio) stimuli to my survey, but i want each respondent to listen 50 of them (in random order), some of them i need all respondents to listen (and they must be randomized too). Is it possible to do that? If so, it can be done by this custom shown above?
thank you.
Admin
— Bri Hillmer on 09/18/2015
@Minke: You can simply modify the %%shown value of the script!
I hope this helps!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Minke on 09/18/2015
In the above explanation, you will see random two pages of the answers you gave in the checkbox question. But how about when you want to show three or four pages randomly selected from what you answered in a previous multiple response question?
Minke
Admin
— Bri Hillmer on 06/05/2015
@Pike: Thanks for checking out our documentation! I'm so happy to hear this helped!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Pike on 06/04/2015
This was extremely useful. It added a great deal of power to my survey design with this simple step.