Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/mod/quiz/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/mod/quiz/amd/build/modal_quiz_question_bank.min.js

define ("mod_quiz/modal_quiz_question_bank",["jquery","core/yui","core/notification","core/modal","core/modal_events","core/modal_registry","core/fragment"],function(a,b,c,d,e,f,g){var h=!1,i={ADD_TO_QUIZ_CONTAINER:"td.addtoquizaction",ANCHOR:"a[href]",PREVIEW_CONTAINER:"td.previewaction",SEARCH_OPTIONS:"#advancedsearch",DISPLAY_OPTIONS:"#displayoptions",ADD_QUESTIONS_FORM:"form[action=\"edit.php\"]"},j=function(a){d.call(this,a);this.contextId=null;this.addOnPageId=null};j.TYPE="mod_quiz-quiz-question-bank";j.prototype=Object.create(d.prototype);j.prototype.constructor=j;j.prototype.setContextId=function(a){this.contextId=a};j.prototype.getContextId=function(){return this.contextId};j.prototype.setAddOnPageId=function(a){this.addOnPageId=a};j.prototype.getAddOnPageId=function(){return this.addOnPageId};j.prototype.show=function(){this.reloadBodyContent(window.location.search);return d.prototype.show.call(this)};j.prototype.reloadBodyContent=function(a){var b=g.loadFragment("mod_quiz","quiz_question_bank",this.getContextId(),{querystring:a}).fail(c.exception);this.setBody(b)};j.prototype.handleAddToQuizEvent=function(a,b){var c=b.attr("href")+"&addonpage="+this.getAddOnPageId();b.attr("href",c)};j.prototype.handlePreviewContainerEvent=function(a,b){window.openpopup(a,{url:b.attr("href"),name:"questionpreview",options:["height=600","width=800","top=0","left=0","menubar=0","location=0","scrollbars","resizable","toolbar","status","directories=0","fullscreen=0","dependent"].join(",")})};j.prototype.handleDisplayOptionFormEvent=function(b){b.stopPropagation();b.preventDefault();var c=a(b.target).closest(i.DISPLAY_OPTIONS),d="?"+c.serialize();this.reloadBodyContent(d)};j.prototype.registerDisplayOptionListeners=function(){this.getModal().on("change",i.DISPLAY_OPTIONS,function(b){var c=a(b.target);if(c.attr("aria-autocomplete")){return}this.handleDisplayOptionFormEvent(b)}.bind(this));this.getModal().on("submit",i.DISPLAY_OPTIONS,function(a){this.handleDisplayOptionFormEvent(a)}.bind(this))};j.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.registerDisplayOptionListeners();this.getModal().on("submit",i.ADD_QUESTIONS_FORM,function(b){var c=a(b.currentTarget);a("<input />").attr("type","hidden").attr("name","addonpage").attr("value",this.getAddOnPageId()).appendTo(c)}.bind(this));this.getModal().on("click",i.ANCHOR,function(b){var c=a(b.currentTarget);if(c.closest(i.ADD_TO_QUIZ_CONTAINER).length){this.handleAddToQuizEvent(b,c);return}if(c.closest(i.PREVIEW_CONTAINER).length){this.handlePreviewContainerEvent(b,c);return}if(c.closest(i.SEARCH_OPTIONS).length){return}b.preventDefault();this.reloadBodyContent(c.prop("search"))}.bind(this));this.getRoot().on(e.bodyRendered,function(){b.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()})})};if(!h){f.register(j.TYPE,j,"core/modal");h=!0}return j});
//# sourceMappingURL=modal_quiz_question_bank.min.js.map