The repaginate class will rearrange questions in pages.  
 More...
|  | 
| int const | LINK = 1 | 
|  | means join pages. 
 | 
|  | 
| int const | UNLINK = 2 | 
|  | means split pages. 
 | 
|  | 
The repaginate class will rearrange questions in pages. 
The quiz setting allows users to write quizzes with one question per page, n questions per page, or all questions on one page.
- Copyright
- 2014 The Open University 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ __construct()
      
        
          | mod_quiz\repaginate::__construct | ( |  | $quizid = 0, | 
        
          |  |  |  | $slots = null | 
        
          |  | ) |  |  | 
      
 
Constructor. 
- Parameters
- 
  
    | int | $quizid | the id of the quiz being manipulated. |  | stdClass[] | $slots | the quiz_slots for that quiz. |  
 
 
 
◆ get_slots_by_slot_number()
  
  | 
        
          | mod_quiz\repaginate::get_slots_by_slot_number | ( |  | $slots | ) |  |  | protected | 
 
Return array of slots with slot number as key. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ get_slots_by_slotid()
  
  | 
        
          | mod_quiz\repaginate::get_slots_by_slotid | ( |  | $slots | ) |  |  | protected | 
 
Return array of slots with slot id as key. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ get_this_slot()
  
  | 
        
          | mod_quiz\repaginate::get_this_slot | ( |  | $slots, |  
          |  |  |  | $slotnumber |  
          |  | ) |  |  |  | protected | 
 
Return current slot object. 
- Parameters
- 
  
    | array | $slots |  |  | int | $slotnumber |  |  
 
- Return values
- 
  
  
 
 
◆ repaginate_n_question_per_page()
      
        
          | mod_quiz\repaginate::repaginate_n_question_per_page | ( |  | $slots, | 
        
          |  |  |  | $number | 
        
          |  | ) |  |  | 
      
 
Return the slots with the new pagination, regardless of current pagination. 
- Parameters
- 
  
    | stdClass[] | $slots | the slots to repaginate. |  | int | $number | number of question per page |  
 
- Return values
- 
  
    | stdClass[] | the updated slots. |  
 
 
 
◆ repaginate_next_slot()
      
        
          | mod_quiz\repaginate::repaginate_next_slot | ( |  | $nextslotnumber, | 
        
          |  |  |  | $type | 
        
          |  | ) |  |  | 
      
 
Repaginate next slot and return the modified slot object. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ repaginate_slots()
      
        
          | mod_quiz\repaginate::repaginate_slots | ( |  | $nextslotnumber, | 
        
          |  |  |  | $type | 
        
          |  | ) |  |  | 
      
 
Repaginate, update DB and slots object. 
- Parameters
- 
  
  
 
 
◆ repaginate_the_rest()
      
        
          | mod_quiz\repaginate::repaginate_the_rest | ( |  | $quizslots, | 
        
          |  |  |  | $slotfrom, | 
        
          |  |  |  | $type, | 
        
          |  |  |  | $dbupdate = true | 
        
          |  | ) |  |  | 
      
 
Repaginate the rest. 
- Parameters
- 
  
    | stdClass[] | $quizslots |  |  | int | $slotfrom |  |  | int | $type |  |  | bool | $dbupdate |  |  
 
- Return values
- 
  
  
 
 
◆ repaginate_this_slot()
  
  | 
        
          | mod_quiz\repaginate::repaginate_this_slot | ( |  | $slot, |  
          |  |  |  | $newpagenumber |  
          |  | ) |  |  |  | protected | 
 
Repaginate a given slot with the given pagenumber. 
- Parameters
- 
  
    | stdClass | $slot |  |  | int | $newpagenumber |  |  
 
- Return values
- 
  
  
 
 
The documentation for this class was generated from the following file: