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

Public Member Functions

 __construct (workshop $workshop)
 update_grading_grades (stdclass $settings, $restrict=null)
 get_settings_form (moodle_url $actionurl=null)

Static Public Member Functions

static delete_instance ($workshopid)

Protected Member Functions

 process_assessments (array $assessments, array $diminfo, stdclass $settings)
 prepare_data_from_recordset ($assessments)
 normalize_grades (array $assessments, array $diminfo)
 average_assessment (array $assessments)
 weighted_variance (array $assessments)
 assessments_distance (stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings)

Protected Attributes

 $workshop
 $settings

Detailed Description

Defines the computation login of the grading evaluation subplugin

Definition at line 36 of file lib.php.


Constructor & Destructor Documentation

__construct ( workshop workshop)

Constructor

Parameters:
workshop$workshopThe workshop api instance
Returns:
void

Definition at line 50 of file lib.php.


Member Function Documentation

assessments_distance ( stdclass $  assessment,
stdclass $  referential,
array diminfo,
stdclass $  settings 
) [protected]

Measures the distance of the assessment from a referential one

The passed data structures must contain ->dimgrades property. The referential assessment is supposed to be close to the average assessment. All dimension grades are supposed to be normalized to the interval 0 - 100. Returned value is rounded to 4 valid decimals to prevent some rounding issues - see the unit test for an example.

Parameters:
stdClass$assessmentthe assessment being measured
stdClass$referentialassessment
array$diminfoof stdclass(->weight ->min ->max ->variance) indexed by dimension id
stdClass$settings
Returns:
float|null rounded to 4 valid decimals

Reimplemented in testable_workshop_best_evaluation.

Definition at line 381 of file lib.php.

Here is the caller graph for this function:

average_assessment ( array assessments) [protected]

Given a set of a submission's assessments, returns a hypothetical average assessment

The passed structure must be array of assessments objects with ->weight and ->dimgrades properties.

Parameters:
array$assessmentsas prepared by self::prepare_data_from_recordset()
Returns:
null|stdClass

Reimplemented in testable_workshop_best_evaluation.

Definition at line 282 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static delete_instance ( workshopid) [static]

Delete all data related to a given workshop module instance

See also:
workshop_delete_instance()
Parameters:
int$workshopidid of the workshop module instance being deleted
Returns:
void

Implements workshop_evaluation.

Definition at line 135 of file lib.php.

get_settings_form ( moodle_url actionurl = null)

TODO: short description.

Returns:
TODO

Definition at line 116 of file lib.php.

normalize_grades ( array assessments,
array diminfo 
) [protected]

Normalizes the dimension grades to the interval 0.00000 - 100.00000

Note: this heavily relies on PHP5 way of handling references in array of stdclasses. Hopefully it will not change again soon.

Parameters:
array$assessmentsof stdclass as returned by {
See also:
self::prepare_data_from_recordset()}
Parameters:
array$diminfoof stdclass
Returns:
array of stdclass with the same structure as $assessments

Reimplemented in testable_workshop_best_evaluation.

Definition at line 259 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

prepare_data_from_recordset ( assessments) [protected]

Prepares a structure of assessments and given grades

Parameters:
array$assessmentsbatch of recordset items as returned by the grading strategy
Returns:
array

Definition at line 231 of file lib.php.

Here is the caller graph for this function:

process_assessments ( array assessments,
array diminfo,
stdclass $  settings 
) [protected]

Given a list of all assessments of a single submission, updates the grading grades in database

Parameters:
array$assessmentsof stdclass (->assessmentid ->assessmentweight ->reviewerid ->gradinggrade ->submissionid ->dimensionid ->grade)
array$diminfoof stdclass (->id ->weight ->max ->min)
stdClassgrading evaluation settings
Returns:
void

Definition at line 153 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

update_grading_grades ( stdclass $  settings,
restrict = null 
)

Calculates the grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table

This function relies on the grading strategy subplugin providing get_assessments_recordset() method. {

See also:
self::process_assessments()} for the required structure of the recordset.
Parameters:
stdClass$settingsThe settings for this round of evaluation
null | int | array$restrictIf null, update all reviewers, otherwise update just grades for the given reviewers(s)
Returns:
void

Definition at line 67 of file lib.php.

Here is the call graph for this function:

weighted_variance ( array assessments) [protected]

Given a set of a submission's assessments, returns standard deviations of all their dimensions

The passed structure must be array of assessments objects with at least ->weight and ->dimgrades properties. This implementation uses weighted incremental algorithm as suggested in "D. H. D. West (1979). Communications of the ACM, 22, 9, 532-535: Updating Mean and Variance Estimates: An Improved Method" http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Weighted_incremental_algorithm

Parameters:
array$assessmentsas prepared by self::prepare_data_from_recordset()
Returns:
null|array indexed by dimension id

Reimplemented in testable_workshop_best_evaluation.

Definition at line 322 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$settings [protected]

Definition at line 42 of file lib.php.

$workshop [protected]

Definition at line 39 of file lib.php.


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