|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| grade_course_category_delete | ( | $ | categoryid, |
| $ | newparentid, | ||
| $ | showfeedback | ||
| ) |
Called when course category deleted - cleanup gradebook
object
| int | $categoryid | course category id |
| int | $newparentid | empty means everything deleted, otherwise id of category where content moved |
| bool | $showfeedback | print feedback |
Definition at line 1264 of file gradelib.php.


| grade_course_reset | ( | $ | courseid | ) |
Resel all course grades
| int | $courseid |
Definition at line 1383 of file gradelib.php.


| grade_cron | ( | ) |
Grading cron job
object object
Definition at line 1328 of file gradelib.php.


| grade_floats_different | ( | $ | f1, |
| $ | f2 | ||
| ) |
Compare two float numbers safely. Uses 5 decimals php precision. Nulls accepted too. Used for skipping of db updates
| float | $f1 | |
| float | $f2 |
Definition at line 1425 of file gradelib.php.


| grade_floats_equal | ( | $ | f1, |
| $ | f2 | ||
| ) |
Compare two float numbers safely. Uses 5 decimals php precision.
Do not use rounding for 10,5 at the database level as the results may be different from php round() function.
| float | $f1 | |
| float | $f2 |
Definition at line 1441 of file gradelib.php.


| grade_floatval | ( | $ | number | ) |
Convert number to 5 decimalfloat, empty string or null db compatible format (we need this to decide if db value changed)
| mixed | $number |
Definition at line 1408 of file gradelib.php.

| grade_force_full_regrading | ( | $ | courseid | ) |
Force final grade recalculation in all course items
object
| int | $courseid |
Definition at line 901 of file gradelib.php.

Forces regrading of all site grades - usualy when chanign site setings object object
Definition at line 911 of file gradelib.php.

| grade_format_gradevalue | ( | $ | value, |
| &$ | grade_item, | ||
| $ | localized = true, |
||
| $ | displaytype = null, |
||
| $ | decimals = null |
||
| ) |
Returns string representation of grade value
| float | $value | grade value |
| object | $grade_item | - by reference to prevent scale reloading |
| bool | $localized | use localised decimal separator |
| int | $displaytype | type of display - GRADE_DISPLAY_TYPE_REAL, GRADE_DISPLAY_TYPE_PERCENTAGE, GRADE_DISPLAY_TYPE_LETTER |
| int | $decimals | number of decimal places when displaying float values |
Definition at line 657 of file gradelib.php.


| grade_format_gradevalue_letter | ( | $ | value, |
| $ | grade_item | ||
| ) |
Definition at line 750 of file gradelib.php.


| grade_format_gradevalue_percentage | ( | $ | value, |
| $ | grade_item, | ||
| $ | decimals, | ||
| $ | localized | ||
| ) |
Definition at line 737 of file gradelib.php.


| grade_format_gradevalue_real | ( | $ | value, |
| $ | grade_item, | ||
| $ | decimals, | ||
| $ | localized | ||
| ) |
Definition at line 721 of file gradelib.php.


| grade_get_categories_menu | ( | $ | courseid, |
| $ | includenew = false |
||
| ) |
Returns grade options for gradebook category menu
| int | $courseid | |
| bool | $includenew | include option for new category (-1) |
Definition at line 778 of file gradelib.php.


| grade_get_grades | ( | $ | courseid, |
| $ | itemtype, | ||
| $ | itemmodule, | ||
| $ | iteminstance, | ||
| $ | userid_or_ids = null |
||
| ) |
Returns grading information for given activity - optionally with users grades Manual, course or category items can not be queried.
public object
| int | $courseid | id of course |
| string | $itemtype | 'mod', 'block' |
| string | $itemmodule | 'forum, 'quiz', etc. |
| int | $iteminstance | id of the item module |
| array | int | $userid_or_ids | optional id of the graded user or array of ids; if userid not used, returns only information about grade_item |
Definition at line 345 of file gradelib.php.


| grade_get_letters | ( | $ | context = null | ) |
Returns grade letters array used in context
| object | $context | object or null for defaults |
Definition at line 812 of file gradelib.php.


| grade_get_setting | ( | $ | courseid, |
| $ | name, | ||
| $ | default = null, |
||
| $ | resetcache = false |
||
| ) |
Returns course gradebook setting
object
| int | $courseid | |
| string | $name | of setting, maybe null if reset only |
| string | $default | |
| bool | $resetcache | force reset of internal static cache |
Definition at line 564 of file gradelib.php.

| grade_get_settings | ( | $ | courseid | ) |
Returns all course gradebook settings as object properties
object
| int | $courseid |
Definition at line 600 of file gradelib.php.
| grade_grab_course_grades | ( | $ | courseid, |
| $ | modname = null, |
||
| $ | userid = 0 |
||
| ) |
Refetches data from all course activities
| int | $courseid | the course ID |
| string | $modname | limit the grade fetch to a single module type |
| int | $userid | limit the grade fetch to a single user |
Definition at line 1118 of file gradelib.php.


