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.
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.
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' ); shuffle($questions); registerVariable('questions');
// PHP code later in questionnaire $i = loopPage(6); // 6 repetitions - equivalent to loopPage(0,5) question($questions[$i]);
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 question($questions[0]); // PHP code on page 22 question($questions[1]); // and so on. // PHP code on page 26 question($questions[5]);