From 71a673cc3b8bee274704f9d5bb5bc4767992261e Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Thu, 27 Nov 2014 09:38:38 +0100 Subject: [PATCH] MDL-48342 Question: qformat_default::readquestion is broken --- mod/lesson/format.php | 3 ++- question/format.php | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mod/lesson/format.php b/mod/lesson/format.php index 76d56e38fe8..f6c13dd83a1 100644 --- a/mod/lesson/format.php +++ b/mod/lesson/format.php @@ -587,7 +587,8 @@ class qformat_default { /// this format, this function converts it into a question /// object suitable for processing and insertion into Moodle. - echo "

This flash question format has not yet been completed!

"; + // We should never get there unless the qformat plugin is broken. + throw new coding_exception('Question format plugin is missing important code: readquestion.'); return null; } diff --git a/question/format.php b/question/format.php index 827636f0e63..197ecf6d3e2 100644 --- a/question/format.php +++ b/question/format.php @@ -696,9 +696,8 @@ class qformat_default { * @return object question object */ protected function readquestion($lines) { - - $formatnotimplemented = get_string('formatnotimplemented', 'question'); - echo "

{$formatnotimplemented}

"; + // We should never get there unless the qformat plugin is broken. + throw new coding_exception('Question format plugin is missing important code: readquestion.'); return null; } @@ -930,8 +929,7 @@ class qformat_default { */ protected function writequestion($question) { // if not overidden, then this is an error. - $formatnotimplemented = get_string('formatnotimplemented', 'question'); - echo "

{$formatnotimplemented}

"; + throw new coding_exception('Question format plugin is missing important code: writequestion.'); return null; }