Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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]

Condition on grades of current user.

Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 319 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: condition  - X-Ref

Condition on grades of current user.

__construct($structure)   X-Ref
Constructor.

param: \stdClass $structure Data structure from JSON decode

save()   X-Ref
No description

get_json($gradeitemid, $min = null, $max = null)   X-Ref
Returns a JSON object which corresponds to a condition of this type.

Intended for unit testing, as normally the JSON values are constructed
by JavaScript code.

param: int $gradeitemid Grade item id
param: number|null $min Min grade (or null if no min)
param: number|null $max Max grade (or null if no max)
return: stdClass Object representing condition

is_available($not, \core_availability\info $info, $grabthelot, $userid)   X-Ref
No description

get_description($full, $not, \core_availability\info $info)   X-Ref
No description

get_description_callback_value(\course_modinfo $modinfo, \context $context, array $params)   X-Ref
Gets the grade name at display time.

param: \course_modinfo $modinfo Modinfo
param: \context $context Context
param: string[] $params Parameters (just grade item id)
return: string Text value

get_debug_string()   X-Ref
No description

get_cached_grade_name($courseid, $gradeitemid)   X-Ref
Obtains the name of a grade item, also checking that it exists. Uses a
cache. The name returned is suitable for display.

param: int $courseid Course id
param: int $gradeitemid Grade item id
return: string Grade name or empty string if no grade with that id

get_cached_grade_score($gradeitemid, $courseid,$grabthelot=false, $userid=0)   X-Ref
Obtains a grade score. Note that this score should not be displayed to
the user, because gradebook rules might prohibit that. It may be a
non-final score subject to adjustment later.

param: int $gradeitemid Grade item ID we're interested in
param: int $courseid Course id
param: bool $grabthelot If true, grabs all scores for current user on
param: int $userid Set if requesting grade for a different user (does
return: float Grade score as a percentage in range 0-100 (e.g. 100.0

update_after_restore($restoreid, $courseid, \base_logger $logger, $name)   X-Ref
No description

update_dependency_id($table, $oldid, $newid)   X-Ref
No description