Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

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: 1296 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