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 401 and 402] [Versions 401 and 403]

(no description)

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

Defines 1 class

singleview:: (9 methods):
  valid_screens()
  process_data()
  process_action()
  __construct()
  output()
  setup_groups()
  groups_course_menu()
  setup_item_selector()
  bulk_actions_menu()


Class: singleview  - X-Ref

This class is the main class that must be implemented by a grade report plugin.

valid_screens()   X-Ref
Return the list of valid screens, used to validate the input.

return: array List of screens.

process_data($data)   X-Ref
Process data from a form submission. Delegated to the current screen.

param: array $data The data from the form
return: array|object List of warnings

process_action($target, $action)   X-Ref
Unused - abstract function declared in the parent class.

param: string $target
param: string $action

__construct(int $courseid,object $gpr,context_course $context,string $itemtype,?int $itemid,?string $unused = null)   X-Ref
Constructor for this report. Creates the appropriate screen class based on itemtype.

param: int $courseid The course id.
param: object $gpr grade plugin return tracking object
param: context_course $context
param: string $itemtype Should be user, select or grade
param: int|null $itemid The id of the user or grade item
param: string|null $unused Used to be group id but that was removed and this is now unused.

output()   X-Ref
Build the html for the screen.

return: string HTML to display

setup_groups()   X-Ref
No description

groups_course_menu(stdClass $course, moodle_url $urlroot)   X-Ref
Ideally we should move this function to the base class and call it from the setup_groups in the base class,
so all reports would automatically use it.

param: stdClass $course
param: moodle_url $urlroot
return: string

setup_item_selector(string $itemtype, ?int $itemid)   X-Ref
Function used to set the appropriate item selector (raw HTML) based on the selected single view item type.

param: string $itemtype The single view item type.
param: int|null $itemid The item ID.

bulk_actions_menu(renderer_base $output)   X-Ref
Adds bulk actions menu.

param: renderer_base $output
return: string HTML to display