======Randomization: Pages====== In case you want to randomize full pages this can be realised with [[:en:create:php|PHP-Code]]. This guide describes how to send the respondent through the questionnaire in one of three possible ways, depending on a random draw. **Tip:** Start with the instruction [[:en:create:rotation-pages]]. This instruction discribes different application cases step for step. The The inclusion of the PHP code described here is already the 2nd step of the randomization. Make sure you read the chapter [[en:create:randomization-php|]] first. It describes how to create the [[en:create:questions:random]] for random selection and where to place the PHP code on the page. If the order of questions is to be varied in a more complex way, filters can quickly become confusing. In this case the PHP function ''[[:en:create:functions:setpageorder|setPageOrder()]]'' may help. With this function the sequence of the page can be varied. To use this feature, please also read about [[:en:glossary#page_ids|page identifiers]]. In the following example, the function ''setPageOrder()'' -- depending on the random draw -- is called with different page orders. // The random number rolled via RG01 $number = value('RG01'); // Depending on the draw, one of three paths is used if ($number == 1) { setPageOrder('q1','q2','mainStart-mainEnd','q3'); } elseif ($zahl == 2) { setPageOrder('q1','mainStart-mainEnd','q2','q3'); } else { setPageOrder('q2','q1','mainStart-mainEnd','q3'); } Further instructions and examples can be find in the reference to the function ''[[:en:create:functions:setpageorder|setPageOrder()]]''.