Differences Between: [Versions 400 and 402] [Versions 400 and 403]
Defines the quiz repaginate class.
Copyright: | 2014 The Open University |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 234 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
repaginate:: (9 methods):
__construct()
repaginate_this_slot()
get_this_slot()
get_slots_by_slot_number()
get_slots_by_slotid()
repaginate_slots()
repaginate_next_slot()
repaginate_n_question_per_page()
repaginate_the_rest()
Class: repaginate - X-Ref
The repaginate class will rearrange questions in pages.__construct($quizid = 0, $slots = null) X-Ref |
Constructor. param: int $quizid the id of the quiz being manipulated. param: stdClass[] $slots the quiz_slots for that quiz. |
repaginate_this_slot($slot, $newpagenumber) X-Ref |
Repaginate a given slot with the given pagenumber. return: stdClass param: stdClass $slot param: int $newpagenumber |
get_this_slot($slots, $slotnumber) X-Ref |
Return current slot object. return: stdClass $slot param: array $slots param: int $slotnumber |
get_slots_by_slot_number($slots) X-Ref |
Return array of slots with slot number as key return: stdClass[] param: stdClass[] $slots |
get_slots_by_slotid($slots) X-Ref |
Return array of slots with slot id as key return: stdClass[] param: stdClass[] $slots |
repaginate_slots($nextslotnumber, $type) X-Ref |
Repaginate, update DB and slots object param: int $nextslotnumber param: int $type repaginate::LINK or repaginate::UNLINK. |
repaginate_next_slot($nextslotnumber, $type) X-Ref |
Repaginate next slot and return the modified slot object return: stdClass|null param: int $nextslotnumber param: int $type repaginate::LINK or repaginate::UNLINK. |
repaginate_n_question_per_page($slots, $number) X-Ref |
Return the slots with the new pagination, regardless of current pagination. return: stdClass[] the updated slots. param: stdClass[] $slots the slots to repaginate. param: int $number number of question per page |
repaginate_the_rest($quizslots, $slotfrom, $type, $dbupdate = true) X-Ref |
Repaginate the rest. return: stdClass[] param: stdClass[] $quizslots param: int $slotfrom param: int $type param: bool $dbupdate |