[[Rotation]]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:rotation [26.11.2014 16:03] – [Multiple Questions per Stimulus] alexander.ritteren:create:rotation [05.04.2015 13:42] – [Rotation of Question Blocks] Update admin
Line 89: Line 89:
   // go through list of questions ID for ID   // go through list of questions ID for ID
   // and show corresponding question each time    // and show corresponding question each time 
-  foreach ($questions as $ID) { +  foreach ($questions as $id) { 
-    question($ID);+    question($id);
   }   }
 } }
Line 201: Line 201:
 </code> </code>
  
-**Advice:** Every time you use ''isset()'' to avoid a change later on in the order (e.g. by using the 'back' button), you can only use the variable (here: ''$pages'') once in the questionnaire. If you need to use more, vary the name of the variable, e.g. ''$pages1'' und ''$pages2''  +**Advice:** Every time you use ''isset()'' to avoid a change later on in the order (e.g. by using the Back button), you can only use the variable (here: ''$pages'') once in the questionnaire. If you need to use more, vary the name of the variable, e.g. ''$pages1'' und ''$pages2''  
  
 ===== Rotation of Question Blocks ===== ===== Rotation of Question Blocks =====
Line 212: Line 212:
 if (!isset($blocks)) { if (!isset($blocks)) {
   // define list of pages   // define list of pages
-  $pages = array('B1Start-B1End','B2Start-B2End','B3Start-B3End');+  $blocks = array('B1Start-B1End','B2Start-B2End','B3Start-B3End');
   // shuffle list   // shuffle list
-  shuffle($pages);+  shuffle($blocks);
   // add page where the questionnaire continues   // add page where the questionnaire continues
-  $pages[] = 'SD';+  $blocks[] = 'SD';
   // cache page order to prevent changes later on   // cache page order to prevent changes later on
-  registerVariable('pages');+  registerVariable($blocks);
 } }
-setPageOrder($pages);+setPageOrder($blocks);
 </code> </code>
en/create/rotation.txt · Last modified: 12.08.2022 19:28 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki