Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Definition of the grade_user_report class is defined

Copyright: 2007 Nicolas Connault
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1297 lines (58 kb)
Included or required:0 times
Referenced: 5 times
Includes or requires: 0 files

Defines 1 class


Class: grade_report_user  - X-Ref

Class providing an API for the user report building and displaying.

__construct($courseid, $gpr, $context, $userid, $viewasuser = null)   X-Ref
Constructor. Sets local copies of user preferences and initialises grade_tree.

param: int $courseid
param: object $gpr grade plugin return tracking object
param: string $context
param: int $userid The id of the user
param: bool $viewasuser Set this to true when the current user is a mentor/parent of the targetted user.

inject_rowspans(&$element)   X-Ref
Recurses through a tree of elements setting the rowspan property on each element

param: array $element Either the top element or, during recursion, the current element
return: int The number of elements processed

setup_table()   X-Ref
Prepares the headers and attributes of the flexitable.


fill_table()   X-Ref
No description

fill_table_recursive(&$element)   X-Ref
Fill the table with data.

param: $element - An array containing the table data for the current row.

fill_contributions_column($element)   X-Ref
This function is called after the table has been built and the aggregationhints
have been collected. We need this info to walk up the list of parents of each
grade_item.

param: $element - An array containing the table data for the current row.

print_table($return=false)   X-Ref
Prints or returns the HTML from the flexitable.

param: bool $return Whether or not to return the data instead of printing it directly.
return: string

process_data($data)   X-Ref
Processes the data sent by the form (grades and feedbacks).

return: bool Success or Failure (array of errors).

process_action($target, $action)   X-Ref
No description

calculate_averages()   X-Ref
Builds the grade item averages.


viewed()   X-Ref
Trigger the grade_report_viewed event


grade_report_user_settings_definition(&$mform)   X-Ref
No description

grade_report_user_profilereport($course, $user, $viewasuser = false)   X-Ref
Profile report callback.

param: object $course The course.
param: object $user The user.
param: boolean $viewasuser True when we are viewing this as the targetted user sees it.

gradereport_user_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course)   X-Ref
Add nodes to myprofile page.

param: \core_user\output\myprofile\tree $tree Tree object
param: stdClass $user user object
param: bool $iscurrentuser
param: stdClass $course Course object