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


int loopPage(int startValue, int endValue, [int increment])

int loopPage(int repetitions)

mixed loopPage(array elements)

Repeats the page – beginning with the start value – in a loop as often as it takes until the end value is reached. The current value is returned each time.

  • startValue
    value on the first pass
  • endValue
    value on the last pass
  • increment
    (optional) change in value on every loop pass (standard: 1) – you can create an endless loop with the increment 0, which can be terminated using setNextPage('next').

If only a nummeric parameter (repetitions) is specified the page will repeat as often as determined. The counter variable begins with 0 in this instance.

  • repetitions
    number of repetitions

Note: To repeat more than one page, please use loopToPage().


// PHP code on the first page in the questionnaire
// create, shuffle and cache list with questions 
$questions = array(
  'AB01', 'AB02', 'AB03',
  'AB04', 'AB05', 'AB06'
// PHP code later in questionnaire
$i = loopPage(6);  // 6 repetitions - equivalent to loopPage(0,5)

Note: As the same page is shown repeatedly, the response times for all repetitions are added up. You have to use multiple pages instead of loopPage() if you want to collect the processing times separately.

// PHP code later in questionnaire - page 21
// PHP code on page 22
// and so on.
// PHP code on page 26
en/create/functions/looppage.txt · Last modified: 26.08.2020 22:33 by sophia.schauer
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki