Current Path : C:/xampp/htdocs/moodle/mod/quiz/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/quiz/amd/build/random_question_form_preview.min.js |
define ("mod_quiz/random_question_form_preview",["jquery","core/ajax","core/str","core/notification","core/templates","core/paged_content_factory"],function(a,b,c,d,e,f){var g="mod_quiz/random_question_form_preview_question_list",h={LOADING_ICON_CONTAINER:"[data-region=\"overlay-icon-container\"]",QUESTION_COUNT_CONTAINER:"[data-region=\"question-count-container\"]",QUESTION_LIST_CONTAINER:"[data-region=\"question-list-container\"]"},i=function(a){a.find(h.LOADING_ICON_CONTAINER).removeClass("hidden")},j=function(a){a.find(h.LOADING_ICON_CONTAINER).addClass("hidden")},k=function(a,b){c.get_string("questionsmatchingfilter","mod_quiz",b).then(function(b){a.find(h.QUESTION_COUNT_CONTAINER).html(b)}).fail(d.exception)},l=function(a,c,d,e,f,g){return b.call([{methodname:"core_question_get_random_question_summaries",args:{categoryid:a,includesubcategories:c,tagids:d,contextid:e,limit:f,offset:g}}])[0]},m=function(a,b,c,h,i,j){return f.createFromAjax(i,5,function(f){return f.map(function(f){var i=f.limit,k=f.offset;if(0==k){return e.render(g,{questions:j})}else{return l(a,b,c,h,i,k).then(function(a){var b=a.questions;return e.render(g,{questions:b})}).fail(d.exception)}})})};return{reload:function reload(b,c,f,g,n){i(b);return l(c,f,g,n,5,0).then(function(a){var c=a.totalcount;k(b,c);return a}).then(function(b){var d=b.totalcount,e=b.questions;if(e.length){return m(c,f,g,n,d,e)}else{return a.Deferred().resolve("","")}}).then(function(a,c){var d=b.find(h.QUESTION_LIST_CONTAINER);e.replaceNodeContents(d,a,c)}).always(function(){j(b)}).fail(d.exception)},showLoadingIcon:i,hideLoadingIcon:j}}); //# sourceMappingURL=random_question_form_preview.min.js.map