Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 137 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

question_category_list:: (4 methods):
  __construct()
  get_records()
  get_top_level_parent_id()
  process_actions()


Class: question_category_list  - X-Ref

Class representing a list of question categories.

__construct($type='ul', $attributes='', $editable = false, $pageurl=null,$page = 0, $pageparamname = 'page',$itemsperpage = DEFAULT_QUESTIONS_PER_PAGE, $context = null)   X-Ref
Constructor.

param: string $type
param: string $attributes
param: boolean $editable
param: \moodle_url $pageurl url for this page
param: integer $page if 0 no pagination. (These three params only used in top level list.)
param: string $pageparamname name of url param that is used for passing page no
param: integer $itemsperpage no of top level items.
param: \context $context

get_records()   X-Ref
Set the array of records of list items.


get_top_level_parent_id($item)   X-Ref
Returns the highest category id that the $item can have as its parent.
Note: question categories cannot go higher than the TOP category.

param: \list_item $item The item which its top level parent is going to be returned.
return: int

process_actions($left, $right, $moveup, $movedown)   X-Ref
Process any actions.

param: integer $left id of item to move left
param: integer $right id of item to move right
param: integer $moveup id of item to move up
param: integer $movedown id of item to move down
return: void