]> git.mjollnir.org Git - moodle.git/commitdiff
random question: MDL-18174 Fix notice when adding a random question to a quiz.
authortjhunt <tjhunt>
Tue, 17 Feb 2009 06:14:54 +0000 (06:14 +0000)
committertjhunt <tjhunt>
Tue, 17 Feb 2009 06:14:54 +0000 (06:14 +0000)
question/type/random/questiontype.php

index f37b566bb2e348be18f98d37bb8c9dfd5c9cb97f..f9089b6db69d78de847a48dd92e747eee0989bb9 100644 (file)
@@ -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;