Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Skipping around in a survey

I need to be able to add a button or link to every page of my survey that, when pushed, takes people back to an index page at the beginning of the survey. I suppose you could do this with one survey that branches to other surveys, but I want to do it entirely within one survey. I don't care if respondents don't complete the entire survey, just the sections they choose to complete. I suspect that because you can use skip logic to jump around in a survey, it isn't rocket science to figure out how to do it. However, even though I once dated a rocket scientist, I am clueless. Any suggestions?
asked Apr 12, 2016 by JKincaid Bronze (800 points)
retagged Apr 13, 2016 by Walter Williams

1 Answer

0 votes
One way to accomplish this is with free format questions.  I created a free format question "FreeFormatQ," added a hidden variable "FreeFormatQ_Var," and then used this HTML:

<button id="toindex">Skip to Index</button>
<input name="FreeFormatQ_Var" id="FreeFormatQ_Var" type="hidden" value="0">

<script type="text/javascript">
$(document).ready(function(){
    $('#FreeFormatQ_Var').val(0);
    $('#toindex').click(function(){
        $('#FreeFormatQ_Var').val(1);
        $('#next_button').click();
    })
})
</script>


All that's left to do is to create a skip that triggers when FreeFormatQ_Var = 1.

Heads up: As this involves submitting the page, the skip will only occur if the respondent has answered all questions on the page that require a response.
answered Apr 12, 2016 by Zachary Platinum Sawtooth Software, Inc. (63,775 points)
Wow, that helps a ton, Zachary, thank you! I hadn't thought of the free format question approach. Now I just need to add dozens of free format questions the survey. Since I'm tight on the number of datafields, it is too bad you don't have something similar to your test survey with options overlay so I could just click on an link and have it skip to where I want it to go. That would be a cool feature!

If I get what you're doing here, then on my index page where I need to skip people around to about eight different places they will need to click on some text to skip someplace else. I suppose I can just use text instead of a button and then use a number of skip logic statements for those different items.

I appreciate your help!
Glad to hear it works.  I hadn't considered the problem with it using so many data fields.  I'll keep investigating to see if I can't lessen the number of fields involved.

I think your easiest option for the index question would be a simple select question with skips.  It will take one data field, same as using the free format.  If you would prefer buttons, though, you could achieve this with a modified version of the free format (still using only one field):

<button id="indexskip1">Skip #1</button>
<button id="indexskip2">Skip #2</button>
<button id="indexskip3">Skip #3</button>
<button id="indexskip4">Skip #4</button>

<input name="FreeFormatQ_Var" id="FreeFormatQ_Var" type="hidden" value="0">
 
<script type="text/javascript">
$(document).ready(function(){
    $('#FreeFormatQ_Var').val(0);
    
    $('#indexskip1').click(function(){ $('#FreeFormatQ_Var').val(1); })
    $('#indexskip2').click(function(){ $('#FreeFormatQ_Var').val(2); })
    $('#indexskip3').click(function(){ $('#FreeFormatQ_Var').val(3); })
    $('#indexskip4').click(function(){ $('#FreeFormatQ_Var').val(4); })
    
    $('#next_button').click();
})
</script>
...