This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:
 

This is an old revision of the document!


Table of Contents

setNextPage()

void setNextPage(string pageID)

The function setNextPage() determines which page should be shown after “Next” is clicked on. Subsequent pages will not be displayed anymore with setNextPage('end'). Instead, the questionnaire ends after “Next”.

  • pageID
    ID of the page in the questionnaire which will be jumped to. This can be the ID of a page in the questionnaire, or one of the special IDs 'end', 'next', or 'repeat'.
    • <Page ID> – Continue to a particular page in the questionnaire
    • 'end' – Ends the survey
    • 'next' – Proceeds to the next page (default)
    • 'repeat' – Repeats the current page

Tips

This function is particularly useful if a filter does not take effect immediately after the filter question. The filter (that cannot be on the same page as the filter question) can then be put on an interim page. An advantage of doing this is that the processing time of the following page is stored in the TIMEnnn variable (Additional Variables in the Data Set) for the respective page – this is not guaranteed with goToPage().

Note: Do not use setNextPage() to display the current page repeatedly in a loop. This only creates problems with a potentially available “Back” button. The function loopPage() exists for this purpose.

Note: Do not use setNextPage() to redisplay a page due to the participant providing incorrect information (Check Responses: Customized Response Check). Use the function repeatPage() instead.

Tip: If the participant should skip pages in the questionnaire, the function goToPage() is normally easier to use.

Tip: The order of which the pages will appear thereafter can also be determined with the function setPageOrder(); not just the next page.

Example

The following example assumes that the filter question “AB01” was asked on page 2 of the questionnaire. The following PHP code on page 4 ensures that participants who selected the first response option skip pages 5 to 7, and continue the questionnaire only from page 8 (ID “tv_use”) onwards.

if (value('AB01') == 1) {
  setNextPage('tv_use');
}
en/create/functions/setnextpage.1422103102.txt.gz · Last modified: 24.01.2015 13:38 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki