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!


pageStop()

void pageStop()

This function prevents further contents of a questionnaire page being shown or executed.

Example

In the following example, pageStop() is combined with a screen out filter. This means further content (e.g. questions) can still be put on the screen out page.

The filter shows the text element “screenout” and hides the Next and Back buttons for people who answered question SK01 with value 1 (younger than 18) or 7 (older than 65). This means the questionnaire is effectively terminated.

Other elements (questions, PHP code, …) can be put on the page beneath this PHP code. They can also be put on the questionnaire page by drag & drop. pageStop() ensures these elements are no longer shown to participants who do not qualify.

if ((value('SK01') == 1) or (value('SK01') == 7)) {
  text('screenout');
  buttonHide();
  pageStop();
}

If pageStop() is not used, the other elements have to be included in the filter…

if ((value('SK01') == 1) or (value('SK01') == 7)) {
  text('screenout');
  buttonHide();
} else {
  question('AB01');
  question('AB02');
}

…or the content has to be inserted onto an additional page (after the current one) so that there is no more content on the page.

if ((value('SK01') == 1) or (value('SK01') == 7)) {
  text('screenout');
  buttonHide();
} else {
  goToPage('next');
}
en/create/functions/pagestop.1418402097.txt.gz · Last modified: 12.12.2014 17:34 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