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


Public Member Functions | |
| delete ($source=null) | |
| insert ($source=null) | |
| update ($source=null) | |
| use_in ($courseid) | |
| load_scale () | |
| get_name () | |
| get_shortname () | |
| get_description () | |
| can_delete () | |
| get_course_uses_count () | |
| get_item_uses_count () | |
| get_grade_info ($courseid=null, $average=true, $items=false) | |
Static Public Member Functions | |
| static | fetch ($params) |
| static | fetch_all ($params) |
| static | fetch_all_global () |
| static | fetch_all_local ($courseid) |
| static | fetch_all_available ($courseid) |
Data Fields | |
| $table = 'grade_outcomes' | |
| $required_fields | |
| $courseid | |
| $shortname | |
| $fullname | |
| $scale | |
| $scaleid | |
| $description | |
| $usermodified | |
Class representing a grade outcome. It is responsible for handling its DB representation, modifying and returning its metadata.
Definition at line 34 of file grade_outcome.php.
| can_delete | ( | ) |
Checks if outcome can be deleted.
Definition at line 293 of file grade_outcome.php.

| delete | ( | $ | source = null | ) |
Deletes this outcome from the database.
| string | $source | from where was the object deleted (mod/forum, manual, etc.) |
Reimplemented from grade_object.
Definition at line 95 of file grade_outcome.php.

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


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


| static fetch_all_available | ( | $ | courseid | ) | [static] |
Static method - returns all outcomes available in course
| int | $courseid |
Definition at line 236 of file grade_outcome.php.


| static fetch_all_global | ( | ) | [static] |
Static function returning all global outcomes
Definition at line 210 of file grade_outcome.php.

| static fetch_all_local | ( | $ | courseid | ) | [static] |
Static function returning all local course outcomes
| int | $courseid |
Definition at line 223 of file grade_outcome.php.

Returns the number of places where outcome is used.
Definition at line 309 of file grade_outcome.php.

| get_description | ( | ) |
Returns the formatted grade description with URLs converted
Definition at line 278 of file grade_outcome.php.

| get_grade_info | ( | $ | courseid = null, |
| $ | average = true, |
||
| $ | items = false |
||
| ) |
Computes then returns extra information about this outcome and other objects that are linked to it. The average of all grades that use this outcome, for all courses (or 1 course if courseid is given) can be requested, and is returned as a float if requested alone. If the list of items that use this outcome is also requested, then a single array is returned, which contains the grade_items AND the average grade if such is still requested (array('items' => array(...), 'avg' => 2.30)). This combining of two methods into one is to save on DB queries, since both queries are similar and can be performed together.
| int | $courseid | An optional courseid to narrow down the average to 1 course only |
| bool | $average | Whether or not to return the average grade for this outcome |
| bool | $items | Whether or not to return the list of items using this outcome |
Definition at line 340 of file grade_outcome.php.

Returns the number of places where outcome is used.
Definition at line 323 of file grade_outcome.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 262 of file grade_outcome.php.

| get_shortname | ( | ) |
Returns unique outcome short name.
Definition at line 270 of file grade_outcome.php.
| insert | ( | $ | source = null | ) |
Records this object in the Database, sets its id to the returned value, and returns that value. If successful this function also fetches the new object data from database and stores it in object properties.
| string | $source | from where was the object inserted (mod/forum, manual, etc.) |
Reimplemented from grade_object.
Definition at line 119 of file grade_outcome.php.
| load_scale | ( | ) |
Instantiates a grade_scale object whose data is retrieved from the
Definition at line 197 of file grade_outcome.php.

| update | ( | $ | source = null | ) |
In addition to update() it also updates grade_outcomes_courses if needed
| string | $source | from where was the object inserted |
Reimplemented from grade_object.
Definition at line 140 of file grade_outcome.php.

| use_in | ( | $ | courseid | ) |
Mark outcome as used in course
| int | $courseid |
Definition at line 156 of file grade_outcome.php.

| int $courseid |
The course this outcome belongs to.
Definition at line 52 of file grade_outcome.php.
| string $description |
The description of this outcome - FORMAT_MOODLE.
Definition at line 82 of file grade_outcome.php.
| string $fullname |
The fullname of the outcome.
Definition at line 64 of file grade_outcome.php.
| array $required_fields |
array('id', 'courseid', 'shortname', 'fullname', 'scaleid','description', 'descriptionformat', 'timecreated', 'timemodified', 'usermodified')
Array of required table fields, must start with 'id'.
Reimplemented from grade_object.
Definition at line 45 of file grade_outcome.php.
| object $scale |
A full grade_scale object referenced by $this->scaleid.
Definition at line 70 of file grade_outcome.php.
| int $scaleid |
The id of the scale referenced by this outcome.
Definition at line 76 of file grade_outcome.php.
| string $shortname |
The shortname of the outcome.
Definition at line 58 of file grade_outcome.php.
| string $table = 'grade_outcomes' |
DB Table (used by grade_object).
Reimplemented from grade_object.
Definition at line 39 of file grade_outcome.php.
| int $usermodified |
The userid of the person who last modified this outcome.
Definition at line 88 of file grade_outcome.php.