From: tjhunt Date: Thu, 29 Mar 2007 23:00:48 +0000 (+0000) Subject: MDL-9094 - Penalty factor is meaningless for Essay questions, so remove it from the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b63c5b590588c75d71e95df5383625513432d118;p=moodle.git MDL-9094 - Penalty factor is meaningless for Essay questions, so remove it from the editing form. Manual merge of the corresponding change from MOODLE_17_STABLE. --- diff --git a/question/type/essay/edit_essay_form.php b/question/type/essay/edit_essay_form.php index da46201e50..4b989c08bc 100644 --- a/question/type/essay/edit_essay_form.php +++ b/question/type/essay/edit_essay_form.php @@ -23,6 +23,10 @@ class question_edit_essay_form extends question_edit_form { $mform->setType('feedback', PARAM_RAW); $mform->addElement('hidden', 'fraction', 0); + + //don't need this default element. + $mform->removeElement('penalty'); + $mform->addElement('hidden', 'penalty', 0); } function set_data($question) { @@ -30,6 +34,7 @@ class question_edit_essay_form extends question_edit_form { $answer = reset($question->options->answers); $question->feedback = $answer->feedback; } + $question->penalty = 0; parent::set_data($question); }