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 [30.05.2016 14:05] – [1st example] info_familienwissenschaftenen:create:functions:looptopage [31.05.2016 09:29] – [1st example] info_familienwissenschaften
Line 3: Line 3:
 ''int **loopToPage**(string //pageID//, int //repititions//)'' ''int **loopToPage**(string //pageID//, int //repititions//)''
  
-The function ''loopToPage()'' is used to show the pages from the current one to the page with the ID //pageID//  multiple times, as often as the number of //repititions// are set.+The function ''loopToPage()'' is used to show the pages of the current page with the ID //pageID//  multiple times, as often as the number of //repititions// are set.
  
-This function specifies how often the pages have been repeated. On the first pass = 0, second pass = 1 etc.+This function specifies how often the pages have been repeated. In the first round = 0, second round = 1 etc.
  
 **Important:** The function ''loopToPage()'' can not be used simultaneously with ''loopPage()'', ''setNextPage()'' or ''setPageOrder()''. **Important:** The function ''loopToPage()'' can not be used simultaneously with ''loopPage()'', ''setNextPage()'' or ''setPageOrder()''.
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. 
  
  
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