Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Functions | Variables
gradelib.php File Reference

Library of functions for gradebook - both public and internal. More...

Functions

 grade_course_category_delete ($categoryid, $newparentid, $showfeedback)
 Called when course category is deleted Cleans the gradebook of associated data. More...
 
 grade_course_reset ($courseid)
 Reset all course grades, refetch from the activities and recalculate. More...
 
 grade_floats_different ($f1, $f2)
 Compare two float numbers safely. More...
 
 grade_floats_equal ($f1, $f2)
 Compare two float numbers safely. More...
 
 grade_floatval ($number)
 Convert a number to 5 decimal point float, an empty string or a null db compatible format (we need this to decide if db value changed) More...
 
 grade_force_full_regrading ($courseid)
 Force final grade recalculation in all course items. More...
 
 grade_force_site_regrading ()
 Forces regrading of all site grades. More...
 
 grade_format_gradevalue ($value, &$grade_item, $localized=true, $displaytype=null, $decimals=null)
 Returns string representation of grade value. More...
 
 grade_format_gradevalue_letter ($value, $grade_item)
 Returns a letter grade representation of a grade value The array of grade letters used is produced by grade_get_letters() using the course context. More...
 
 grade_format_gradevalue_percentage ($value, $grade_item, $decimals, $localized)
 Returns a percentage representation of a grade value. More...
 
 grade_format_gradevalue_real ($value, $grade_item, $decimals, $localized)
 Returns a float representation of a grade value. More...
 
 grade_get_categories_menu ($courseid, $includenew=false)
 Returns grade options for gradebook grade category menu. More...
 
 grade_get_date_for_user_grade (\stdClass $grade, stdClass $user)
 Get the most appropriate grade date for a grade item given the user that the grade relates to. More...
 
 grade_get_grades ($courseid, $itemtype, $itemmodule, $iteminstance, $userid_or_ids=null)
 
 grade_get_letters ($context=null)
 Returns the array of grade letters to be used in the supplied context. More...
 
 grade_get_setting ($courseid, $name, $default=null, $resetcache=false)
 Returns a course gradebook setting. More...
 
 grade_get_settings ($courseid)
 Returns all course gradebook settings as object properties. More...
 
 grade_grab_course_grades ($courseid, $modname=null, $userid=0)
 Refetches grade data from course activities. More...
 
 grade_needs_regrade_final_grades ($courseid)
 Return true if the course needs regrading. More...
 
 grade_needs_regrade_progress_bar ($courseid)
 Return true if the regrade process is likely to be time consuming and will therefore require the progress bar. More...
 
 grade_recover_history_grades ($userid, $courseid)
 Recover a user's grades from grade_grades_history. More...
 
 grade_regrade_final_grades ($courseid, $userid=null, $updated_item=null, $progress=null)
 Updates all final grades in course. More...
 
 grade_regrade_final_grades_if_required ($course, callable $callback=null)
 Check whether regarding of final grades is required and, if so, perform the regrade. More...
 
 grade_set_setting ($courseid, $name, $value)
 Add, update or delete a course gradebook setting. More...
 
 grade_uninstalled_module ($modname)
 Does gradebook cleanup when a module is uninstalled Deletes all associated grade items. More...
 
 grade_update ($source, $courseid, $itemtype, $itemmodule, $iteminstance, $itemnumber, $grades=NULL, $itemdetails=NULL)
 
 grade_update_mod_grades ($modinstance, $userid=0)
 Force full update of module grades in central gradebook. More...
 
 grade_update_outcomes ($source, $courseid, $itemtype, $itemmodule, $iteminstance, $userid, $data)
 
 grade_user_delete ($userid)
 Deletes all of a user's grade data from gradebook. More...
 
 grade_user_unenrol ($courseid, $userid)
 Purge course data when user unenrolls from a course. More...
 
 grade_verify_idnumber ($idnumber, $courseid, $grade_item=null, $cm=null)
 Verify new value of grade item idnumber. More...
 
 remove_course_grades ($courseid, $showfeedback)
 Remove all grade related course data Grade history is kept. More...
 
 remove_grade_letters ($context, $showfeedback)
 Remove grade letters for given context. More...
 

Variables

global $CFG
 

Detailed Description

Library of functions for gradebook - both public and internal.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later