From e5073fe3056bcdca2137bee4b84df2907e6049a0 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 23 Aug 2011 08:36:52 +0100 Subject: [PATCH] MDL-29064 qtype multianswer, question text should be a required field. --- question/type/multianswer/edit_multianswer_form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/question/type/multianswer/edit_multianswer_form.php b/question/type/multianswer/edit_multianswer_form.php index 69f905b0781..4f8d65b3ae7 100644 --- a/question/type/multianswer/edit_multianswer_form.php +++ b/question/type/multianswer/edit_multianswer_form.php @@ -64,6 +64,9 @@ class question_edit_multianswer_form extends question_edit_form { $mform->removeElement('defaultgrade'); $this->confirm = optional_param('confirm','0', PARAM_RAW); + // Make questiontext a required field for this question type. + $mform->addRule('questiontext', null, 'required', null, 'client'); + // display the questions from questiontext; if ( "" != optional_param('questiontext','', PARAM_RAW)) { // echo "

optional_param('questiontext'

";print_r(optional_param('questiontext','', PARAM_RAW));echo "

";