| grade_recover_history_grades | ( | $ | userid, |
| $ | courseid | ||
| ) |
Recover a user's grades from grade_grades_history
| int | $userid | the user ID whose grades we want to recover |
| int | $courseid | the relevant course |
Definition at line 922 of file gradelib.php.

| grade_regrade_final_grades | ( | $ | courseid, |
| $ | userid = null, |
||
| $ | updated_item = null |
||
| ) |
Updates all final grades in course.
| int | $courseid | |
| int | $userid | if specified, try to do a quick regrading of grades of this user only |
| object | $updated_item | the item in which |
Definition at line 1002 of file gradelib.php.


| grade_set_setting | ( | $ | courseid, |
| $ | name, | ||
| $ | value | ||
| ) |
Add/update course gradebook setting
object
| int | $courseid | |
| string | $name | of setting |
| string | value, NULL means no setting==remove |
Definition at line 624 of file gradelib.php.

| grade_uninstalled_module | ( | $ | modname | ) |
Does gradebook cleanup when module uninstalled.
object object
| string | $modname |
Definition at line 1278 of file gradelib.php.

| grade_update | ( | $ | source, |
| $ | courseid, | ||
| $ | itemtype, | ||
| $ | itemmodule, | ||
| $ | iteminstance, | ||
| $ | itemnumber, | ||
| $ | grades = NULL, |
||
| $ | itemdetails = NULL |
||
| ) |
Include essential files Submit new or update grade; update/create grade_item definition. Grade must have userid specified, rawgrade and feedback with format are optional. rawgrade NULL means 'Not graded', missing property or key means do not change existing.
Only following grade item properties can be changed 'itemname', 'idnumber', 'gradetype', 'grademax', 'grademin', 'scaleid', 'multfactor', 'plusfactor', 'deleted' and 'hidden'. 'reset' means delete all current grades including locked ones.
Manual, course or category items can not be updated by this function. public object object object
| string | $source | source of the grade such as 'mod/assignment' |
| int | $courseid | id of course |
| string | $itemtype | type of grade item - mod, block |
| string | $itemmodule | more specific then $itemtype - assignment, forum, etc.; maybe NULL for some item types |
| int | $iteminstance | instance it of graded subject |
| int | $itemnumber | most probably 0, modules can use other numbers when having more than one grades for each user |
| mixed | $grades | grade (object, array) or several grades (arrays of arrays or objects), NULL if updating grade_item definition only |
| mixed | $itemdetails | object or array describing the grading item, NULL if no change |
Create or update the grade_item if needed
reset grades if requested
Some extra checks
Finally start processing of grades
normalize and verify grade array
Definition at line 64 of file gradelib.php.


| grade_update_mod_grades | ( | $ | modinstance, |
| $ | userid = 0 |
||
| ) |
Force full update of module grades in central gradebook
object object
| object | $modinstance | object with extra cmidnumber and modname property |
| int | $userid |
Definition at line 1170 of file gradelib.php.


| grade_update_outcomes | ( | $ | source, |
| $ | courseid, | ||
| $ | itemtype, | ||
| $ | itemmodule, | ||
| $ | iteminstance, | ||
| $ | userid, | ||
| $ | data | ||
| ) |
Updates outcomes of user Manual outcomes can not be updated.
public
| string | $source | source of the grade such as 'mod/assignment' |
| int | $courseid | id of course |
| string | $itemtype | 'mod', 'block' |
| string | $itemmodule | 'forum, 'quiz', etc. |
| int | $iteminstance | id of the item module |
| int | $userid | ID of the graded user |
| array | $data | array itemnumber=>outcomegrade |
Definition at line 317 of file gradelib.php.

| grade_user_delete | ( | $ | userid | ) |
Deletes all user data from gradebook.
| $userid |
Definition at line 1298 of file gradelib.php.


| grade_user_unenrol | ( | $ | courseid, |
| $ | userid | ||
| ) |
Purge course data when user unenrolled.
| $userid |
Definition at line 1310 of file gradelib.php.


| grade_verify_idnumber | ( | $ | idnumber, |
| $ | courseid, | ||
| $ | grade_item = null, |
||
| $ | cm = null |
||
| ) |
Verify new value of idnumber - checks for uniqueness of new idnumbers, old are kept intact
object
| string | idnumber string (with magic quotes) | |
| int | $courseid | id numbers are course unique only |
| object | $grade_item | is item idnumber |
| object | $cm | used for course module idnumbers and items attached to modules |
Definition at line 864 of file gradelib.php.

| remove_course_grades | ( | $ | courseid, |
| $ | showfeedback | ||
| ) |
Remove all grade related course data - history is kept
| int | $courseid | |
| bool | $showfeedback | print feedback |
Definition at line 1218 of file gradelib.php.


| remove_grade_letters | ( | $ | context, |
| $ | showfeedback | ||
| ) |
Remove grade letters for given context
| context | $context | |
| bool | $showfeedback |
Definition at line 1201 of file gradelib.php.
