|
Moodle
2.2.1
http://www.collinsharper.com
|


Definition at line 38 of file grade_category.php.
| aggregate_values | ( | $ | grade_values, |
| $ | items | ||
| ) |
Internal function - aggregation maths. Must be public: used by grade_grade::get_hiding_affected()
| array | $grade_values | The values being aggregated |
| array | $items | The array of grade_items |
Definition at line 641 of file grade_category.php.
Applies default settings on this category
Definition at line 1599 of file grade_category.php.

Applies forced settings on this category
Definition at line 1618 of file grade_category.php.

| apply_limit_rules | ( | &$ | grade_values, |
| $ | items | ||
| ) |
Given an array of grade values (numerical indices), applies droplow or keephigh rules to limit the final array.
| array | &$grade_values | itemid=>$grade_value float |
| array | $items | grade item objects |
Definition at line 880 of file grade_category.php.

| static build_path | ( | $ | grade_category | ) | [static] |
Builds this category's path string based on its parents (if any) and its own id number. This is typically done just before inserting this object in the DB for the first time, or when a new parent is added or changed. It is a recursive function: once the calling object no longer has a parent, the path is complete.
| object | $grade_category | A Grade_Category object |
Definition at line 171 of file grade_category.php.

| delete | ( | $ | source = null | ) |
If parent::delete() is successful, send force_regrading message to parent category.
| string | $source | from where was the object deleted (mod/forum, manual, etc.) |
Reimplemented from grade_object.
Definition at line 264 of file grade_category.php.

| static fetch | ( | $ | params | ) | [static] |
Finds and returns a grade_category instance based on params.
| array | $params | associative arrays varname=>value |
Reimplemented from grade_object.
Definition at line 190 of file grade_category.php.


| static fetch_all | ( | $ | params | ) | [static] |
Finds and returns all grade_category instances based on params.
| array | $params | associative arrays varname=>value |
Reimplemented from grade_object.
Definition at line 201 of file grade_category.php.


| static fetch_course_category | ( | $ | courseid | ) | [static] |
Return the top most course category.
| int | $courseid | The Course ID |
Definition at line 1441 of file grade_category.php.


| static fetch_course_tree | ( | $ | courseid, |
| $ | include_category_items = false |
||
| ) | [static] |
Returns tree with all grade_items and categories as elements
| int | $courseid | The course ID |
| boolean | $include_category_items | as category children |
Definition at line 1016 of file grade_category.php.


| force_regrading | ( | ) |
Marks the category and course item as needing update - categories are always regraded.
Definition at line 413 of file grade_category.php.


| generate_grades | ( | $ | userid = null | ) |
Generates and saves final grades in associated category grade item. These immediate children must already have their own final grades. The category's aggregation method is used to generate final grades.
Please note that category grade is either calculated or aggregated - not both at the same time.
This method must be used ONLY from grade_item::regrade_final_grades(), because the calculation must be done in correct order!
Steps to follow: 1. Get final grades from immediate children 3. Aggregate these grades 4. Save them in final grades of associated category grade item
| int | $userid | The user ID |
Definition at line 437 of file grade_category.php.

| get_children | ( | $ | include_category_items = false | ) |
Fetches and returns all the children categories and/or grade_items belonging to this category. By default only returns the immediate children (depth=1), but deeper levels can be requested, as well as all levels (0). The elements are indexed by sort order.
| bool | $include_category_items | Whether or not to include category grade_items in the children array |
Definition at line 1093 of file grade_category.php.
| get_coefstring | ( | $ | first = true | ) |
Recursive function to find which weight/extra credit field to use in the grade item form. Inherits from a parent category if that category has aggregatesubcats set to true.
| string | $first | Whether or not this is the first item in the recursion |
Definition at line 956 of file grade_category.php.

| get_final | ( | $ | userid = null | ) |
Returns the final values for this grade category.
| int | $userid | Optional: to retrieve a single final grade |
Definition at line 1371 of file grade_category.php.

| get_grade_item | ( | ) |
Retrieves from DB and instantiates the associated grade_item object. If no grade_item exists yet, create one.
Definition at line 1251 of file grade_category.php.


| get_idnumber | ( | ) |
Returns the idnumber of the associated grade_item. This method is also available in grade_item, for cases where the object type is not known.
Definition at line 1393 of file grade_category.php.

| get_name | ( | ) |
Returns the most descriptive field for this object. This is a standard method used when we do not know the exact type of an object.
Definition at line 1314 of file grade_category.php.

Uses $this->parent to instantiate and return a grade_category object.
Definition at line 1299 of file grade_category.php.

| get_sortorder | ( | ) |
Returns the sortorder of the associated grade_item. This method is also available in grade_item, for cases where the object type is not known.
Definition at line 1382 of file grade_category.php.

| insert | ( | $ | source = null | ) |
In addition to the normal insert() defined in grade_object, this method sets the depth and path for this object, and update the record accordingly. The reason why this must be done here instead of in the constructor, is that they both need to know the record's id number, which only gets created at insertion time. This method also creates an associated grade_item if this wasn't done during construction.
| string | $source | from where was the object inserted (mod/forum, manual, etc.) |
Reimplemented from grade_object.
Definition at line 326 of file grade_category.php.

| insert_course_category | ( | $ | courseid | ) |
Internal function - used only from fetch_course_category() Normal insert() can not be used for course category
| int | $courseid | The course ID |
Definition at line 362 of file grade_category.php.

Returns true if category uses special aggregation coefficient
Definition at line 940 of file grade_category.php.
Return true if this is the top most category that represents the total course grade.
Definition at line 1428 of file grade_category.php.


| is_editable | ( | ) |
Returns true if category uses extra credit of any kind
Definition at line 929 of file grade_category.php.

