From f88d75e51a9acb298b70bcdc80a9bb10656900f2 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Wed, 7 Aug 2013 10:02:36 +0200 Subject: [PATCH] MDL-41063 Lesson qformat_default class is missing an error function --- mod/lesson/format.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mod/lesson/format.php b/mod/lesson/format.php index e4916d6ed88..22201b1fdd3 100644 --- a/mod/lesson/format.php +++ b/mod/lesson/format.php @@ -301,6 +301,26 @@ class qformat_default { $this->importcontext = $context; } + /** + * Handle parsing error + * + * @param string $message information about error + * @param string $text imported text that triggered the error + * @param string $questionname imported question name + */ + protected function error($message, $text='', $questionname='') { + $importerrorquestion = get_string('importerrorquestion', 'question'); + + echo "
\n"; + echo "$importerrorquestion $questionname"; + if (!empty($text)) { + $text = s($text); + echo "
$text
\n"; + } + echo "$message\n"; + echo "
"; + } + function importpreprocess() { // Does any pre-processing that may be desired return true;