Merge branch 'MDL-78866-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE

This commit is contained in:
Ilya Tregubov
2023-08-03 09:39:17 +08:00
+2 -3
View File
@@ -474,9 +474,6 @@ class qformat_default {
$questionversion->status = \core_question\local\bank\question_version_status::QUESTION_STATUS_READY;
$questionversion->id = $DB->insert_record('question_versions', $questionversion);
$event = \core\event\question_created::create_from_question_instance($question, $this->importcontext);
$event->trigger();
if (isset($question->questiontextitemid)) {
$question->questiontext = file_save_draft_area_files($question->questiontextitemid,
$this->importcontext->id, 'question', 'questiontext', $question->id,
@@ -504,6 +501,8 @@ class qformat_default {
// Now to save all the answers and type-specific options
$result = question_bank::get_qtype($question->qtype)->save_question_options($question);
$event = \core\event\question_created::create_from_question_instance($question, $this->importcontext);
$event->trigger();
if (core_tag_tag::is_enabled('core_question', 'question')) {
// Is the current context we're importing in a course context?