From 50476da5c36ce46fe759de809c2ee0c0643df5d9 Mon Sep 17 00:00:00 2001 From: gbateson Date: Tue, 1 Sep 2009 01:25:23 +0000 Subject: [PATCH] MDL-20184 use $this->error() to print error message if no questions found importing from a Hot Potatoes XML file into Moodle's question bank / Quiz module --- question/format/hotpot/format.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/question/format/hotpot/format.php b/question/format/hotpot/format.php index 8464ccfb5b..87ee56444c 100644 --- a/question/format/hotpot/format.php +++ b/question/format/hotpot/format.php @@ -106,6 +106,9 @@ class qformat_hotpot extends qformat_default { if (count($questions)) { return $questions; } else { + if (method_exists($this, 'error')) { // Moodle >= 1.8 + $this->error(get_string('giftnovalidquestion', 'quiz')); + } return false; } } -- 2.39.5