-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.4.5
-
None
-
MOODLE_34_STABLE
I get an error with this test vendor/bin/phpunit "qformat_wordtable_export_test" question/format/wordtable/tests/wordtableformat_test.php but i don't have qtype_multichoiceset plugin in my system.
...EDebugging: Invalid get_string() identifier: 'pluginnamesummary' or component 'qtype_multichoiceset'. Perhaps you are missing $string['pluginnamesummary'] = ''; in /lang/en/qtype_multichoiceset.php? |
In moodle/question/format/wordtable/format.php (ln 548) this is the code to give this error :
// Add All-or-Nothing MCQ question type strings if present.
|
if (is_object(question_bank::get_qtype('multichoiceset', false))) { |
$textstrings['qtype_multichoiceset'] = array('pluginnamesummary','showeachanswerfeedback'); |
}
|
The question_bank::get_qtype('multichoiceset', false) always return an object even if you use question_bank::get_qtype('blablabla', false) . So no matter the result it's still an object.
I think it's better way to use to check if an qtype is installed
$qtypes = question_bank::get_all_qtypes();
|
and after checked if exist in array.