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;