Moodle  2.2.1
http://www.collinsharper.com
grade_outcome Class Reference
Inheritance diagram for grade_outcome:
Collaboration diagram for grade_outcome:

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

Detailed Description

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.


Member Function Documentation

Checks if outcome can be deleted.

Returns:
boolean

Definition at line 293 of file grade_outcome.php.

Here is the call graph for this function:

delete ( source = null)

Deletes this outcome from the database.

Parameters:
string$sourcefrom where was the object deleted (mod/forum, manual, etc.)
Returns:
boolean success

Reimplemented from grade_object.

Definition at line 95 of file grade_outcome.php.

Here is the call graph for this function:

static fetch ( params) [static]

Finds and returns a grade_outcome instance based on params.

Parameters:
array$paramsassociative arrays varname=>value
Returns:
object grade_outcome instance or false if none found.

Reimplemented from grade_object.

Definition at line 178 of file grade_outcome.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static fetch_all ( params) [static]

Finds and returns all grade_outcome instances based on params.

Parameters:
array$paramsassociative arrays varname=>value
Returns:
array array of grade_outcome insatnces or false if none found.

Reimplemented from grade_object.

Definition at line 189 of file grade_outcome.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static fetch_all_available ( courseid) [static]

Static method - returns all outcomes available in course

Parameters:
int$courseid
Returns:
array

Definition at line 236 of file grade_outcome.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static fetch_all_global ( ) [static]

Static function returning all global outcomes

Returns:
object

Definition at line 210 of file grade_outcome.php.

Here is the call graph for this function:

static fetch_all_local ( courseid) [static]

Static function returning all local course outcomes

Parameters:
int$courseid
Returns:
object

Definition at line 223 of file grade_outcome.php.

Here is the call graph for this function:

Returns the number of places where outcome is used.

Returns:
int

Definition at line 309 of file grade_outcome.php.

Here is the caller graph for this function:

Returns the formatted grade description with URLs converted

Returns:
string

Definition at line 278 of file grade_outcome.php.

Here is the call graph for this function:

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.

Parameters:
int$courseidAn optional courseid to narrow down the average to 1 course only
bool$averageWhether or not to return the average grade for this outcome
bool$itemsWhether or not to return the list of items using this outcome
Returns:
float

Definition at line 340 of file grade_outcome.php.

Here is the call graph for this function:

Returns the number of places where outcome is used.

Returns:
int

Definition at line 323 of file grade_outcome.php.

Here is the caller graph for this function:

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.

Returns:
string name

Definition at line 262 of file grade_outcome.php.

Here is the call graph for this function:

Returns unique outcome short name.

Returns:
string 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.

Parameters:
string$sourcefrom where was the object inserted (mod/forum, manual, etc.)
Returns:
int PK ID if successful, false otherwise

Reimplemented from grade_object.

Definition at line 119 of file grade_outcome.php.

Instantiates a grade_scale object whose data is retrieved from the

Returns:
object grade_scale

Definition at line 197 of file grade_outcome.php.

Here is the call graph for this function:

update ( source = null)

In addition to update() it also updates grade_outcomes_courses if needed

Parameters:
string$sourcefrom where was the object inserted
Returns:
boolean success

Reimplemented from grade_object.

Definition at line 140 of file grade_outcome.php.

Here is the call graph for this function:

use_in ( courseid)

Mark outcome as used in course

Parameters:
int$courseid
Returns:
succes - false if incorrect courseid requested

Definition at line 156 of file grade_outcome.php.

Here is the caller graph for this function:


Field Documentation

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
Initial value:
 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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations