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


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) | |
Test subclass that makes all the protected methods we want to test public.
Definition at line 40 of file testlib.php.
| 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.
| stdClass | $assessment | the assessment being measured |
| stdClass | $referential | assessment |
| array | $diminfo | of stdclass(->weight ->min ->max ->variance) indexed by dimension id |
| stdClass | $settings |
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.
| array | $assessments | as prepared by self::prepare_data_from_recordset() |
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.
| array | $assessments | of stdclass as returned by { |
| array | $diminfo | of stdclass |
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
| array | $assessments | as prepared by self::prepare_data_from_recordset() |
Reimplemented from workshop_best_evaluation.
Definition at line 48 of file testlib.php.