MDL-79863 format_gift: Set ID & tags from comment

Previously, third party imports could not add tags or the self defined ID numbers.
This is because if the plugin defines an import it just returns after completing skipping this non specific function.
This commit is contained in:
Mathew May 2024-01-24 16:00:51 +08:00
parent 3d68bd3fa7
commit fbfbb7272a

View file

@ -281,6 +281,9 @@ class qformat_gift extends qformat_default {
// Determine question type.
$question->qtype = null;
// Extract any idnumber and tags from the comments.
list($question->idnumber, $question->tags) = $this->extract_idnumber_and_tags_from_comment($comments);
// Give plugins first try.
// Plugins must promise not to intercept standard qtypes
// MDL-12346, this could be called from lesson mod which has its own base class =(.
@ -325,10 +328,6 @@ class qformat_gift extends qformat_default {
}
}
// Extract any idnumber and tags from the comments.
list($question->idnumber, $question->tags) =
$this->extract_idnumber_and_tags_from_comment($comments);
if (!isset($question->qtype)) {
$giftqtypenotset = get_string('giftqtypenotset', 'qformat_gift');
$this->error($giftqtypenotset, $text);