From 5348b899c4701bcbe1fc5fd969666a5441f5bc3e Mon Sep 17 00:00:00 2001 From: tjhunt <tjhunt> Date: Tue, 17 Feb 2009 06:14:54 +0000 Subject: [PATCH] random question: MDL-18174 Fix notice when adding a random question to a quiz. --- question/type/random/questiontype.php | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.39.5