Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

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

Helper class for gradehistory report.

Copyright: 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 226 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

helper:: (5 methods):
  init_js()
  get_users()
  get_users_count()
  get_users_sql_and_params()
  get_graders()


Class: helper  - X-Ref

Helper class for gradehistory report.

init_js($courseid, array $currentusers = null)   X-Ref
Initialise the js to handle the user selection {@link gradereport_history_user_button}.

param: int $courseid       course id.
param: array $currentusers List of currently selected users.
return: output\user_button the user select button.

get_users($context, $search = '', $page = 0, $perpage = 25)   X-Ref
Retrieve a list of users.

We're interested in anyone that had a grade history in this course. This api returns a list of such users based on various
criteria passed.

param: \context $context Context of the page where the results would be shown.
param: string $search the text to search for (empty string = find all).
param: int $page page number, defaults to 0.
param: int $perpage Number of entries to display per page, defaults to 0.
return: array list of users.

get_users_count($context, $search = '')   X-Ref
Get total number of users present for the given search criteria.

param: \context $context Context of the page where the results would be shown.
param: string $search the text to search for (empty string = find all).
return: int number of users found.

get_users_sql_and_params($context, $search = '', $count = false)   X-Ref
Get sql and params to use to get list of users.

param: \context $context Context of the page where the results would be shown.
param: string $search the text to search for (empty string = find all).
param: bool $count setting this to true, returns an sql to get count only instead of the complete data records.
return: array sql and params list

get_graders($courseid)   X-Ref
Get a list of graders.

param: int $courseid Id of course for which we need to fetch graders.
return: array list of graders.