diff --git a/question/qbank.js b/question/qbank.js
index <HASH>..<HASH> 100644
--- a/question/qbank.js
+++ b/question/qbank.js
@@ -85,7 +85,10 @@ qtype_chooser = {
         if (!document.getElementById('qtypechoicecontainer')) {
             return;
         }
-        qtype_chooser.container = new YAHOO.widget.Dialog('qtypechoicecontainer', {
+        var qtypechoicecontainer = document.getElementById('qtypechoicecontainer');
+        qtypechoicecontainer.parentNode.removeChild(qtypechoicecontainer);
+        document.body.appendChild(qtypechoicecontainer);
+        qtype_chooser.container = new YAHOO.widget.Dialog(qtypechoicecontainer, {
             constraintoviewport: true,
             visible: false,
             modal: true,
question bank: MDL-<I> Add question button did not work when the question bank was hidden.