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:functions:looptopage [31.05.2016 09:27] – [loopToPage()] info_familienwissenschaftenen:create:functions:looptopage [31.05.2016 09:31] – [2nd example] info_familienwissenschaften
Line 17: Line 17:
 ===== 1st example ===== ===== 1st example =====
  
-You want to repeat page 5 to 8 of the survey 3 times. The page should show different questions each time.  +You want to repeat page 5 to 8 of the survey 3 times with different questions each time.  
  
   * change the ID of page 8 to "loopend" (you can choose the ID as you wish)   * change the ID of page 8 to "loopend" (you can choose the ID as you wish)
Line 26: Line 26:
 </code> </code>
  
-Now you want to have question ''A001'' to ''A005'' on the first pass. On the second pass you want question ''A101'' to ''A105'' to show on the page. And on the third pass question ''A201'' to ''A205'' +Now you want to have question ''A001'' to ''A005'' on the first round. On the second round you want question ''A101'' to ''A105'' to show up on the page. And on the third round question ''A201'' to ''A205'' 
  
- (the questions were made as section ''A0'' and the section has been copied two times by downloading it as a file and importing it again).+ (the questions were created in section ''A0'' and the section has been copied twice by downloading it as a file and importing it again).
  
 On page 5 you place the PHP-Code shown in the picture. It produces an array which contains a list of the questions and makes them available for the following pages via ''registerVariable()''  On page 5 you place the PHP-Code shown in the picture. It produces an array which contains a list of the questions and makes them available for the following pages via ''registerVariable()'' 
Line 52: Line 52:
 </code> </code>
  
-To show the next questions on page 6 you have to place the following PHP-code on the page. The command ''loopPage()'' shows in which pass the page is revealed. The remaining code is equivalent to the code shown above. +To show the next questions on page 6 you have to place the following PHP-code on the page. The command ''loopPage()'' shows in which round the page is revealed. The remaining code is equivalent to the code shown above. 
  
  
Line 69: Line 69:
 Earlier on page 3 you asked a question with 10 possible //free mentions// as answers (''ON01''). You want to repeat the following pages for every answer given.  Earlier on page 3 you asked a question with 10 possible //free mentions// as answers (''ON01''). You want to repeat the following pages for every answer given. 
  
-You copy the section ''A0'' from the catalogue of questions nine times (section ''A1'' to ''A9''). With this the questions look like the following:  +You copied the section ''A0'' from the catalogue of questions nine times (section ''A1'' to ''A9''). Accordingly the questions look like the following:  
  
  
en/create/functions/looptopage.txt · Last modified: 29.12.2018 16:53 by wimmer.andreas
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki