From b7236f9fdbaef884b041adad5c8d8678cd2dafb3 Mon Sep 17 00:00:00 2001 From: vinhle Date: Mon, 23 Apr 2018 14:51:10 +0700 Subject: [PATCH] MDL-61715 question: qbank_chooser is not intelligent about headings --- question/classes/output/qbank_chooser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/question/classes/output/qbank_chooser.php b/question/classes/output/qbank_chooser.php index 4e19d535807..348a2ecdb88 100644 --- a/question/classes/output/qbank_chooser.php +++ b/question/classes/output/qbank_chooser.php @@ -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');