From cfd24d98f97e6cc3204e346f9e4016d8b2d86731 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 9 Sep 2008 02:03:28 +0000 Subject: [PATCH] MDL-7308 - followup - fix notices. Thanks to Pierre Pichet for the fix. --- question/type/edit_question_form.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index d0812ffc18..29cdf71524 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -236,8 +236,12 @@ class question_edit_form extends moodleform { } // Remove unnecessary trailing 0s form grade fields. - $question->defaultgrade = 0 + $question->defaultgrade; - $question->penalty = 0 + $question->penalty; + if (isset($question->defaultgrade)) { + $question->defaultgrade = 0 + $question->defaultgrade; + } + if (isset($question->penalty)) { + $question->penalty = 0 + $question->penalty; + } // Set any options. $extra_question_fields = $QTYPES[$question->qtype]->extra_question_fields(); -- 2.39.5