Permalink
Browse files

Merge branch 'MDL-42494-workshop-exception' of git://github.com/mudrd…

…8mz/moodle
  • Loading branch information...
danpoltawski committed Nov 4, 2013
2 parents 23f13c5 + e01d4a2 commit b763a03ddbde5bda52a7021385b76a2b2ed839cf
Showing with 12 additions and 0 deletions.
  1. +12 −0 mod/workshop/eval/best/lib.php
@@ -163,6 +163,16 @@ protected function process_assessments(array $assessments, array $diminfo, stdcl
// get a hypothetical average assessment
$average = $this->average_assessment($assessments);
// if unable to calculate the average assessment, set the grading grades to null
if (is_null($average)) {
foreach ($assessments as $asid => $assessment) {
if (!is_null($assessment->gradinggrade)) {
$DB->set_field('workshop_assessments', 'gradinggrade', null, array('id' => $asid));
}
}
return;
}
// calculate variance of dimension grades
$variances = $this->weighted_variance($assessments);
foreach ($variances as $dimid => $variance) {
@@ -272,6 +282,8 @@ protected function normalize_grades(array $assessments, array $diminfo) {
* 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.
* Returns null if all passed assessments have zero weight as there is nothing to choose
* from then.
*
* @param array $assessments as prepared by {@link self::prepare_data_from_recordset()}
* @return null|stdClass

0 comments on commit b763a03

Please sign in to comment.