Bugfix where the wrong levels were loaded in a levelset

This commit is contained in:
pmk 2018-09-18 23:24:50 +02:00
parent a112367fad
commit 78cb3b2e5a

View File

@ -38,12 +38,12 @@ class block_gradelevel_levelset {
$this->data = $dataObject;
}
else {
// database validity check sou
// database validity check went south, retrieve again
$this->data = $DB->get_record('block_gradelevel_levelset', array('id' => $this->id));
}
//retrieve levels for this levelset
$this->levels = $DB->get_records('block_gradelevel_levels', array('levelset_id' => $levelset_id));
$this->levels = $DB->get_records('block_gradelevel_levels', array('levelset_id' => $this->id));
usort( $this->levels, function( $a, $b) {
return ( $a->points < $b->points ) ? -1 : 1;