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: 554 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: user  - X-Ref

External grade report API implementation

check_report_access(int $courseid, int $userid, int $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(stdClass $course,stdClass $context,?stdClass $user,int $userid,int $groupid,bool $tabledata = true)   X-Ref
Get the report data

param: stdClass $course  course object
param: stdClass $context context object
param: null|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(int $courseid, int $userid = 0, int $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(int $courseid, int $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(int $courseid, int $userid = 0, int $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