This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:rotation [26.01.2015 07:12] – alexander.ritter | en:create:rotation [01.04.2019 15:07] – [Rotation of Multiple Questions] bryton | ||
---|---|---|---|
Line 87: | Line 87: | ||
// cache rotation in case page is repeated | // cache rotation in case page is repeated | ||
registerVariable(' | registerVariable(' | ||
- | // go through list of questions ID for ID | + | |
- | // and show corresponding question each time | + | } |
- | foreach ($questions as $id) { | + | // go through list of questions ID for ID |
- | question($id); | + | // and show corresponding question each time |
- | } | + | foreach ($questions as $id) { |
+ | question($id); | ||
} | } | ||
</ | </ | ||
**Advice:** If you use a similar rotation at different points within the questionnaire then the name of the variable '' | **Advice:** If you use a similar rotation at different points within the questionnaire then the name of the variable '' | ||
- | |||
===== Rotating Questions over Multiple Pages ===== | ===== Rotating Questions over Multiple Pages ===== | ||
Line 212: | Line 212: | ||
if (!isset($blocks)) { | if (!isset($blocks)) { | ||
// define list of pages | // define list of pages | ||
- | $pages = array(' | + | $blocks |
// shuffle list | // shuffle list | ||
- | shuffle($pages); | + | shuffle($blocks); |
// add page where the questionnaire continues | // add page where the questionnaire continues | ||
- | $pages[] = ' | + | $blocks[] = ' |
// cache page order to prevent changes later on | // cache page order to prevent changes later on | ||
- | registerVariable(' | + | registerVariable($blocks); |
} | } | ||
- | setPageOrder($pages); | + | setPageOrder($blocks); |
</ | </ |