MDL-44004 grading_rubric: Ensure that score is set before using it

This commit is contained in:
Frederic Massart 2014-04-24 16:21:07 +08:00
parent 5fbcc5263a
commit 3f32733702

View File

@ -220,7 +220,7 @@ class MoodleQuickForm_rubriceditor extends HTML_QuickForm_input {
'score' => 0,
);
foreach ($criterion['levels'] as $lastlevel) {
if ($level['score'] < $lastlevel['score'] + 1) {
if (isset($lastlevel['score']) && $level['score'] < $lastlevel['score'] + 1) {
$level['score'] = $lastlevel['score'] + 1;
}
}