mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-61410 question: support course tags on import
This commit is contained in:
parent
2ee6e02e21
commit
13596866e7
2 changed files with 24 additions and 9 deletions
|
@ -425,8 +425,14 @@ class qformat_default {
|
|||
|
||||
$result = question_bank::get_qtype($question->qtype)->save_question_options($question);
|
||||
|
||||
if (isset($question->tags)) {
|
||||
core_tag_tag::set_item_tags('core_question', 'question', $question->id, $question->context, $question->tags);
|
||||
if (!empty($question->tags)) {
|
||||
core_tag_tag::set_item_tags('core_question', 'question', $question->id,
|
||||
$question->context, $question->tags);
|
||||
}
|
||||
|
||||
if (!empty($question->coursetags)) {
|
||||
core_tag_tag::set_item_tags('core_question', 'question', $question->id,
|
||||
context_course::instance($this->course->id), $question->coursetags);
|
||||
}
|
||||
|
||||
if (!empty($result->error)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue