MDL-61715 question: qbank_chooser is not intelligent about headings

This commit is contained in:
vinhle
2018-04-24 16:09:49 +07:00
parent 9a6b854e5c
commit b7236f9fdb
+4 -2
View File
@@ -57,10 +57,12 @@ class qbank_chooser extends \core\output\chooser {
return new qbank_chooser_item($qtype, $context);
}, $real));
$sections[] = new chooser_section('other', new lang_string('other'),
array_map(function($qtype) use ($context) {
if (!empty($fake)) {
$sections[] = new chooser_section('other', new lang_string('other'),
array_map(function ($qtype) use ($context) {
return new qbank_chooser_item($qtype, $context);
}, $fake));
}
parent::__construct(new moodle_url('/question/question.php'),
new lang_string('chooseqtypetoadd', 'question'), $sections, 'qtype');