mirror of
https://github.com/moodle/moodle.git
synced 2025-04-11 19:42:35 +02:00
MDL-81115 question: Question bank tag filter to use all available tags.
This makes the tags which are available to the user on the question bank tag filter, use tags from all available contexts, not just that course. This means they can filter by tags assigned to system questions as well, for example.
This commit is contained in:
parent
0888a6d324
commit
c5633888e2
@ -49,20 +49,7 @@ class tag_condition extends condition {
|
||||
return;
|
||||
}
|
||||
parent::__construct($qbank);
|
||||
$cat = $qbank->get_pagevars('cat');
|
||||
if (is_array($cat)) {
|
||||
foreach ($cat as $value) {
|
||||
[, $contextid] = explode(',', $value);
|
||||
$catcontext = \context::instance_by_id($contextid);
|
||||
$this->contexts[] = $catcontext;
|
||||
}
|
||||
} else {
|
||||
[, $contextid] = explode(',', $qbank->get_pagevars('cat'));
|
||||
$catcontext = \context::instance_by_id($contextid);
|
||||
$this->contexts[] = $catcontext;
|
||||
}
|
||||
$thiscontext = $qbank->get_most_specific_context();
|
||||
$this->contexts[] = $thiscontext;
|
||||
$this->contexts = $qbank->contexts->all();
|
||||
$this->selectedtagids = $this->filter->values ?? [];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user