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

Public Member Functions

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

Detailed Description

Test subclass that makes all the protected methods we want to test public.

Definition at line 40 of file testlib.php.


Member Function Documentation

assessments_distance ( stdclass $  assessment,
stdclass $  referential,
array diminfo,
stdclass $  settings 
)

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 from workshop_best_evaluation.

Definition at line 51 of file testlib.php.

average_assessment ( array assessments)

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 from workshop_best_evaluation.

Definition at line 45 of file testlib.php.

normalize_grades ( array assessments,
array diminfo 
)

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 from workshop_best_evaluation.

Definition at line 42 of file testlib.php.

weighted_variance ( array assessments)

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 from workshop_best_evaluation.

Definition at line 48 of file testlib.php.


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