| is_locked | ( | ) |
Returns the locked state/date of the associated grade_item. This method is also available in grade_item, for cases where the object type is not known.
Definition at line 1473 of file grade_category.php.

| load_grade_item | ( | ) |
Uses get_grade_item to load or create a grade_item, then saves it as $this->grade_item.
Definition at line 1239 of file grade_category.php.


Uses $this->parent to instantiate $this->parent_category based on the referenced record in the DB.
Definition at line 1288 of file grade_category.php.


| move_after_sortorder | ( | $ | sortorder | ) |
Move this category after the given sortorder - does not change the parent
| int | $sortorder | to place after. |
Definition at line 1418 of file grade_category.php.

Compares the values held by this object with those of the matching record in DB, and returns whether or not these differences are sufficient to justify an update of all parent objects. This assumes that this object has an id number and a matching record in DB. If not, it will return false.
Definition at line 391 of file grade_category.php.


| set_hidden | ( | $ | hidden, |
| $ | cascade = false |
||
| ) |
Sets the grade_item's hidden variable and updates the grade_item. Method named after grade_item::set_hidden().
| int | $hidden | 0, 1 or a timestamp int(10) after which date the item will be hidden. |
| boolean | $cascade | apply to child objects too |
Reimplemented from grade_object.
Definition at line 1558 of file grade_category.php.

| set_locked | ( | $ | lockedstate, |
| $ | cascade = false, |
||
| $ | refresh = true |
||
| ) |
Sets the grade_item's locked variable and updates the grade_item. Method named after grade_item::set_locked().
| int | $lockedstate | 0, 1 or a timestamp int(10) after which date the item will be locked. |
| bool | $cascade | lock/unlock child objects too |
| bool | $refresh | refresh grades when unlocking |
Definition at line 1488 of file grade_category.php.

| set_parent | ( | $ | parentid, |
| $ | source = null |
||
| ) |
Sets this category's parent id. A generic method shared by objects that have a parent id of some kind.
| int | $parentid | The ID of the category parent to $this |
| grade_category | $source | An optional grade_category to use as the source for the parent |
Definition at line 1334 of file grade_category.php.

| static set_properties | ( | &$ | instance, |
| $ | params | ||
| ) | [static] |
Given an associated array or object, cycles through each key/variable and assigns the value to the corresponding variable in this object. final
Reimplemented from grade_object.
Definition at line 1518 of file grade_category.php.
| set_sortorder | ( | $ | sortorder | ) |
Sets sortorder variable for this category. This method is also available in grade_item, for cases where the object type is not know.
| int | $sortorder | The sortorder to assign to this category |
Definition at line 1406 of file grade_category.php.

| update | ( | $ | source = null | ) |
In addition to update() as defined in grade_object, call force_regrading of parent categories, if applicable.
| string | $source | from where was the object updated (mod/forum, manual, etc.) |
Reimplemented from grade_object.
Definition at line 210 of file grade_category.php.


| static updated_forced_settings | ( | ) | [static] |
Notification of change in forced category settings.
Definition at line 1645 of file grade_category.php.

| int $aggregateonlygraded = 0 |
Aggregate only graded items
Definition at line 112 of file grade_category.php.
| int $aggregateoutcomes = 0 |
Aggregate outcomes together with normal items
Definition at line 118 of file grade_category.php.
| int $aggregatesubcats = 0 |
Ignore subcategories when aggregating
Definition at line 124 of file grade_category.php.
| int $aggregation = GRADE_AGGREGATE_MEAN |
A constant pointing to one of the predefined aggregation strategies (none, mean, median, sum etc) .
Definition at line 94 of file grade_category.php.
| array $all_children |
A hierarchical array of all children below this category. This is stored separately from $children because it is more memory-intensive and may not be used as often.
Definition at line 137 of file grade_category.php.
| array $children |
Array of grade_items or grade_categories nested exactly 1 level below this category
Definition at line 130 of file grade_category.php.
| $coefstring = null |
String representing the aggregation coefficient. Variable is used as cache.
Definition at line 159 of file grade_category.php.
| int $courseid |
The course this category belongs to.
Definition at line 57 of file grade_category.php.
| int $depth = 0 |
The number of parents this category has.
Definition at line 75 of file grade_category.php.
| int $droplow = 0 |
Drop the X lowest items.
Definition at line 106 of file grade_category.php.
| $forceable = array('aggregation', 'keephigh', 'droplow', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats') |
List of options which can be "forced" from site settings.
Definition at line 154 of file grade_category.php.
| string $fullname |
The name of this category.
Definition at line 88 of file grade_category.php.
An associated grade_item object, with itemtype=category, used to calculate and cache a set of grade values for this category.
Definition at line 144 of file grade_category.php.
| int $keephigh = 0 |
Keep only the X highest items.
Definition at line 100 of file grade_category.php.
| int $parent |
The category this category belongs to (optional).
Definition at line 63 of file grade_category.php.
| object $parent_category |
The grade_category object referenced by $this->parent (PK).
Definition at line 69 of file grade_category.php.
| string $path |
Shows the hierarchical path for this category as /1/2/3/ (like course_categories), the last number being this category's autoincrement ID number.
Definition at line 82 of file grade_category.php.
| array $required_fields |
array('id', 'courseid', 'parent', 'depth', 'path', 'fullname', 'aggregation', 'keephigh', 'droplow', 'aggregateonlygraded', 'aggregateoutcomes', 'aggregatesubcats', 'timecreated', 'timemodified', 'hidden')
Array of required table fields, must start with 'id'.
Reimplemented from grade_object.
Definition at line 49 of file grade_category.php.
| $sortorder |
Temporary sortorder for speedup of children resorting
Definition at line 149 of file grade_category.php.
| string $table = 'grade_categories' |