From: tjhunt Date: Tue, 17 Feb 2009 06:14:54 +0000 (+0000) Subject: random question: MDL-18174 Fix notice when adding a random question to a quiz. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5348b899c4701bcbe1fc5fd969666a5441f5bc3e;p=moodle.git random question: MDL-18174 Fix notice when adding a random question to a quiz. --- diff --git a/question/type/random/questiontype.php b/question/type/random/questiontype.php index f37b566bb2..f9089b6db6 100644 --- a/question/type/random/questiontype.php +++ b/question/type/random/questiontype.php @@ -108,6 +108,13 @@ class random_qtype extends default_questiontype { return get_string('random', 'quiz') .' ('. $category->name .')'; } + function save_question($question, $form, $course) { + $form->name = ''; + // Name is not a required field for random questions, but parent::save_question + // Assumes that it is. + return parent::save_question($question, $form, $course); + } + function save_question_options($question) { global $DB;