Skip to content

Commit

Permalink
MDL-48342 Question: qformat_default::readquestion is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Michel Vedrine committed Nov 28, 2014
1 parent d87bcfb commit 762ee13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion mod/lesson/format.php
Expand Up @@ -587,7 +587,8 @@ protected function readquestion($lines) {
/// this format, this function converts it into a question
/// object suitable for processing and insertion into Moodle.

echo "<p>This flash question format has not yet been completed!</p>";
// 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;
}
Expand Down
1 change: 0 additions & 1 deletion mod/quiz/lang/en/quiz.php
Expand Up @@ -360,7 +360,6 @@
$string['finishreview'] = 'Finish review';
$string['forceregeneration'] = 'force regeneration';
$string['formatnotfound'] = 'Import/export format {$a} not found';
$string['formatnotimplemented'] = 'This format has not been correctly implemented, please post a bug report';
$string['formulaerror'] = 'Formula errors!';
$string['fractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%<br />Instead, they add up to {$a}%<br />Do you want to go back and fix this question?';
$string['fractionsnomax'] = 'One of the answers should be 100%, so that it is<br />possible to get a full grade for this question.<br />Do you want to go back and fix this question?';
Expand Down
8 changes: 3 additions & 5 deletions question/format.php
Expand Up @@ -696,9 +696,8 @@ protected function add_blank_combined_feedback($question) {
* @return object question object
*/
protected function readquestion($lines) {

$formatnotimplemented = get_string('formatnotimplemented', 'question');
echo "<p>{$formatnotimplemented}</p>";
// 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;
}
Expand Down Expand Up @@ -930,8 +929,7 @@ protected function exportpostprocess() {
*/
protected function writequestion($question) {
// if not overidden, then this is an error.
$formatnotimplemented = get_string('formatnotimplemented', 'question');
echo "<p>{$formatnotimplemented}</p>";
throw new coding_exception('Question format plugin is missing important code: writequestion.');
return null;
}

Expand Down

0 comments on commit 762ee13

Please sign in to comment.