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 39 and 311]

External grade report user API

Copyright: 2015 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 537 lines (25 kb)
Included or required:0 times
Referenced: 4 times
Includes or requires: 0 files

Defines 1 class


Class: gradereport_user_external  - X-Ref

External grade report API implementation

check_report_access($courseid, $userid, $groupid = 0)   X-Ref
Validate access permissions to the report

param: int  $courseid the courseid
param: int  $userid   the user id to retrieve data from
param: int $groupid   the group id
return: array with the parameters cleaned and other required information

get_report_data($course, $context, $user, $userid, $groupid, $tabledata = true)   X-Ref
Get the report data

param: stdClass $course  course object
param: stdClass $context context object
param: stdClass $user    user object (it can be null for all the users)
param: int $userid       the user to retrieve data from, 0 for all
param: int $groupid      the group id to filter
param: bool $tabledata   whether to get the table data (true) or the gradeitemdata
return: array data and possible warnings

get_grades_table_parameters()   X-Ref
Describes the parameters for get_grades_table.

return: external_function_parameters

get_grades_table($courseid, $userid = 0, $groupid = 0)   X-Ref
Returns a list of grades tables for users in a course.

param: int $courseid Course Id
param: int $userid   Only this user (optional)
param: int $groupid  Get users from this group only
return: array the grades tables

grades_table_column()   X-Ref
Creates a table column structure

return: array

get_grades_table_returns()   X-Ref
Describes tget_grades_table return value.

return: external_single_structure

view_grade_report_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

view_grade_report($courseid, $userid = 0)   X-Ref
Trigger the user report events, do the same that the web interface view of the report

param: int $courseid id of course
param: int $userid id of the user the report belongs to
return: array of warnings and status result

view_grade_report_returns()   X-Ref
Returns description of method result value

return: external_description

get_grade_items_parameters()   X-Ref
Describes the parameters for get_grade_items.

return: external_function_parameters

get_grade_items($courseid, $userid = 0, $groupid = 0)   X-Ref
Returns the complete list of grade items for users in a course.

param: int $courseid Course Id
param: int $userid   Only this user (optional)
param: int $groupid  Get users from this group only
return: array the grades tables

get_grade_items_returns()   X-Ref
Describes tget_grade_items return value.

return: external_single_structure