-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.3, 2.8.1
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
If a question import format don't overwrite the default readquestions function, it must absolutely overwrite the readquestion function.
Currently the default readquestion function is
protected function readquestion($lines) {
|
|
$formatnotimplemented = get_string('formatnotimplemented', 'question');
|
echo "<p>{$formatnotimplemented}</p>";
|
|
return null;
|
}
|
There are several problems here:
- I think this is wrong, the format is broken and we should throw a coding exception
- but additionally the 'formatnotimplemented' string is defined in the quiz component, not in the question component !
So if the qformat plugin is broken the user will in fact see
Invalid get_string() identifier: 'formatnotimplemented' or component 'question'. Perhaps you are missing $string['formatnotimplemented'] = ''; in lang/en/question.php?
|
I discovered this mess when working in the lesson module that of course "borrows" the qformats plugins but implement it's own default class and believe it or not the default readquestion function in lesson is even more weird than the quiz one ! See:
protected function readquestion($lines) {
|
/// Given an array of lines known to define a question in
|
/// 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>";
|
|
return null;
|
}
|
You see: why is there a mention of flash here ?? Is this sentence understandable by any Moodle user ? No !
This is of course a very minor problem, but I don't like to see things like this in Moodle, so my proposal is I assign this issue to myself