function _typeof2(obj){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof2(obj)}define("taoQtiTest/runner/plugins/content/accessibility/focusOnFirstField",["lodash","taoTests/runner/plugin","ckeditor"],function(_,pluginFactory,ckEditor){'use strict';function isIOSDevice(){return /(iPhone|iPad)/i.test(navigator.userAgent)}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,ckEditor=ckEditor&&Object.prototype.hasOwnProperty.call(ckEditor,"default")?ckEditor["default"]:ckEditor;var focusOnFirstField=pluginFactory({name:"focusOnFirstField",init:function(){var self=this;isIOSDevice()||this.getTestRunner().after("renderitem",function(){var $input=self.getAreaBroker().getContentArea().find(".qti-itemBody").find("input, textarea, select").not(":input[type=button], :input[type=submit], :input[type=reset]").first(),$cke=$input.closest(".qti-interaction").find(".cke");$cke.length?_.delay(function(){ckEditor.instances[$cke.attr("id").replace(/^cke_/,"")].focus()},100):$input.focus()})}});return focusOnFirstField}),define("taoQtiTest/runner/plugins/content/accessibility/jumplinks/helpers",["exports","i18n"],function(exports,__){'use strict';__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__;var getItemStatus=function(item){return item.flagged?__("Flagged for review"):item.answered?__("Answered"):item.viewed?__("Not answered"):__("Not seen")};exports.getItemStatus=getItemStatus,exports.getJumpElementFactory=function(broker){return{get container(){return broker.getContainer()},get question(){return broker.getContainer().find(".content-wrapper").first()},get navigation(){return broker.getNavigationArea().find(":not(.hidden)[tabindex]").first()},get toolbox(){return broker.getToolboxArea().find(":not(.hidden)[tabindex]").first()},get teststatus(){return broker.getPanelArea().find(":not(.hidden)[tabindex]").first()}}},exports.isReviewPanelHidden=function(testRunner){return testRunner.getAreaBroker().getPanelArea().find(".qti-navigator").is(".hidden")},Object.defineProperty(exports,"__esModule",{value:!0})}),define("taoQtiTest/runner/plugins/content/accessibility/jumplinks/jumplinks",["lodash","ui/component","handlebars"],function(_,component,Handlebars){'use strict';function jumplinksTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function jumplinksFactory(config){var jumplinksBox=component({},defaults).on("render",function(){var _this=this;_.forEach([{selector:"[data-jump=question] ",eventName:"jump",eventParam:"question"},{selector:"[data-jump=navigation]",eventName:"jump",eventParam:"navigation"},{selector:"[data-jump=toolbox]",eventName:"jump",eventParam:"toolbox"},{selector:"[data-jump=teststatus]",eventName:"jump",eventParam:"teststatus"},{selector:"[data-jump=shortcuts]",eventName:"shortcuts",eventParam:"shortcuts"}],function(linkDescription){var $link=_this.getElement().find(linkDescription.selector),handleLink=function(){_this.trigger(linkDescription.eventName,linkDescription.eventParam),_this.getElement().find(":focus").blur()};$link&&($link.on("click",handleLink),$link.on("keyup",function(event){[32,13].includes(event.keyCode)&&handleLink()}))})});return jumplinksBox.setTemplate(jumplinksTpl),_.defer(function(){jumplinksBox.init(config)}),jumplinksBox}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="\n",buffer}),defaults={};return jumplinksFactory}),define("taoQtiTest/runner/helpers/map",["lodash"],function(_){'use strict';function getEmptyStats(){return{questions:0,answered:0,flagged:0,viewed:0,total:0,questionsViewed:0}}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;return{getJumps:function(map){return map&&map.jumps},getParts:function(map){return map&&map.parts},getSections:function(map){var parts=this.getParts(map),result={};return _.forEach(parts,function(part){var sections=part.sections;sections&&_.forEach(sections,function(section){result[section.id]=section})}),result},getActiveItem:function(map){var parts=this.getParts(map),result={};return _.forEach(parts,function(part){var sections=part.sections;sections&&_.forEach(sections,function(section){if(section.active){var items=section.items;_.forEach(items,function(item){item.active&&(result=item)})}})}),result},getNextSections:function(map,sectionId){var sections=this.getSections(map),result={},canList=!1;return _.forEach(sections,function(section){canList&&(result[section.id]=section),section.id===sectionId&&(canList=!0)}),result},getJump:function(map,position){var jumps=this.getJumps(map);return jumps&&jumps[position]},getPart:function(map,partName){var parts=this.getParts(map);return parts&&parts[partName]},getSection:function(map,sectionName){var parts=this.getParts(map),section=null;return _.forEach(parts,function(part){var sections=part.sections;if(sections&§ions[sectionName])return section=sections[sectionName],!1}),section},getItem:function(map,itemIdentifier){var jump=_.find(this.getJumps(map),{identifier:itemIdentifier});return this.getItemAt(map,jump&&jump.position)},getItemCategories:function(map,itemIdentifier){var item=this.getItem(map,itemIdentifier);return item&&Array.isArray(item.categories)?item.categories:[]},hasItemCategory:function(map,itemIdentifier,category){var fuzzyMatch=!!(3\n

",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"

\n \n \n ",buffer}function program2(depth0,data){var buffer="",stack1,helper;return buffer+="\n
  • \n \n ",(helper=helpers.shortcut)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.shortcut,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n \n ",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n
  • \n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="
    \n
    \n

    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Keyboard Navigation",options):helperMissing.call(depth0,"__","Keyboard Navigation",options)))+"\n

    \n
    \n

    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Keyboard shortcuts for the Accessibility Tools are available to the Test-taker.",options):helperMissing.call(depth0,"__","Keyboard shortcuts for the Accessibility Tools are available to the Test-taker.",options)))+"\n

    \n

    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"You can magnify the content by up to 200%. Check your browser settings to find out how to do it.",options):helperMissing.call(depth0,"__","You can magnify the content by up to 200%. Check your browser settings to find out how to do it.",options)))+"\n

    \n
    \n \n ",stack1=helpers.each.call(depth0,depth0&&depth0.shortcutsGroups,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n
    \n",buffer}),defaults={shortcutsGroups:[{id:"navigation-shortcuts",label:__("Navigation shortcuts"),shortcuts:[{id:"next",shortcut:"ALT + Shift + N",label:__("Go to the next question")},{id:"previous",shortcut:"ALT + Shift + P",label:__("Go to the previous question")},{id:"current",shortcut:"ALT + Shift + Q",label:__("Go to the current question")},{id:"top",shortcut:"ALT + Shift + T",label:__("Go to the top of the page")}]}]};return shortcutsBoxFactory}),define("taoQtiTest/runner/plugins/content/accessibility/jumplinks/plugin",["i18n","jquery","taoTests/runner/plugin","taoQtiTest/runner/helpers/isReviewPanelEnabled","taoQtiTest/runner/plugins/content/accessibility/jumplinks/helpers","taoQtiTest/runner/plugins/content/accessibility/jumplinks/jumplinks","taoQtiTest/runner/plugins/content/accessibility/jumplinks/shortcuts","util/shortcut","util/namespace","handlebars"],function(__,$$1,pluginFactory,isReviewPanelEnabled,helpers,jumplinksFactory,shortcutsFactory,shortcut,namespaceHelper,Handlebars){'use strict';function containerTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,isReviewPanelEnabled=isReviewPanelEnabled&&Object.prototype.hasOwnProperty.call(isReviewPanelEnabled,"default")?isReviewPanelEnabled["default"]:isReviewPanelEnabled,jumplinksFactory=jumplinksFactory&&Object.prototype.hasOwnProperty.call(jumplinksFactory,"default")?jumplinksFactory["default"]:jumplinksFactory,shortcutsFactory=shortcutsFactory&&Object.prototype.hasOwnProperty.call(shortcutsFactory,"default")?shortcutsFactory["default"]:shortcutsFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"\n"}),plugin=pluginFactory({name:"jumplinks",init:function(){var _this=this,testRunner=this.getTestRunner(),item=testRunner.getCurrentItem(),config={isReviewPanelEnabled:isReviewPanelEnabled(testRunner),questionStatus:helpers.getItemStatus(item)},testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})[this.getName()]||{},areaBroker=this.getAreaBroker(),getJumpElement=helpers.getJumpElementFactory(areaBroker),shortcutsConfig=-1===navigator.appVersion.indexOf("Mac")?{}:{shortcutsGroups:[{id:"navigation-shortcuts",label:__("Navigation shortcuts"),shortcuts:[{id:"next",shortcut:"OPTION + Shift + N",label:__("Go to the next question")},{id:"previous",shortcut:"OPTION + Shift + P",label:__("Go to the previous question")},{id:"current",shortcut:"OPTION + Shift + Q",label:__("Go to the current question")},{id:"top",shortcut:"OPTION + Shift + T",label:__("Go to the top of the page")}]}]};testRunnerOptions.allowShortcuts&&(pluginShortcuts.goToTop&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.goToTop,this.getName(),!0),function(){$$1("[tabindex]").first().focus()},{avoidInput:!0,prevent:!0}),pluginShortcuts.goToQuestion&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.goToQuestion,this.getName(),!0),function(){getJumpElement.question.focus()},{avoidInput:!0,prevent:!0})),this.jumplinks=jumplinksFactory(config).on("render",function(){_this.jumplinks.on("jump",function(jumpTo){var $element=getJumpElement[jumpTo];$element.focus()}),_this.jumplinks.on("shortcuts",function(){_this.shortcuts||(_this.shortcuts=shortcutsFactory(shortcutsConfig),_this.shortcuts.render(_this.getAreaBroker().getControlArea()),_this.shortcuts.on("close",function(){_this.shortcuts.destroy(),_this.shortcuts=null}))})}).on("update",function(params){this.trigger("changeReviewPanel",params.isReviewPanelEnabled),this.trigger("changeQuesitionStatus",params.questionStatus)}).on("changeReviewPanel",function(enabled){var elem=this.getElement(),panelJumplink=elem.find("[data-jump=\"teststatus\"]").parent();enabled?panelJumplink.removeClass("hidden"):panelJumplink.addClass("hidden")}).on("changeQuesitionStatus",function(questionStatus){var elem=this.getElement(),text="".concat(__("Question")," - ").concat(questionStatus);elem.find("[data-jump=\"question\"] > b").text(text)}),testRunner.on("renderitem",function(){var currentItem=testRunner.getCurrentItem(),updatedConfig={isReviewPanelEnabled:!helpers.isReviewPanelHidden(testRunner)&&isReviewPanelEnabled(testRunner),questionStatus:helpers.getItemStatus(currentItem)},announcedText=__("Item %s loaded",currentItem.position),$announce=$$1("[aria-live=polite][role=alert]").first();1!==$announce.length&&($announce=$$1("
    "),$$1("main").first().append($announce)),$announce.text(announcedText),_this.jumplinks.trigger("update",updatedConfig)}).on("tool-flagitem",function(){var currentItem=testRunner.getCurrentItem(),questionStatus=helpers.getItemStatus(Object.assign({},currentItem,{flagged:!currentItem.flagged}));_this.jumplinks.trigger("changeQuesitionStatus",questionStatus)}).on("tool-reviewpanel",function(){var wasHidden=helpers.isReviewPanelHidden(testRunner);_this.jumplinks.trigger("changeReviewPanel",wasHidden)}).after("renderitem",function(){getJumpElement.question.attr("tabindex","-1").focus()})},render:function(){var jumplinksContainer=$$1(containerTpl());$$1(".content-wrap").prepend(jumplinksContainer),this.jumplinks.render(jumplinksContainer)}});return plugin}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/headerNavigation",["jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"header",init:function(){var _this=this,config=this.getConfig(),$headerBar=$("header"),$headerElements=$headerBar.find("a:visible"),registerHeaderNavigator=function(id,group,$elements){var elements=navigableDomElement.createFromDoms($elements);if(elements.length){var navigator=keyNavigator({id:id,group:group,elements:elements,propagateTab:!1,defaultPosition:0});helpers.setupItemsNavigator(navigator,config),helpers.setupClickableNavigator(navigator),_this.keyNavigators.push(navigator)}};return this.keyNavigators=[],config.flatNavigation?$headerElements.each(function(index,element){return registerHeaderNavigator("".concat("header-toolbar","-").concat(index),$headerBar,$(element))}):registerHeaderNavigator("header-toolbar",$headerBar,$headerElements),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/toolbarNavigation",["lodash","jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function(_,$,keyNavigator,navigableDomElement,helpers){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"toolbar",init:function(){var _this=this,config=this.getConfig(),$navigationBar=this.getTestRunner().getAreaBroker().getContainer().find(".bottom-action-bar"),$toolbarElements=$navigationBar.find(".action:not(.btn-group):visible, .action.btn-group .li-inner:visible");config.reverseBottomToolbar&&($toolbarElements=$($toolbarElements.get().reverse()));var registerToolbarNavigator=function(id,group,$elements){var elements=navigableDomElement.createFromDoms($elements);if(elements.length){var navigator=keyNavigator({id:id,group:group,elements:elements,propagateTab:!1,defaultPosition:function(navigableElements){var pos=0;return config.autoFocus&&(pos=navigableElements.length-1,_.forEach(navigableElements,function(navigable,i){var $element=navigable.getElement();("move-forward"===$element.data("control")||"move-end"===$element.data("control"))&&(pos=i)})),pos}});helpers.setupItemsNavigator(navigator,config),helpers.setupClickableNavigator(navigator),_this.keyNavigators.push(navigator)}};return this.keyNavigators=[],config.flatNavigation?$toolbarElements.each(function(index,element){return registerToolbarNavigator("".concat("bottom-toolbar","-").concat(index),$navigationBar,$(element))}):registerToolbarNavigator("bottom-toolbar",$navigationBar,$toolbarElements),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/topToolbarNavigation",["jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"top-toolbar",init:function(){var _this=this,config=this.getConfig(),$topToolbar=this.getTestRunner().getAreaBroker().getContainer().find(".top-action-bar"),$toolbarElements=$topToolbar.find(".timer-toggler"),registerTopToolbarNavigator=function(id,group,$elements){var elements=navigableDomElement.createFromDoms($elements);if(elements.length){var navigator=keyNavigator({id:id,group:group,elements:elements,propagateTab:!1});helpers.setupItemsNavigator(navigator,config),helpers.setupClickableNavigator(navigator),_this.keyNavigators.push(navigator)}};return this.keyNavigators=[],$toolbarElements.each(function(index,element){return registerTopToolbarNavigator("".concat("top-toolbar","-").concat(index),$topToolbar,$(element))}),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/navigatorNavigation",["lodash","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function(_,keyNavigator,navigableDomElement,helpers){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;var selectors={filters:".qti-navigator-filters .qti-navigator-filter",unseenItems:".qti-navigator-tree .qti-navigator-item:not(.unseen) .qti-navigator-label",allItems:".qti-navigator-tree .qti-navigator-item .qti-navigator-label"};return{name:"navigator",init:function(){var config=this.getConfig(),$panel=this.getTestRunner().getAreaBroker().getPanelArea(),$navigator=$panel.find(".qti-navigator"),itemListingVisited=!1,filtersNavigator,itemsNavigator,currentFilter;this.managedNavigators=[],this.keyNavigators=[];var testStatusNavigation;if($navigator.length&&!$navigator.hasClass("disabled")){var $filters=$navigator.find(selectors.filters),navigableFilters=navigableDomElement.createFromDoms($filters),$testStatusHeader=$navigator.find(".qti-navigator-info.collapsible > .qti-navigator-label"),navigableTestStatus=navigableDomElement.createFromDoms($testStatusHeader);$testStatusHeader.addClass("key-navigation-actionable"),navigableTestStatus.length&&(testStatusNavigation=keyNavigator({keepState:config.keepState,id:"navigator-test-status",propagateTab:!1,elements:navigableTestStatus,group:$testStatusHeader}),helpers.setupItemsNavigator(testStatusNavigation,{keyNextItem:config.keyNextTab||config.keyNextItem,keyPrevItem:config.keyPrevTab||config.keyPrevItem}),this.keyNavigators.push(testStatusNavigation),this.managedNavigators.push(testStatusNavigation)),navigableFilters.length&&(filtersNavigator=keyNavigator({keepState:config.keepState,id:"navigator-filters",propagateTab:!1,elements:navigableFilters,group:$navigator.find(".qti-navigator-filters")}),helpers.setupItemsNavigator(filtersNavigator,{keyNextItem:config.keyNextTab||config.keyNextItem,keyPrevItem:config.keyPrevTab||config.keyPrevItem}),helpers.setupClickableNavigator(filtersNavigator),config.keepState&&filtersNavigator.on("focus",function(cursor){if(config.keepState){var $element=cursor.navigable.getElement(),filter=$element.data("mode");$element.click(),currentFilter!==filter&&(itemListingVisited=!1),currentFilter=filter}}),config.keyNextContent&&filtersNavigator.on(config.keyNextContent,function(elem){helpers.allowedToNavigateFrom(elem)&&itemsNavigator&&_.defer(function(){itemListingVisited?itemsNavigator.first():itemsNavigator.focus()})}),config.keyPrevContent&&filtersNavigator.on(config.keyPrevContent,function(elem){helpers.allowedToNavigateFrom(elem)&&itemsNavigator&&_.defer(function(){itemsNavigator.last()})}),this.keyNavigators.push(filtersNavigator),this.managedNavigators.push(filtersNavigator));var $navigatorTree=$panel.find(".qti-navigator-tree"),skipAheadEnabled=$panel.find(".qti-navigator").is(".skipahead-enabled"),$trees=$navigator.find(skipAheadEnabled?selectors.allItems:selectors.unseenItems),navigableTrees=navigableDomElement.createFromDoms($trees);$trees.first().addClass("key-navigation-scrollable-up"),$trees.last().addClass("key-navigation-scrollable-down"),navigableTrees.length&&(itemsNavigator=keyNavigator({id:"navigator-items",elements:navigableTrees,group:$navigatorTree,defaultPosition:function(navigableElements){var pos=0;return(config.flatNavigation||"flagged"!==currentFilter)&&(pos=_.findIndex(navigableElements,function(navigable){var $parent=navigable.getElement().parent(".qti-navigator-item");if($parent.hasClass("active")&&$parent.is(":visible"))return!0})),pos}}).on("focus",function(cursor){itemListingVisited=!0,cursor.navigable.getElement().parent().addClass("key-navigation-highlight")}).on("blur",function(cursor){cursor.navigable.getElement().parent().removeClass("key-navigation-highlight")}),helpers.setupItemsNavigator(itemsNavigator,{keyNextItem:config.keyNextContent||config.keyNextItem,keyPrevItem:config.keyPrevContent||config.keyPrevItem}),helpers.setupClickableNavigator(itemsNavigator),config.keepState&&itemsNavigator.on("lowerbound upperbound",function(){filtersNavigator&&filtersNavigator.focus()}),config.keyNextTab&&config.keyPrevTab?(itemsNavigator.on(config.keyNextTab,function(elem){helpers.allowedToNavigateFrom(elem)&&filtersNavigator&&filtersNavigator.focus().next()}),itemsNavigator.on(config.keyPrevTab,function(elem){helpers.allowedToNavigateFrom(elem)&&filtersNavigator&&filtersNavigator.focus().previous()})):this.keyNavigators.push(itemsNavigator),this.managedNavigators.push(itemsNavigator))}return this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.managedNavigators.forEach(function(navigator){return navigator.destroy()}),this.managedNavigators=[],this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/pageNavigation",["jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"page",init:function(){var _this=this,config=this.getConfig();return this.keyNavigators=[],this.getTestRunner().getAreaBroker().getContainer().find(".content-wrapper").addClass("key-navigation-scrollable").each(function(i,el){var $element=$(el),navigator=keyNavigator({id:"".concat("item-content-wrapper","-").concat(_this.keyNavigators.length),elements:navigableDomElement.createFromDoms($element),group:$element,propagateTab:!1});helpers.setupItemsNavigator(navigator,config),_this.keyNavigators.push(navigator)}),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/rubricsNavigation",["jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"rubrics",init:function(){var _this=this,config=this.getConfig();return this.keyNavigators=[],this.getTestRunner().getAreaBroker().getContainer().find(".qti-rubricBlock").addClass("key-navigation-scrollable").each(function(i,el){var $element=$(el),navigator=keyNavigator({id:"".concat("rubric-element-navigation-group","-").concat(_this.keyNavigators.length),elements:navigableDomElement.createFromDoms($element),group:$element,propagateTab:!1});helpers.setupItemsNavigator(navigator,config),_this.keyNavigators.push(navigator)}),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/itemNavigation",["jquery","ui/scroller","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,scrollHelper,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,scrollHelper=scrollHelper&&Object.prototype.hasOwnProperty.call(scrollHelper,"default")?scrollHelper["default"]:scrollHelper,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;var addLabelledByAttribute=function(cursor){var $element=cursor.navigable.getElement(),value=$element.attr("value"),name=$element.attr("name");name&&$element.attr("aria-labelledby","".concat(name.replace("response-","choice-"),"-").concat(value))},removeLabelledByAttribute=function(cursor){var $element=cursor.navigable.getElement();$element.removeAttr("aria-labelledby","")},manageLabelledByAttribute=function(navigator){navigator&&(navigator.on("focus",addLabelledByAttribute),navigator.on("blur",removeLabelledByAttribute))};return{name:"item",init:function(){var _this=this;this.keyNavigators=[];var config=this.getConfig(),$content=this.getTestRunner().getAreaBroker().getContentArea(),getQtiChoice=function(cursor){return cursor&&cursor.navigable.getElement().closest(".qti-choice")},addNavigator=function($elements,group){var loop=!!(2node.clientHeight}return!1},element};return $content.find(".stimulus-container").addClass("key-navigation-scrollable").each(function(i,el){var $element=$(el),elements=navigableDomElement.createFromDoms($element).map(isEnabledDecorator);$element.attr("aria-label",__("Passage"));var navigator=keyNavigator({id:"".concat("stimulus-element-navigation-group","-").concat(i),elements:elements,group:$element,propagateTab:!1});helpers.setupItemsNavigator(navigator,config),_this.keyNavigators.push(navigator)}),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/jumpLinks",["jquery","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers"],function($,keyNavigator,navigableDomElement,helpers){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement;return{name:"jump-links",init:function(){var _this=this,config=this.getConfig(),$jumpLinksBox=$(".content-wrap"),$links=$jumpLinksBox.find(".jump-link");this.keyNavigators=[];var registerTopToolbarNavigator=function(id,group,$elements){var elements=navigableDomElement.createFromDoms($elements);if(elements.length){var navigator=keyNavigator({id:id,group:group,elements:elements,propagateTab:!1});helpers.setupItemsNavigator(navigator,config),helpers.setupClickableNavigator(navigator),_this.keyNavigators.push(navigator)}};return $links.each(function(index,element){return registerTopToolbarNavigator("".concat("jump-links","-").concat(index),$jumpLinksBox,$(element))}),this},getNavigators:function(){return this.keyNavigators},destroy:function(){return this.keyNavigators.forEach(function(navigator){return navigator.destroy()}),this.keyNavigators=[],this}}}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/index",["exports","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/headerNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/toolbarNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/topToolbarNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/navigatorNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/pageNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/rubricsNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/itemNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/linearItemNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/stimulusNavigation","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/jumpLinks"],function(exports,headerNavigation,toolbarNavigation,topToolbarNavigation,navigatorNavigation,pageNavigation,rubricsNavigation,itemNavigation,linearItemNavigation,stimulusNavigation,jumpLinks){'use strict';headerNavigation=headerNavigation&&Object.prototype.hasOwnProperty.call(headerNavigation,"default")?headerNavigation["default"]:headerNavigation,toolbarNavigation=toolbarNavigation&&Object.prototype.hasOwnProperty.call(toolbarNavigation,"default")?toolbarNavigation["default"]:toolbarNavigation,topToolbarNavigation=topToolbarNavigation&&Object.prototype.hasOwnProperty.call(topToolbarNavigation,"default")?topToolbarNavigation["default"]:topToolbarNavigation,navigatorNavigation=navigatorNavigation&&Object.prototype.hasOwnProperty.call(navigatorNavigation,"default")?navigatorNavigation["default"]:navigatorNavigation,pageNavigation=pageNavigation&&Object.prototype.hasOwnProperty.call(pageNavigation,"default")?pageNavigation["default"]:pageNavigation,rubricsNavigation=rubricsNavigation&&Object.prototype.hasOwnProperty.call(rubricsNavigation,"default")?rubricsNavigation["default"]:rubricsNavigation,itemNavigation=itemNavigation&&Object.prototype.hasOwnProperty.call(itemNavigation,"default")?itemNavigation["default"]:itemNavigation,linearItemNavigation=linearItemNavigation&&Object.prototype.hasOwnProperty.call(linearItemNavigation,"default")?linearItemNavigation["default"]:linearItemNavigation,stimulusNavigation=stimulusNavigation&&Object.prototype.hasOwnProperty.call(stimulusNavigation,"default")?stimulusNavigation["default"]:stimulusNavigation,jumpLinks=jumpLinks&&Object.prototype.hasOwnProperty.call(jumpLinks,"default")?jumpLinks["default"]:jumpLinks,exports.headerNavigationStrategy=headerNavigation,exports.toolbarNavigationStrategy=toolbarNavigation,exports.topToolbarNavigationStrategy=topToolbarNavigation,exports.navigatorNavigationStrategy=navigatorNavigation,exports.pageNavigationStrategy=pageNavigation,exports.rubricsNavigationStrategy=rubricsNavigation,exports.itemNavigationStrategy=itemNavigation,exports.linearItemNavigationStrategy=linearItemNavigation,exports.stimulusNavigationStrategy=stimulusNavigation,exports.jumpLinksNavigationStrategy=jumpLinks,Object.defineProperty(exports,"__esModule",{value:!0})}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategiesManager",["core/providerRegistry","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategies/index"],function(providerRegistry,strategies){'use strict';function strategyFactory(name,testRunner,config){var strategy=strategyFactory.getProvider(name);return{init:function(){return strategy.init.call(this),this},getName:function(){return name},getConfig:function(){return config},getTestRunner:function(){return testRunner},getNavigators:function(){return"function"==typeof strategy.getNavigators?strategy.getNavigators.call(this):[]},destroy:function(){return"function"==typeof strategy.destroy&&strategy.destroy.call(this),this}}}return providerRegistry=providerRegistry&&Object.prototype.hasOwnProperty.call(providerRegistry,"default")?providerRegistry["default"]:providerRegistry,providerRegistry(strategyFactory),Object.values(strategies).forEach(function(strategy){return strategyFactory.registerProvider(strategy.name,strategy)}),strategyFactory}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/helpers",["exports","jquery","lodash","taoQtiTest/runner/plugins/content/accessibility/keyNavigation/strategiesManager"],function(exports,$,_,strategyFactory){'use strict';function allowedToNavigateFrom(from){var element=from;if(element&&"function"==typeof element.getCursor){var _element$getCursor=element.getCursor(),navigable=_element$getCursor.navigable;element=navigable}element&&"function"==typeof element.getElement&&(element=element.getElement());var $element=$(element);return!($element.hasClass("no-key-navigation")||0<$element.parents(".".concat("no-key-navigation")).length)}function getNavigators(strategies){return _.flatten(strategies.map(function(strategy){return strategy.getNavigators()}))}$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,strategyFactory=strategyFactory&&Object.prototype.hasOwnProperty.call(strategyFactory,"default")?strategyFactory["default"]:strategyFactory;exports.allowedToNavigateFrom=allowedToNavigateFrom,exports.getNavigators=getNavigators,exports.getStrategies=function(navigationMode,testRunner){return navigationMode.strategies.map(function(area){return strategyFactory(area,testRunner,navigationMode.config).init()})},exports.setupClickableNavigator=function(navigator){return navigator.on("activate",function(cursor){var $elt=cursor.navigable.getElement();$elt.is(":checkbox")?$elt.each(function(){this.click()}):$elt.click().mousedown()})},exports.setupItemsNavigator=function(navigator,config){return navigator.on(config.keyNextItem,function(elem){allowedToNavigateFrom(elem)&&this.next()}).on(config.keyPrevItem,function(elem){allowedToNavigateFrom(elem)&&this.previous()})},Object.defineProperty(exports,"__esModule",{value:!0})}),define("taoQtiTest/runner/plugins/content/accessibility/keyNavigation/modes/defaultMode",[],function(){'use strict';return{name:"default",init:function(){var config=0= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"\n\n"}),header=pluginFactory({name:"mainLandmark",init:function(){var _this=this,testRunner=this.getTestRunner(),updateTitle=function(item){_this.$title.text("".concat(item.label)).show()},updateState=function(item){_this.$state.text("".concat(getState(item))).show()};testRunner.after("renderitem",function(){var item=testRunner.getCurrentItem();updateTitle(item),updateState(item)}).on("tool-flagitem",function(){var item=testRunner.getCurrentItem();item=_objectSpread2(_objectSpread2({},item),{},{flagged:!item.flagged}),updateState(item)})},render:function(){var $container=this.getAreaBroker().getArea("mainLandmark");this.$element=$$1(headerTpl()),$container.append(this.$element),this.$title=$container.find("[data-control=\"qti-test-item-title\"]"),this.$state=$container.find("[data-control=\"qti-test-item-state\"]")}});return header}),define("taoQtiTest/runner/plugins/content/dialog/dialog",["jquery","lodash","taoTests/runner/plugin","ui/dialog/alert","ui/dialog/confirm","util/shortcut/registry","util/shortcut","util/namespace"],function($,_,pluginFactory,dialogAlert,dialogConfirm,shortcutRegistry,globalShortcut,namespaceHelper){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,dialogAlert=dialogAlert&&Object.prototype.hasOwnProperty.call(dialogAlert,"default")?dialogAlert["default"]:dialogAlert,dialogConfirm=dialogConfirm&&Object.prototype.hasOwnProperty.call(dialogConfirm,"default")?dialogConfirm["default"]:dialogConfirm,shortcutRegistry=shortcutRegistry&&Object.prototype.hasOwnProperty.call(shortcutRegistry,"default")?shortcutRegistry["default"]:shortcutRegistry,globalShortcut=globalShortcut&&Object.prototype.hasOwnProperty.call(globalShortcut,"default")?globalShortcut["default"]:globalShortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper;var actionPrefix="tool-".concat("dialog","-"),defaultOptions={alert:{focus:"ok"},confirm:{focus:"ok"}},dialog=pluginFactory({name:"dialog",init:function(){function closeAccept(dialog){dialog.trigger("okbtn.modal").hide()}function closeReject(dialog){dialog.hide()}function closeLast(accept,shortcut){var handle=opened.length&&opened[opened.length-1];handle&&(handle.shortcut=shortcut,accept?closeAccept(handle.dialog):closeReject(handle.dialog))}function addHandle(namespace,stack,dialog,message,accept,reject,options){function doAccept(e,reason){_.isFunction(accept)&&accept(handle.shortcut||reason)}function doReject(e,reason){_.isFunction(reject)&&reject(handle.shortcut||reason)}var handle={context:namespace,dialog:dialog(message,doAccept,doReject,options)};globalShortcut.disable(),dialogShortcut.enable(),stack.push(handle),opened.push(handle),handle.dialog.focus(options.focus),handle.dialog.on("closed.modal",function(){removeHandle(stack,handle.dialog),removeHandle(opened,handle.dialog),opened.length||(globalShortcut.enable(),dialogShortcut.disable())})}function removeHandle(stack,dialog){dialog&&_.remove(stack,function(handle){if(handle&&dialog===handle.dialog)return!0})}function closeDialogs(namespace,accept,stack){stack?_.forEach(stack,function(handle){handle&&("@"===namespace||namespace===handle.context)&&(accept?closeAccept(handle.dialog):closeReject(handle.dialog))}):(closeDialogs(namespace,accept,alerts),closeDialogs(namespace,accept,confirms))}var testRunner=this.getTestRunner(),testOptions=testRunner.getOptions(),pluginConfig=Object.assign({},defaultOptions,this.getConfig()),pluginShortcuts=(testOptions.shortcuts||{}).dialog||{},alerts=[],confirms=[],opened=[],dialogShortcut=shortcutRegistry($("body"),{propagate:!1,prevent:!0});dialogShortcut.disable().set("Tab Shift+Tab"),testOptions.allowShortcuts&&_.forEach(pluginShortcuts,function(command,key){dialogShortcut.add(namespaceHelper.namespaceAll(command,"dialog",!0),function(e,shortcut){testRunner.trigger(actionPrefix+key,shortcut)})}),testRunner.before("alert.*",function(e,msg,accept,options){addHandle(e.namespace,alerts,dialogAlert,msg,accept,accept,_.merge({},pluginConfig.alert,options))}).before("confirm.*",function(e,msg,accept,reject,options){addHandle(e.namespace,confirms,dialogConfirm,msg,accept,reject,_.merge({},pluginConfig.confirm,options))}).before("closedialog.*",function(e,accept){closeDialogs(e.namespace,accept)}).on("".concat(actionPrefix,"accept"),function(shortcut){closeLast(!0,shortcut)}).on("".concat(actionPrefix,"reject"),function(shortcut){closeLast(!1,shortcut)}).on("destroy",function(){closeDialogs(".@"),dialogShortcut.clear(),dialogShortcut=null})}});return dialog}),define("taoQtiTest/runner/plugins/content/dialog/exitMessages",["lodash","taoTests/runner/plugin"],function(_,pluginFactory){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var exitMessages=pluginFactory({name:"exitMessages",init:function(){},install:function(){var testRunner=this.getTestRunner();testRunner.before("leave",function(e,data){if(_.isObject(data)&&data.message)return new Promise(function(resolve){var context=testRunner.getTestContext();context&&context.itemIdentifier&&testRunner.disableItem(context.itemIdentifier),testRunner.trigger("disablefeedbackalerts").trigger("alert.leave",data.message,function(){testRunner.trigger("enablefeedbackalerts"),resolve()})})})}});return exitMessages}),define("taoQtiTest/runner/plugins/content/dialog/itemAlertMessage",["jquery","ui/hider","taoTests/runner/plugin"],function($,hider,pluginFactory){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var itemAlertMessage=pluginFactory({name:"itemAlertMessage",init:function(){var self=this;this.$element=$(this.getContent().dom),this.$element.on("closed.modal",function(){$(this).modal("destroy")}).on("destroyed.modal",function(){self.$element=null,self.trigger("resume",self)})},render:function(){var testRunner=this.getTestRunner(),itemRunner=testRunner.itemRunner,$modalsContainer=this.getContent().$container;$modalsContainer||($modalsContainer=$("#modalFeedbacks",itemRunner._item.container)),$modalsContainer.append(this.$element),this.$element.modal({startClosed:!1,top:200})},destroy:function(){this.$element&&this.$element.length&&this.$element.modal("close")}});return itemAlertMessage}),define("taoQtiTest/runner/helpers/navigation",["lodash","taoQtiTest/runner/helpers/map"],function(_,mapHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper;var navigationHelper={isLeavingSection:function(testContext,testMap,direction,scope,position){var section,sectionStats,nbItems,item;if(_.isPlainObject(testContext)&&_.isPlainObject(testMap)&&!_.isEmpty(testContext.sectionId)&&!_.isEmpty(testContext.itemIdentifier))return section=mapHelper.getSection(testMap,testContext.sectionId),sectionStats=mapHelper.getSectionStats(testMap,testContext.sectionId),nbItems=sectionStats&§ionStats.total,item=mapHelper.getItem(testMap,testContext.itemIdentifier),"section"===scope||"testPart"===scope||"next"===direction&&item.positionInSection+1===nbItems||"previous"===direction&&0===item.positionInSection||"jump"===direction&&0=section.position+nbItems);throw new TypeError("Invalid test context and test map")},isLeavingTestPart:function(testContext,testMap,direction,scope,position){var testPart,testPartStats,nbItems,item,section,sectionStats;if(_.isPlainObject(testContext)&&_.isPlainObject(testMap)&&!_.isEmpty(testContext.testPartId)&&!_.isEmpty(testContext.sectionId)&&!_.isEmpty(testContext.itemIdentifier))return testPart=mapHelper.getPart(testMap,testContext.testPartId),testPartStats=mapHelper.getPartStats(testMap,testContext.testPartId),nbItems=testPartStats&&testPartStats.total,item=mapHelper.getItem(testMap,testContext.itemIdentifier),"section"===scope&&(section=mapHelper.getSection(testMap,testContext.sectionId),sectionStats=mapHelper.getSectionStats(testMap,testContext.sectionId)),"testPart"===scope||"next"===direction&&"item"===scope&&item.positionInPart+1===nbItems||"next"===direction&&"section"===scope&§ion.position+sectionStats.total>=nbItems||"previous"===direction&&"item"===scope&&0===item.positionInPart||"previous"===direction&&"section"===scope&§ion.position===testPart.position||"jump"===direction&&0=testPart.position+nbItems);throw new TypeError("Invalid test context and test map")},isLast:function(testMap,itemIdentifier){return this.isLastOf(testMap,itemIdentifier,"test")},isFirst:function(testMap,itemIdentifier){return this.isFirstOf(testMap,itemIdentifier,"test")},isLastOf:function(testMap,itemIdentifier,scope){var item,stats;if(!_.isPlainObject(testMap))throw new TypeError("Invalid test map");if(_.isEmpty(itemIdentifier))throw new TypeError("Invalid item identifier");if(scope=scope||"test",item=mapHelper.getItem(testMap,itemIdentifier),stats=mapHelper.getScopeStats(testMap,item.position,scope),stats&&_.isNumber(stats.total)){if("test"===scope)return item.position+1===stats.total;if("section"===scope||"assessmentSection"===scope||"testSection"===scope)return item.positionInSection+1===stats.total;if("part"===scope||"testPart"===scope)return item.positionInPart+1===stats.total}return!1},isFirstOf:function(testMap,itemIdentifier,scope){var item;if(!_.isPlainObject(testMap))throw new TypeError("Invalid test map");if(_.isEmpty(itemIdentifier))throw new TypeError("Invalid item identifier");return scope=scope||"test",item=mapHelper.getItem(testMap,itemIdentifier),"test"===scope?0===item.position:"section"===scope||"assessmentSection"===scope||"testSection"===scope?0===item.positionInSection:("part"===scope||"testPart"===scope)&&0===item.positionInPart},getSiblingItems:function(testMap,itemPosition,direction,size){var itemId=mapHelper.getItemIdentifier(testMap,itemPosition),previous=null,siblings=[],itemChain=_.reduce(testMap&&testMap.jumps,function(map,jump){var ref=jump.identifier;return previous&&(map[previous].next=ref),map[ref]={identifier:ref,previous:previous,next:null},previous=ref,map},{}),directions;return size=_.isFinite(size)?parseInt(size,10):3,directions=direction&&"both"!==direction?[direction]:["previous","next"],_.forEach(directions,function(link){var id=itemId;_.times(size,function(){return id=itemChain[id]&&itemChain[id][link],!!id&&void siblings.push(mapHelper.getItem(testMap,id))})}),siblings},getNextItem:function(testMap,itemPosition){var siblings=navigationHelper.getSiblingItems(testMap,itemPosition,"next",1);return siblings.length?siblings[0]:null},getPreviousItem:function(testMap,itemPosition){var siblings=navigationHelper.getSiblingItems(testMap,itemPosition,"previous",1);return siblings.length?siblings[0]:null},isMovingToNextItem:function(action,params){return params=params||{},"timeout"===action||"skip"===action||"move"===action&&"next"===params.direction&&"item"===params.scope},isMovingToPreviousItem:function(action,params){return params=params||{},"move"===action&&"previous"===params.direction&&"item"===params.scope},isJumpingToItem:function(action,params){return params=params||{},"move"===action&&"jump"===params.direction&&"item"===params.scope}};return navigationHelper}),define("taoQtiTest/runner/plugins/content/dialog/itemInlineMessage",["jquery","i18n","ui/hider","taoTests/runner/plugin","handlebars","taoQtiTest/runner/helpers/navigation"],function($$1,__,hider,pluginFactory,Handlebars,navigationHelper){'use strict';function buttonTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,navigationHelper=navigationHelper&&Object.prototype.hasOwnProperty.call(navigationHelper,"default")?navigationHelper["default"]:navigationHelper;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" ",(helper=helpers.className)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.className,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),buffer}function program3(depth0,data){var buffer="",stack1;return buffer+="\n aria-"+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof2(depth0)?depth0.apply(depth0):depth0)+"\"\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="",buffer}function program6(){return" no-label"}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.text,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n\n",buffer}),buttonData={next:{control:"move-forward",title:__("Submit and go to the next item"),icon:"forward",text:__("OK")},end:{control:"move-end",title:__("Submit and go to the end of the test"),icon:"fast-forward",text:__("OK & End test")}},itemInlineMessage=pluginFactory({name:"itemInlineMessage",init:function(){var self=this,testRunner=this.getTestRunner(),createOkButton=function(){var testContext=testRunner.getTestContext(),testMap=testRunner.getTestMap(),dataType=navigationHelper.isLast(testMap,testContext.itemIdentifier)?"end":"next",$btn=$$1(buttonTpl(buttonData[dataType]));return $btn.addClass("modalFeedback-button"),$btn.on("click",function(e){e.preventDefault(),self.disable(),"move-end"===$$1(this).data("control")&&self.trigger("end"),$btn.remove(),self.$element.remove(),self.trigger("resume",self)}),$btn};this.$button=createOkButton(),this.$element=$$1(this.getContent().dom)},render:function(){var $navigationContainer=this.getAreaBroker().getNavigationArea(),testRunner=this.getTestRunner(),itemRunner=testRunner.itemRunner,$inlineContainer=this.getContent().$container;!$inlineContainer&&itemRunner._item.container&&($inlineContainer=$$1(".qti-itemBody",itemRunner._item.container)),$inlineContainer.append(this.$element),$$1(".modalFeedback-button",$navigationContainer).length||$navigationContainer.append(this.$button)},enable:function(){this.$button.removeProp("disabled").removeClass("disabled")},disable:function(){this.$button.prop("disabled",!0).addClass("disabled")},destroy:function(){this.$button.click()}});return itemInlineMessage}),define("taoQtiTest/runner/plugins/content/feedback/feedback",["i18n","taoTests/runner/plugin","ui/feedback"],function(__,pluginFactory,feedback$1){'use strict';function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,feedback$1=feedback$1&&Object.prototype.hasOwnProperty.call(feedback$1,"default")?feedback$1["default"]:feedback$1;var feedback=pluginFactory({name:"feedback",init:function(){var self=this,testRunner=this.getTestRunner(),closeCurrent=function(){currentFeedback&¤tFeedback.close()},currentFeedback;this.setState("enabled",!0),testRunner.on("error",function(err){var message=err,type="error";self.getState("enabled")&&("object"===_typeof(err)&&(message=err.message,type=err.type),message||(message="TestState"===type?__("The test has been closed/suspended!"):"FileNotFound"===type?__("File not found!"):__("An error occurred!")),currentFeedback=feedback$1().error(message))}).on("danger",function(message){self.getState("enabled")&&(currentFeedback=feedback$1().danger(message))}).on("warning",function(message){self.getState("enabled")&&(currentFeedback=feedback$1().warning(message))}).on("info",function(message){self.getState("enabled")&&(currentFeedback=feedback$1().info(message))}).on("alert.* confirm.* unloaditem",closeCurrent).on("disablefeedbackalerts",function(){closeCurrent(),self.setState("enabled",!1)}).on("enablefeedbackalerts",function(){self.setState("enabled",!0)})}});return feedback}),define("taoQtiTest/runner/plugins/content/itemScrolling/itemScrolling",["jquery","util/typeCaster","taoTests/runner/plugin"],function($,typeCaster,pluginFactory){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,typeCaster=typeCaster&&Object.prototype.hasOwnProperty.call(typeCaster,"default")?typeCaster["default"]:typeCaster,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var itemScrolling=pluginFactory({name:"itemScrolling",init:function(){function adaptItemHeight(){var $itemContainer=$contentArea.find("[data-scrolling=\"true\"]"),contentHeight=getItemRunnerHeight()-getExtraGridRowHeight()-getSpaceAboveQtiContent()-12-60;$itemContainer.each(function(){var $item=$(this),isScrollable=typeCaster.strToBool($item.attr("data-scrolling")||"false"),selectedHeight=parseFloat($item.attr("data-scrolling-height"))||100,containerParent=$item.parent().closest("[data-scrolling=\"true\"]");$item.length&&isScrollable&&($item.data("scrollable",!0),$item.css({"overflow-y":"scroll"}),0 .grid-row"),extraHeight=0;return $gridRows.each(function(){var $gridRow=$(this),$itemContainer=$gridRow.find("[data-scrolling=\"true\"]");$itemContainer.length||(extraHeight+=$gridRow.outerHeight(!0))}),extraHeight}function getSpaceAboveQtiContent(){var $testRunnerSections=$(".test-runner-sections"),$qtiContent=$("#qti-content");return $testRunnerSections.length&&$qtiContent.length?$qtiContent.get(0).getBoundingClientRect().top-$testRunnerSections.get(0).getBoundingClientRect().top:0}var testRunner=this.getTestRunner(),$contentArea=testRunner.getAreaBroker().getContentArea();testRunner.on("renderitem",function(){adaptItemHeight(),$(window).off("resize.adaptItemHeight"),$(window).on("resize.adaptItemHeight",adaptItemHeight)})}});return itemScrolling}),define("taoQtiTest/runner/plugins/content/loading/loading",["layout/loading-bar","taoTests/runner/plugin"],function(loadingBar,pluginFactory){'use strict';loadingBar=loadingBar&&Object.prototype.hasOwnProperty.call(loadingBar,"default")?loadingBar["default"]:loadingBar,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var loading=pluginFactory({name:"loading",init:function(){var testRunner=this.getTestRunner();testRunner.on("unloaditem",function(){loadingBar.start()}).on("renderitem",function(){loadingBar.stop()})}});return loading}),define("taoQtiTest/runner/plugins/content/modalFeedback/modalFeedback",["jquery","lodash","module","taoTests/runner/plugin","taoQtiTest/runner/plugins/content/dialog/itemInlineMessage","taoQtiTest/runner/plugins/content/dialog/itemAlertMessage","ui/autoscroll"],function($,_,module,pluginFactory,inlineMessage,alertMessage,autoscroll){'use strict';function destroyFeedback(feedback){var removed=!1;_.remove(renderedFeedbacks,function(storedFeedback){var found=storedFeedback===feedback;return found&&(removed=!0),found}),removed&&(feedback.destroy(),!renderedFeedbacks.length&&nextStep())}function defineMode(inline){inlineMode=inline,messagePlugin=inlineMode?inlineMessage:alertMessage}$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,module=module&&Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,inlineMessage=inlineMessage&&Object.prototype.hasOwnProperty.call(inlineMessage,"default")?inlineMessage["default"]:inlineMessage,alertMessage=alertMessage&&Object.prototype.hasOwnProperty.call(alertMessage,"default")?alertMessage["default"]:alertMessage,autoscroll=autoscroll&&Object.prototype.hasOwnProperty.call(autoscroll,"default")?autoscroll["default"]:autoscroll;var modalFeedback=pluginFactory({name:"QtiModalFeedback",init:function(){nextStep=function(){},defineMode(!!module.config().inlineModalFeedback)},render:function(){var self=this,testRunner=this.getTestRunner(),createMessages=function(renderingQueue,inline){var bInlineMode=inlineMode;isDestroyed=!1,renderedFeedbacks=[],_.isBoolean(inline)&&defineMode(inline),renderingQueue.length?(_.forEach(renderingQueue,function(renderingToken){var feedback=messagePlugin(testRunner,testRunner.getAreaBroker());feedback.init({dom:renderingToken.feedback.render({inline:inlineMode}),$container:inlineMode?renderingToken.$container:null}),feedback.render(),renderedFeedbacks.push(feedback)}),inlineMode&&renderedFeedbacks&&autoscroll($(".qti-modalFeedback",testRunner.getAreaBroker().getContentArea()).first(),testRunner.getAreaBroker().getContentArea().parents(".content-wrapper"))):nextStep(),defineMode(bInlineMode)};inlineMode?testRunner.off("plugin-resume.itemInlineMessage").on("plugin-resume.itemInlineMessage",function(){self.destroy()}):testRunner.off("plugin-resume.itemAlertMessage").on("plugin-resume.itemAlertMessage",function(feedback){destroyFeedback(feedback)}),testRunner.on("modalFeedbacks",function(renderingQueue,done,inline){nextStep=done,createMessages(renderingQueue,inline)})},destroy:function(){var tFeedbacks,i;if(!isDestroyed)if(isDestroyed=!0,!renderedFeedbacks)nextStep();else for(i in tFeedbacks=renderedFeedbacks.slice(0),tFeedbacks)destroyFeedback(tFeedbacks[i])}}),inlineMode,messagePlugin,renderedFeedbacks,isDestroyed,nextStep;return modalFeedback}),define("taoQtiTest/runner/plugins/content/overlay/overlay",["jquery","taoTests/runner/plugin"],function($,pluginFactory){'use strict';$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var overlay=pluginFactory({name:"overlay",init:function(){var self=this,testRunner=this.getTestRunner();this.$element=$("
    "),this.$element.on("click mousedown mouseup touchstart touchend keyup keydow keypress scroll drop",function(e){e.stopImmediatePropagation(),e.stopPropagation()});testRunner.on("disableitem",function(){self.enable()}).on("enableitem unloaditem modalFeedbacks",function(){self.disable()})},render:function(){var $contentArea=this.getTestRunner().getAreaBroker().getContentArea();$contentArea.after(this.$element)},destroy:function(){this.$element.remove()},enable:function(){var overlayConfig=this.getConfig();this.$element.addClass("overlay"),overlayConfig.full&&this.$element.addClass("overlay-full")},disable:function(){this.$element.removeClass("overlay overlay-full")},show:function(){this.enable()},hide:function(){this.disable()}});return overlay}),define("taoQtiTest/runner/plugins/content/responsiveness/collapser",["lodash","jquery","taoTests/runner/plugin"],function(_,$,pluginFactory){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var labelHiddenCls="no-tool-label",separatorCls="separator",defaults={collapseTools:!0,collapseNavigation:!1,collapseInOrder:!1,hover:!1,collapseOrder:[]},$window=$(window),collapser=pluginFactory({name:"collapser",init:function(){function buildCollapsiblesList(){allCollapsibles=config.collapseInOrder&&config.collapseOrder.length?getCollapsiblesFromConfig():config.collapseInOrder?getSortedCollapsiblesFromDom():getUnsortedCollapsiblesFromDom()}function getExtraWidth($element){var expandedWidth,collapsedWidth;return $element.removeClass(collapseCls),expandedWidth=$element.outerWidth(!0),$element.addClass(collapseCls),collapsedWidth=$element.outerWidth(!0),$element.removeClass(collapseCls),expandedWidth-collapsedWidth}function toggleCollapsibles(){availableWidth=getAvailableWidth(),availableWidthgetAvailableWidth()}function expandInOrder(){_.forEachRight(allCollapsibles,function(toExpand){if(toExpand.$elements.hasClass(collapseCls))if(expandPossible(toExpand.extraWidth))toExpand.$elements.removeClass(collapseCls);else return!1})}function expandPossible(extraWidth){return getToolbarWidth()+extraWidthul>[data-control]").not(".".concat(labelHiddenCls)).not(".".concat(separatorCls)))),config.collapseNavigation&&($controls=$controls.add($navigation.find(">ul>[data-control]").not(".".concat(labelHiddenCls)).not(".".concat(separatorCls)))),$controls}function getCollapsiblesFromConfig(){return _.compact(config.collapseOrder.map(function(selector){var $elements=$(selector).not(".".concat(labelHiddenCls)).not(".".concat(separatorCls)),extraWidth=0;return!!$elements.length&&($elements.each(function(){extraWidth+=getExtraWidth($(this))}),{$elements:$elements,extraWidth:extraWidth})}))}function getSortedCollapsiblesFromDom(){var $elements=getControlsFromDom(),_allCollapsibles=[],order={};return $elements.each(function(){var ctrl=this.dataset.control,key=ctrl.substring(0,ctrl.search(/[A-Z-_]/))||ctrl;order[key]=order[key]||$(),order[key]=order[key].add($(this))}),_.forOwn(order,function($elements){var extraWidth=0;$elements.each(function(){extraWidth+=getExtraWidth($(this))}),_allCollapsibles.push({$elements:$elements,extraWidth:extraWidth})}),_.compact(_allCollapsibles)}function getUnsortedCollapsiblesFromDom(){var $elements=getControlsFromDom(),_allCollapsibles=[],extraWidth=0;return $elements.each(function(){extraWidth+=getExtraWidth($(this))}),_allCollapsibles.push({$elements:$elements,extraWidth:extraWidth}),_.compact(_allCollapsibles)}var testRunner=this.getTestRunner(),config=Object.assign({},defaults,this.getConfig()),collapseCls=config.hover?"tool-label-collapsed-hover":"tool-label-collapsed",areaBroker=testRunner.getAreaBroker(),$actionsBar=areaBroker.getArea("actionsBar"),$toolbox=areaBroker.getToolboxArea(),$navigation=areaBroker.getNavigationArea(),allCollapsibles,availableWidth,previousAvailableWidth;$window.on("resize".concat(".collapser"),_.throttle(function(){testRunner.trigger("collapseTools")},40)),testRunner.after("renderitem loaditem",function(){previousAvailableWidth=1/0,buildCollapsiblesList(),testRunner.trigger("collapseTools")}).on("collapseTools".concat(".collapser"),function(){toggleCollapsibles()})},destroy:function(){$window.off(".collapser")}});return collapser}),define("taoQtiTest/runner/plugins/content/rubricBlock/rubricBlock",["jquery","ui/hider","taoTests/runner/plugin","handlebars"],function($$1,hider,pluginFactory,Handlebars){'use strict';function containerTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"
    \n"}),blankifyLinks=function($container){$$1("a",$container).attr("target","_blank")},mathify=function($container){return new Promise(function(resolve){0<$$1("math",$container).length?require(["mathJax"],function(MathJax){MathJax?(MathJax.Hub.Queue(["Typeset",MathJax.Hub],$container[0]),MathJax.Hub.Queue(resolve)):resolve()},resolve):resolve()})},rubricBlock=pluginFactory({name:"rubricBlock",init:function(){var self=this,testRunner=this.getTestRunner();this.$element=$$1(containerTpl()),this.hide(),testRunner.on("ready",function(){self.hide()}).on("loaditem",function(){var context=testRunner.getTestContext();context.rubrics&&(self.$element.html(context.rubrics),blankifyLinks(self.$element),mathify(self.$element).then(function(){testRunner.trigger("rubricblock")}))}).on("renderitem",function(){self.show()}).on("unloaditem",function(){self.hide(),self.$element.empty()})},render:function(){var $container=this.getAreaBroker().getContentArea();$container.before(this.$element)},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}});return rubricBlock}),define("taoQtiTest/runner/plugins/controls/connectivity/connectivity",["jquery","lodash","i18n","core/polling","ui/waitingDialog/waitingDialog","taoTests/runner/plugin","handlebars","util/namespace"],function($$1,_,__,pollingFactory,waitingDialog,pluginFactory,Handlebars,namespaceHelper){'use strict';function connectivityTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pollingFactory=pollingFactory&&Object.prototype.hasOwnProperty.call(pollingFactory,"default")?pollingFactory["default"]:pollingFactory,waitingDialog=waitingDialog&&Object.prototype.hasOwnProperty.call(waitingDialog,"default")?waitingDialog["default"]:waitingDialog,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",helper,options;return buffer+=""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Online",options):helperMissing.call(depth0,"__","Online",options)))+"",buffer}function program5(depth0,data){var buffer="",helper,options;return buffer+=""+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Offline",options):helperMissing.call(depth0,"__","Offline",options)))+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="
    \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.message,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.message,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n",buffer}),defaultConfig={checkInterval:30000,indicator:!0,message:!1},connectivity=pluginFactory({name:"connectivity",init:function(){var self=this,testRunner=this.getTestRunner(),proxy=testRunner.getProxy(),config=Object.assign({},defaultConfig,this.getConfig());config&&config.indicator&&(this.$element=$$1(connectivityTpl({state:proxy.isOnline()?"connected":"disconnected",message:config.message})),testRunner.on("disconnect",function(){self.$element.removeClass("connected").addClass("disconnected")}).on("reconnect",function(){self.$element.removeClass("disconnected").addClass("connected")})),this.polling&&_.isNumber(config.checkInterval)&&this.polling.setInterval(config.checkInterval)},install:function(){var self=this,waiting=!1,testRunner=this.getTestRunner(),proxy=testRunner.getProxy();this.displayWaitingDialog=function(){var message=0= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"

    \n",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),buffer}),name="pauseOnError",dialogMessage={title:__("Something unexpected happened."),message:__("Please try reloading the page or pause the test. If you pause, you will be able to resume the test from this page.")},dialogConfig={focus:"cancel",buttons:{labels:{ok:__("Pause the test"),cancel:__("Reload the page")}}},pauseContext={reasons:{category:"technical",subCategory:"error"},originalMessage:"Due to an unexpected issue the test has been suspended."},pauseOnError=pluginFactory({name:name,init:function(){var testRunner=this.getTestRunner(),returnToHome=function(){return testRunner.trigger("pause",pauseContext)},reloadPage=function(){return testRunner.trigger("reloadpage")},processError=function(error){testRunner.on("reloadpage",function(){return window.location.reload()}).trigger("disablenav disabletools hidenav").trigger("confirm.".concat(name),dialogTpl(dialogMessage),returnToHome,reloadPage,dialogConfig),500===error.code&&(error.originalCode=error.code,delete error.code,testRunner.trigger("disablefeedbackalerts"),testRunner.after("error.pauseOnError",function(){testRunner.off("error.pauseOnError"),testRunner.trigger("enablefeedbackalerts")}))};testRunner.before("error",function(e,error){return processError(error)})}});return pauseOnError}),define("taoQtiTest/runner/plugins/controls/duration/duration",["lodash","taoTests/runner/plugin","core/logger"],function(_,pluginFactory,loggerFactory){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,loggerFactory=loggerFactory&&Object.prototype.hasOwnProperty.call(loggerFactory,"default")?loggerFactory["default"]:loggerFactory;var logger=loggerFactory("taoQtiTest/runner/plugins/controls/duration/duration"),duration=pluginFactory({name:"duration",install:function(){this.getTestRunner().getTestStore().setVolatile(this.getName())},init:function(){var testRunner=this.getTestRunner(),currentUpdatePromise=Promise.resolve(),getItemAttempt=function(){var context=testRunner.getTestContext();return"".concat(context.itemIdentifier,"#").concat(context.attempt)},getPositiveNumber=function(value){return!_.isNumber(value)||0>value?0:value};return testRunner.getPluginStore(this.getName()).then(function(durationStore){var getItemDuration=function(attemptId){return /^(.*)+#+\d+$/.test(attemptId)?durationStore.getItem(attemptId):Promise.reject(new Error("Is it really an attempt id, like \"itemid#attempt\""))},updateDuration=function(elapsed){var itemAttemptId=getItemAttempt();return currentUpdatePromise=currentUpdatePromise.then(function(){return getItemDuration(itemAttemptId)}).then(function(duration){return durationStore.setItem(itemAttemptId,getPositiveNumber(duration)+getPositiveNumber(elapsed)/1e3)}).catch(function(err){logger.warn("Error updating item duration! ".concat(err&&err.message))}),currentUpdatePromise},addDurationToCallActionParams=function(){var itemAttemptId=getItemAttempt();return currentUpdatePromise.then(function(){return getItemDuration(itemAttemptId)}).then(function(duration){return testRunner.getProxy().addCallActionParams({itemDuration:getPositiveNumber(duration)})}).catch(function(err){logger.warn("Error retrieving item duration! ".concat(err&&err.message))})};testRunner.on("tick",updateDuration).before("move skip exit timeout pause",addDurationToCallActionParams).on("plugin-get.duration",function(attemptId,getDuration){_.isFunction(getDuration)&&getDuration(getItemDuration(attemptId))})})}});return duration}),define("taoQtiTest/runner/plugins/controls/progressbar/progress",["lodash","i18n","core/format","taoQtiTest/runner/helpers/map"],function(_,__,format,mapHelper){'use strict';function getFixedMap(testMap,testContext){var currentTestPart=mapHelper.getPart(testMap,testContext.testPartId),currentItem=mapHelper.getItemAt(testMap,testContext.itemPosition);if(currentItem.answered&¤tTestPart.isLinear){var fixedTestMap=_.cloneDeep(testMap),fixedCurrentItem=mapHelper.getItemAt(fixedTestMap,testContext.itemPosition);return fixedCurrentItem.answered=!1,fixedTestMap}return testMap}function getEmptyStats(){return{position:0,reached:0,viewed:0,completed:0,total:0}}function updateStats(stats,element,position){element.position<=position&&stats.position++,element.stats.viewed&&(stats.reached++,element.stats.viewed===element.stats.total&&stats.viewed++),element.stats.answered&&element.stats.answered===element.stats.questions&&stats.completed++,stats.total++}function updateItemStats(stats,element,position){element.position<=position&&stats.position++,element.viewed&&(stats.reached++,stats.viewed++),element.answered&&stats.completed++,stats.total++}function getCategoriesToMatch(categories){var matchSize=categories&&categories.length;return matchSize&&_.reduce(categories,function(map,category){return map[category]=!0,map},{})}function getProgressStats(testMap,testContext,config,scope){var fixedMap=getFixedMap(testMap,testContext),scopedMap=mapHelper.getScopeMap(fixedMap,testContext.itemPosition,scope),stats=_.clone(scopedMap.stats),categoriesToMatch,matchSize;return"categories"===config.indicator&&(categoriesToMatch=getCategoriesToMatch(config.categories),matchSize=config.categories&&config.categories.length,stats.matchedCategories=getEmptyStats()),stats.parts=getEmptyStats(),stats.sections=getEmptyStats(),stats.answerableParts=getEmptyStats(),stats.answerableSections=getEmptyStats(),_.forEach(scopedMap.parts,function(part){updateStats(stats.parts,part,testContext.itemPosition),0=minWanted))return!1}),matched===minWanted}function getRatio(position,total){var _Mathfloor=Math.floor;return position&&0= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"
    \n
    \n
    \n
    \n"}),defaults={showLabel:!0};return percentageIndicatorRenderer}),define("taoQtiTest/runner/plugins/controls/progressbar/renderer/position",["lodash","ui/component","handlebars"],function(_,component,Handlebars){'use strict';function positionTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function pointTpl(data,options,asString){var html=Template$1(data,options);return asString||!0?html:$(html)}function positionIndicatorRenderer(config,progressData){var count=0;return component({update:function(data){progressData=data,this.is("rendered")&&this.controls&&(count!==progressData.total&&(count=progressData.total,this.controls.$bar.empty().append(pointTpl(_.range(count)))),this.controls.$label.text(progressData.label),this.controls.$bar.children().removeClass("reached current").slice(0,progressData.position).addClass("reached").slice(-1).addClass("current")),this.trigger("update",data)}},defaults).setTemplate(positionTpl).on("render",function(){this.controls={$label:this.getElement().find("[data-control=\"progress-label\"]"),$bar:this.getElement().find("[data-control=\"progress-bar\"] .progressbar-points")},this.config.showLabel||this.controls.$label.hide(),progressData&&this.update(progressData),this.is("hidden")&&this.hide()}).on("destroy",function(){this.controls=null}).init(config)}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"
    \n
    \n
    \n
    \n
    \n
    \n"}),Template$1=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0){var buffer="";return buffer+="\n\n",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers.each.call(depth0,depth0,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""}),defaults={showLabel:!0};return positionIndicatorRenderer}),define("taoQtiTest/runner/plugins/controls/progressbar/progressbar",["taoTests/runner/plugin","taoQtiTest/runner/helpers/map","taoQtiTest/runner/plugins/controls/progressbar/progress","taoQtiTest/runner/plugins/controls/progressbar/renderer/percentage","taoQtiTest/runner/plugins/controls/progressbar/renderer/position"],function(pluginFactory,mapHelper,progressHelper,percentageRendererFactory,positionRendererFactory){'use strict';pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,progressHelper=progressHelper&&Object.prototype.hasOwnProperty.call(progressHelper,"default")?progressHelper["default"]:progressHelper,percentageRendererFactory=percentageRendererFactory&&Object.prototype.hasOwnProperty.call(percentageRendererFactory,"default")?percentageRendererFactory["default"]:percentageRendererFactory,positionRendererFactory=positionRendererFactory&&Object.prototype.hasOwnProperty.call(positionRendererFactory,"default")?positionRendererFactory["default"]:positionRendererFactory;var renderers={percentage:percentageRendererFactory,position:positionRendererFactory},progressbar=pluginFactory({name:"progressBar",init:function(){var testRunner=this.getTestRunner(),testRunnerConfig=testRunner.getOptions(),config=Object.assign({},testRunnerConfig.progressIndicator||{},this.getConfig()),self=this,rendererFactory=renderers[config.renderer]||renderers.percentage,progressConfig={indicator:config.type||"percentage",scope:config.scope||"test",showLabel:config.showLabel,showTotal:config.showTotal,categories:config.categories},hiddenByQuestions=function(item){return item&&item.informational&&"questions"===progressConfig.indicator},hiddenByCategories=function(item){return item&&"categories"===progressConfig.indicator&&!progressHelper.isMatchedCategories(item.categories,progressConfig.categories)},isProgressbarHidden=function(item){return hiddenByQuestions(item)||hiddenByCategories(item)},update=function(){var testContext=testRunner.getTestContext(),testMap=testRunner.getTestMap(),item=mapHelper.getItemAt(testMap,testContext.itemPosition);isProgressbarHidden(item)?self.renderer.hide():(self.renderer.show(),self.renderer.update(progressHelper.computeProgress(testMap,testContext,progressConfig)))};this.renderer=rendererFactory(progressConfig),update(),testRunner.on("ready loaditem",update)},render:function(){var $container=this.getAreaBroker().getControlArea();this.renderer.render($container)},destroy:function(){this.renderer&&this.renderer.destroy(),this.renderer=null},show:function(){this.renderer&&this.renderer.show()},hide:function(){this.renderer&&this.renderer.hide()}});return progressbar}),define("taoQtiTest/runner/plugins/controls/testState/testState",["lodash","taoTests/runner/plugin"],function(_,pluginFactory){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var testState=pluginFactory({name:"testState",install:function(){var testRunner=this.getTestRunner();testRunner.getProxy().use(function(req,res,next){var data=res&&res.data;return data&&data.type&&"TestState"===data.type&&!testRunner.getState("closedOrSuspended")?(testRunner.setState("closedOrSuspended",!0),void(testRunner.getState("ready")?(_.isEmpty(data.messages)||!_.find(data.messages,{channel:"teststate"}))&&testRunner.trigger("leave",data):testRunner.trigger("destroy"))):void next()})},init:function(){var testRunner=this.getTestRunner(),isLeaving=!1;testRunner.getProxy().channel("teststate",function(data){isLeaving||!data||"close"!==data.type&&"pause"!==data.type||testRunner.getState("closedOrSuspended")||(isLeaving=!0,"pause"===data.type?testRunner.trigger("pause",data):(testRunner.setState("closedOrSuspended",!0),testRunner.trigger("leave",data)))})}});return testState}),define("taoQtiTest/runner/helpers/getTimerMessage",["i18n"],function(__){'use strict';function getTimerMessage(hours,minutes,seconds,unansweredQuestions,scope){var timeArr=[hours,minutes,seconds],timeArgArr=[],timerMessage;[__("hours"),__("minutes"),__("seconds")].forEach(function(unit,idx){0=remainingTime?0:parseInt(remainingTime,10),this.is("rendered")&&this.is("running")){if(encodedTime=timeEncoder.encode(this.remainingTime/1000),encodedTime!==this.encodedTime){this.encodedTime=encodedTime;var time=moment.duration(this.remainingTime/1000,"seconds"),hours=time.get("hours"),minutes=time.get("minutes"),seconds=time.get("seconds");$time.text(this.encodedTime),$timeScreenreader.text(getTimerMessage(hours,minutes,seconds,unansweredQuestions,this.config.scope))}if(this.warnings&&(warningId=_.findLastKey(this.warnings,function(warning){return warning&&!warning.shown&&0=self.remainingTime}),warningId&&(this.warnings[warningId].shown=!0,warningMessage=_.isFunction(this.warnings[warningId].message)?this.warnings[warningId].message(this.remainingTime):this.warnings[warningId].message,this.trigger("warn",warningMessage,this.warnings[warningId].level))),this.warningsForScreenreader){var screenreaderWarningId=_.findLastKey(this.warningsForScreenreader,function(warning){return warning&&!warning.shown&&0=self.remainingTime});screenreaderWarningId&&(this.warningsForScreenreader[screenreaderWarningId].shown=!0,this.trigger("warnscreenreader",this.warningsForScreenreader[screenreaderWarningId].message,self.remainingTime,this.warningsForScreenreader[screenreaderWarningId].scope))}this.trigger("change",this.remainingTime,encodedTime)}0===this.remainingTime&&this.complete()}return this},start:function(){return!this.is("rendered")||this.is("running")||this.is("completed")||(this.enable(),this.setState("running",!0),this.trigger("start")),this},stop:function(){return this.is("rendered")&&this.is("running")&&(this.setState("running",!1),this.trigger("stop")),this},complete:function(){return this.is("rendered")&&this.is("running")&&!this.is("completed")&&(this.stop(),this.setState("completed",!0),this.trigger("complete end")),this}},defaults).on("init",function(){this.remainingTime=this.config.remainingTime,this.unansweredQuestions=this.config.unansweredQuestions,this.config.warnings&&(this.warnings=_.sortBy(this.config.warnings,"threshold")),this.config.warningsForScreenreader&&(this.warningsForScreenreader=_.sortBy(this.config.warningsForScreenreader,"threshold")),this.render($container)}).on("render",function(){$time=$$1(".time",this.getElement()),$timeScreenreader=$$1(".time--screenreader",this.getElement()),!0===this.config.showBeforeStart&&$time.text(timeEncoder.encode(this.remainingTime/1000))}).on("warn",function(message,level){var countdownTooltip;level=level||"warning",this.is("rendered")&&this.is("running")&&_.isString(message)&&!_.isEmpty(message)&&($time.removeClass("txt-success txt-info txt-warning txt-danger txt-error").addClass("txt-".concat(level)),!0===this.config.displayWarning&&(countdownTooltip=tooltip.create(this.getElement(),message,{trigger:"manual",theme:level,placement:"bottom"}),countdownTooltip.show(),setTimeout(function(){countdownTooltip.hide(),countdownTooltip.dispose()},warningTimeout[level]||2e3)))}),$time,$timeScreenreader;return countdown.setTemplate(countdownTpl),_.defer(function(){countdown.init(config)}),countdown}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,timeEncoder=timeEncoder&&Object.prototype.hasOwnProperty.call(timeEncoder,"default")?timeEncoder["default"]:timeEncoder,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,getTimerMessage=getTimerMessage&&Object.prototype.hasOwnProperty.call(getTimerMessage,"default")?getTimerMessage["default"]:getTimerMessage,tooltip=tooltip&&Object.prototype.hasOwnProperty.call(tooltip,"default")?tooltip["default"]:tooltip,moment=moment&&Object.prototype.hasOwnProperty.call(moment,"default")?moment["default"]:moment;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="
    \n ",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n
    \n
    \n",buffer}),defaults={showBeforeStart:!0,displayWarning:!0},warningTimeout={info:2e3,success:2e3,warning:4e3,danger:4e3,error:8e3};return countdownFactory}),define("css!taoQtiTest/runner/plugins/controls/timer/component/css/timerbox",[],function(){}),define("taoQtiTest/runner/plugins/controls/timer/component/timerbox",["jquery","lodash","i18n","ui/component","ui/hider","taoQtiTest/runner/plugins/controls/timer/component/countdown","handlebars","css!taoQtiTest/runner/plugins/controls/timer/component/css/timerbox.css"],function($$1,_,__,component,hider,countdownFactory,Handlebars){'use strict';function timerboxTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function timerboxFactory(config){var timerbox=component({update:function(timers){var self=this,updating=[],timerIdsToRemove=_.difference(_.keys(this.timers),_.keys(timers));return timerIdsToRemove.length&&_.forEach(timerIdsToRemove,function(timerId){updating.push(self.removeTimer(timerId))}),_.forEach(timers,function(timer,id){"undefined"==typeof self.timers[id]?updating.push(self.addTimer(id,timer)):updating.push(self.updateTimer(id,timer))}),Promise.all(updating).then(function(results){return 0<_.size(self.timers)?hider.show($zenModeToggler):hider.hide($zenModeToggler),self.trigger("update",results),results})},getTimers:function(){return this.timers},addTimer:function(id,timer){var self=this;return this.is("rendered")&&"undefined"==typeof this.timers[id]?new Promise(function(resolve){var countdown=countdownFactory($countdownContainer,_.defaults(timer,{displayWarning:self.config.displayWarning})).on("render",function(){self.timers[id]=_.clone(timer),self.timers[id].countdown=this,self.trigger("timerchange","add",self.timers[id]),self.trigger("timeradd",self.timers[id]),resolve(self.timers[id])}).on("start",function(){self.trigger("timerstart",self.timers[id])}).on("stop",function(){self.trigger("timerstop",self.timers[id])}).on("end",function(){self.trigger("timerend",self.timers[id])}).on("change",function(value){self.timers[id]&&(self.trigger("timertick",this.remainingTime,self.timers[id].scope,self.timers[id].unansweredQuestions),self.timers[id].remainingTime=value)});countdown.spread(self,["error","change","warn","warnscreenreader"])}):Promise.resolve(!1)},updateTimer:function(id,timer){return this.is("rendered")&&"undefined"!=typeof this.timers[id]?(this.timers[id].remainingTime=timer.remainingTime,this.timers[id].unansweredQuestions=timer.unansweredQuestions,this.timers[id].extraTime=timer.extraTime,_.isNumber(timer.remainingWithoutExtraTime)&&(this.timers[id].remainingWithoutExtraTime=timer.remainingWithoutExtraTime),this.timers[id].countdown&&this.timers[id].countdown.update(timer.remainingTime,timer.unansweredQuestions),this.trigger("timerchange","update",this.timers[id]),this.trigger("timerupdate",this.timers[id]),Promise.resolve(this.timers[id])):Promise.resolve(!1)},removeTimer:function(id){var self=this;return this.is("rendered")&&"undefined"!=typeof this.timers[id]?new Promise(function(resolve){var deindex=function(){var removed=_.omit(self.timers[id],"countdown");self.timers=_.omit(self.timers,id),self.trigger("timerchange","remove",removed),self.trigger("timerremove",removed),resolve(removed)};self.timers[id].countdown?self.timers[id].countdown.on("destroy",deindex).destroy():deindex()}):Promise.resolve()},start:function(){return _.forEach(this.timers,function(timer){timer.countdown&&timer.countdown.start()}),this},stop:function(){return _.forEach(this.timers,function(timer){timer.countdown&&timer.countdown.stop()}),this},toggleZenMode:function(){return this.is("rendered")&&this.config.zenMode.enabled&&(this.is("zen")?(this.setState("zen",!1),$zenModeToggler.attr("title",__("Hide timers"))):(this.setState("zen",!0),$zenModeToggler.attr("title",__("Show timers"))),this.trigger("zenchange",this.is("zen"))),this}},defaults).on("init",function(){this.timers={}}).on("render",function(){var self=this,$element=this.getElement();$countdownContainer=$$1(".timer-wrapper",$element),this.config.zenMode.enabled&&($zenModeToggler=$$1(".timer-toggler",$element),self.setState("zen",!!self.config.zenMode.startHidden),$zenModeToggler.on("click",function(e){e.preventDefault(),self.toggleZenMode()})),this.config.timers&&this.update(this.config.timers)}),$zenModeToggler,$countdownContainer;return timerbox.setTemplate(timerboxTpl),_.defer(function(){timerbox.init(config)}),timerbox}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,countdownFactory=countdownFactory&&Object.prototype.hasOwnProperty.call(countdownFactory,"default")?countdownFactory["default"]:countdownFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",helper,options;return buffer+="\n \n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="
    \n ",stack1=helpers["if"].call(depth0,(stack1=depth0&&depth0.zenMode,null==stack1||!1===stack1?stack1:stack1.enabled),{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n\n
    \n
    \n",buffer}),defaults={zenMode:{enabled:!0,startHidden:!1}};return timerboxFactory}),define("taoQtiTest/runner/plugins/controls/timer/strategy/enforcedStay",[],function(){'use strict';return function(testRunner,timer){var testPart=testRunner.getCurrentPart();return!!(timer&&"min"===timer.type&&"item"===timer.scope&&testPart&&testPart.isLinear)&&{name:"enforcedStay",setUp:function(){testRunner.on("enablenav.enforcestay",function(){testRunner.trigger("disablenav")}),testRunner.trigger("disablenav")},complete:function(){this.tearDown(),testRunner.trigger("enablenav")},tearDown:function(){testRunner.off("enablenav.enforcestay")}}}}),define("taoQtiTest/runner/plugins/controls/timer/strategy/extraTime",["lodash"],function(_){'use strict';var _Mathmax=Math.max;_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_;var lastConsumedExtraTime=0;return function(testRunner,timer){var applyExtraTime=function(){_.isNumber(timer.extraTime)&&0=constraintValue),answered=answered&&fullyAnswered),answered},guessInteractionConstraintValues:function(runner){var itemRunner=runner.itemRunner,itemBody=itemRunner._item&&itemRunner._item.bdy||{},interactions=itemBody.elements||{},constraintValues={};return _.forEach(interactions,function(interaction){var attributes=interaction.attributes||{},qtiClass=interaction.__proto__.qtiClass,constraintProperty;Object.prototype.hasOwnProperty.call(interactionMinConstraintProperties,qtiClass)&&(constraintProperty=interactionMinConstraintProperties[qtiClass],constraintValues[attributes.responseIdentifier]=attributes[constraintProperty])}),constraintValues},isAnswered:function(runner,partially){var itemRunner=runner.itemRunner,responses=itemRunner&&itemRunner.getResponses(),count=0,empty=0,declarations,constraintValues;return itemRunner&&(declarations=currentItemHelper.getDeclarations(runner),constraintValues=currentItemHelper.guessInteractionConstraintValues(runner),_.forEach(declarations,function(declaration){var attributes=declaration.attributes||{},response=responses[attributes.identifier],baseType=attributes.baseType,cardinality=attributes.cardinality;count++,currentItemHelper.isQuestionAnswered(response,baseType,cardinality,declaration.defaultValue,constraintValues[attributes.identifier])||empty++})),!1===partially?0

    ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var escapeExpression=this.escapeExpression,self=this,stack1;return stack1=helpers["if"].call(depth0,depth0&&depth0.header,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),stack1||0===stack1?stack1:""});return{getExitMessage:function(scope,runner){var message=2= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"
    \n"}),plugin=pluginFactory({name:"timer",install:function(){var testRunner=this.getTestRunner();this.loadTimers=function(timeStore,config){var testContext=testRunner.getTestContext(),testPart=testRunner.getCurrentPart(),isLinear=testPart&&testPart.isLinear,timeConstraints=testContext.timeConstraints,timers=timersFactory(timeConstraints,isLinear,config);return Promise.all(_.map(timers,function(timer){return timeStore.getItem("consumed_".concat(timer.id)).then(function(savedConsumedTime){_.isNumber(savedConsumedTime)&&0<=savedConsumedTime&&config.restoreTimerFromClient&&(timer.remainingTime=timer.originalTime+timer.extraTime.total-savedConsumedTime)})})).then(function(){return timers})},this.saveTimers=function(timeStore,timers){return Promise.all(_.map(timers,function(timer){return timeStore.setItem("consumed_".concat(timer.id),timer.originalTime+timer.extraTime.total-timer.remainingTime)}))},testRunner.getTestStore().setVolatile(this.getName())},init:function(){function loadSavedTimers(timeStore){var testContext=testRunner.getTestContext();if(self.timerbox&&testContext.timeConstraints)return self.loadTimers(timeStore,config).then(function(timers){return self.timerbox.update(timers)}).catch(handleError)}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),stats={},screenreaderNotifcationTimeoutId;["test","testPart","section","item"].forEach(function(scope){return Object.assign(stats,_defineProperty({},scope,statsHelper.getInstantStats(scope,testRunner)))});var config=Object.assign({contextualWarnings:!1,warnings:testRunnerOptions.timerWarning||{},warningsForScreenreader:testRunnerOptions.timerWarningForScreenreader||{},guidedNavigation:testRunnerOptions.guidedNavigation,restoreTimerFromClient:testRunnerOptions.timer&&testRunnerOptions.timer.restoreTimerFromClient,questionsStats:stats},this.getConfig()),strategyHandler=getStrategyHandler(testRunner),handleError=function(err){testRunner.trigger("error",err)};return new Promise(function(resolve){return testRunner.getPluginStore(self.getName()).then(function(timeStore){testRunner.before("renderitem",function(){return loadSavedTimers(timeStore)}).before("enableitem",function(){if(config.restoreTimerFromClient)return loadSavedTimers(timeStore)}).on("tick",function(elapsed){if(self.timerbox){var timers=self.timerbox.getTimers(),updatedTimers=Object.keys(timers).reduce(function(acc,timerName){var statsScope=statsHelper.getInstantStats(timers[timerName].scope,testRunner),unansweredQuestions=statsScope&&statsScope.questions-statsScope.answered;return acc[timerName]=Object.assign({},timers[timerName],{remainingTime:timers[timerName].remainingTime-elapsed,unansweredQuestions:unansweredQuestions}),acc},{});self.timerbox.update(updatedTimers).catch(handleError)}}).after("renderitem",function(){self.timerbox&&($$1(self.timerbox.getElement()).find(".timer-wrapper").attr("aria-hidden",isReviewPanelEnabled(testRunner)),self.timerbox.start()),self.$screenreaderWarningContainer.text("")}).after("enableitem",function(){self.timerbox&&config.restoreTimerFromClient&&self.timerbox.start()}).on("move skip",function(){self.timerbox&&self.timerbox.stop()}).on("disableitem",function(){self.timerbox&&config.restoreTimerFromClient&&self.timerbox.stop()}),timeStore.getItem("zen-mode").then(function(startZen){self.timerbox=timerboxFactory({ariaHidden:isReviewPanelEnabled(testRunner),zenMode:{enabled:!0,startHidden:!!startZen},displayWarning:config.contextualWarnings}).on("change",_.throttle(function(){self.saveTimers(timeStore,this.getTimers())},1e3)).on("timeradd",function(timer){strategyHandler.setUp(timer).catch(handleError)}).on("timerremove",function(timer){strategyHandler.tearDown(timer).catch(handleError)}).on("timerstart",function(timer){strategyHandler.start(timer).catch(handleError)}).on("timerstop",function(timer){strategyHandler.stop(timer).catch(handleError)}).on("timerend",function(timer){strategyHandler.complete(timer).catch(handleError)}).on("timerchange",function(action,timer){self.trigger("".concat(action,"timer"),timer.qtiClassName,timer)}).on("zenchange",function(isZen){timeStore.setItem("zen-mode",!!isZen)}).on("init",resolve).on("error",handleError),self.timerbox.spread(testRunner,"timertick"),config.contextualWarnings||(self.timerbox.on("warn",function(message,level){level&&message&&testRunner.trigger(level,message)}),self.timerbox.on("warnscreenreader",_.debounce(function(message,remainingTime,scope){var statsScope=statsHelper.getInstantStats(scope,testRunner),unansweredQuestions=statsScope&&statsScope.questions-statsScope.answered;screenreaderNotifcationTimeoutId&&clearTimeout(screenreaderNotifcationTimeoutId),self.$screenreaderWarningContainer.text(message(remainingTime,unansweredQuestions)),screenreaderNotifcationTimeoutId=setTimeout(function(){return self.$screenreaderWarningContainer.text("")},2e4)},1e3,{leading:!0,trailing:!1})))}).catch(handleError)})})},render:function(){var $container=this.getAreaBroker().getControlArea();this.$screenreaderWarningContainer=$$1(screenreaderNotificationTpl()),this.timerbox.render($container),$container.append(this.$screenreaderWarningContainer)},destroy:function(){this.timerbox&&this.timerbox.stop().destroy()},show:function(){this.timerbox&&this.timerbox.show()},hide:function(){this.timerbox&&this.timerbox.hide()}});return plugin}),define("taoQtiTest/runner/plugins/controls/title/title",["jquery","lodash","taoTests/runner/plugin","handlebars","taoQtiTest/runner/helpers/map","taoQtiTest/runner/helpers/getTimerMessage","moment","taoQtiTest/runner/helpers/stats"],function($$1,_,pluginFactory,Handlebars,mapHelper,getTimerMessage,moment,statsHelper){'use strict';function titleTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,getTimerMessage=getTimerMessage&&Object.prototype.hasOwnProperty.call(getTimerMessage,"default")?getTimerMessage["default"]:getTimerMessage,moment=moment&&Object.prototype.hasOwnProperty.call(moment,"default")?moment["default"]:moment,statsHelper=statsHelper&&Object.prototype.hasOwnProperty.call(statsHelper,"default")?statsHelper["default"]:statsHelper;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n \n
    \n ",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="
    \n ",stack1=helpers.each.call(depth0,depth0&&depth0.titles,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n",buffer}),title=pluginFactory({name:"title",init:function(){var _this=this,testRunner=this.getTestRunner(),testMap=testRunner.getTestMap(),updateTitles=function(){var testContext=testRunner.getTestContext(),currentPart=mapHelper.getItemPart(testMap,testContext.itemPosition),currentItem=mapHelper.getItem(testMap,testContext.itemIdentifier);if(testMap.title&&_this.titles.test.$title.text(testMap.title).show(),currentPart&¤tPart.label&&_this.titles.testPart.$title.text(" - ".concat(currentPart.label)).show(),testContext.isDeepestSectionVisible){var section=mapHelper.getItemSection(testMap,testContext.itemPosition);_this.titles.section.$title.text(" - ".concat(section.label||testContext.sectionTitle)).show()}currentItem.label&&_this.titles.item.$title.text(" - ".concat(currentItem.label)).show()};testRunner.after("renderitem",function(){_.forOwn(_this.titles,function(options,scope){_this.titles[scope].$title.text(""),_this.titles[scope].$timer.text(""),"item"!==scope&&(_this.titles[scope].stats=statsHelper.getInstantStats(scope,testRunner))}),updateTitles()}).on("timertick",function(remainingTime,scope){var title=_this.titles[scope];if(title){var _this$titles$scope=_this.titles[scope],$timer=_this$titles$scope.$timer,stats=_this$titles$scope.stats,time=moment.duration(remainingTime/1e3,"seconds"),hours=time.get("hours"),minutes=time.get("minutes"),seconds=time.get("seconds"),unansweredQuestions=stats&&stats.questions-stats.answered;$timer&&$timer.text(getTimerMessage(hours,minutes,seconds,unansweredQuestions))}}).on("unloaditem",function(){$$1(".qti-controls",_this.$element).hide()})},render:function(){var _this2=this,$container=this.getAreaBroker().getControlArea();this.titles={test:{attribute:"qti-test-title",className:""},testPart:{attribute:"qti-test-part-title",className:"visible-hidden"},section:{attribute:"qti-test-position",className:""},item:{attribute:"qti-test-item-title",className:"visible-hidden"}},this.$element=$$1(titleTpl({titles:_.values(this.titles)})),$$1(".qti-controls",this.$element).hide(),$container.append(this.$element),_.forOwn(this.titles,function(_ref,scope){var attribute=_ref.attribute;_this2.titles[scope].$title=$container.find("[data-control=\"".concat(attribute,"\"]")),_this2.titles[scope].$timer=$container.find("[data-control=\"".concat(attribute,"-timer\"]"))})}});return title}),define("taoQtiTest/runner/plugins/controls/trace/itemTraceVariables",["lodash","moment","taoTests/runner/plugin"],function(_,moment,pluginFactory){'use strict';function timestamp(){return Date.now()/1000}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,moment=moment&&Object.prototype.hasOwnProperty.call(moment,"default")?moment["default"]:moment,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory;var itemTraceVariables=pluginFactory({name:"itemTraceVariables",install:function(){this.getTestRunner().getTestStore().setVolatile("trace")},init:function(){function onError(err){testRunner.trigger("error",err)}var testRunner=this.getTestRunner(),variables={};return testRunner.getPluginStore("trace").then(function(tracesStore){testRunner.after("renderitem enableitem",function(){var context=testRunner.getTestContext();variables={ITEM_START_TIME_CLIENT:timestamp()},tracesStore.getItem(context.itemIdentifier).then(function(data){return data&&_.merge(variables,data),tracesStore.setItem(context.itemIdentifier,variables)}).catch(onError)}).before("move skip exit timeout",function(){var context=testRunner.getTestContext();return variables.ITEM_END_TIME_CLIENT=timestamp(),variables.ITEM_TIMEZONE=moment().utcOffset(moment().utcOffset()).format("Z"),tracesStore.setItem(context.itemIdentifier,variables).catch(onError)}).before("unloaditem",function(){var context=testRunner.getTestContext();return testRunner.getProxy().callItemAction(context.itemIdentifier,"storeTraceData",{traceData:JSON.stringify(variables)},!0)})})}});return itemTraceVariables}),define("taoQtiTest/runner/plugins/navigation/allowSkipping",["lodash","i18n","taoTests/runner/plugin","taoQtiTest/runner/helpers/currentItem"],function(_,__,pluginFactory,currentItemHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,currentItemHelper=currentItemHelper&&Object.prototype.hasOwnProperty.call(currentItemHelper,"default")?currentItemHelper["default"]:currentItemHelper;var defaults={allowPartial:!0},allowSkipping=pluginFactory({name:"allowSkipping",init:function(){var testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginConfig=Object.assign({},defaults,this.getConfig());testRunner.before("nav-next move",function(){var testContext=testRunner.getTestContext(),isInteracting=!testRunner.getItemState(testContext.itemIdentifier,"disabled"),warning=pluginConfig.allowPartial?__("A response to this item is required."):__("A response to every question in this item is required.");if(isInteracting&&testRunnerOptions.enableAllowSkipping){var currenItem=testRunner.getCurrentItem(),allowSkipping="boolean"==typeof currenItem.allowSkipping?currenItem.allowSkipping:testContext.allowSkipping;if(!allowSkipping)return new Promise(function(resolve,reject){return 0===_.size(currentItemHelper.getDeclarations(testRunner))?resolve():currentItemHelper.isAnswered(testRunner,pluginConfig.allowPartial)?resolve():void(!testRunner.getState("alerted.notallowed")&&(testRunner.setState("alerted.notallowed",!0),testRunner.trigger("alert.notallowed",warning,function(){testRunner.trigger("resumeitem"),reject(),testRunner.setState("alerted.notallowed",!1)})))})}})}});return allowSkipping}),define("taoQtiTest/runner/plugins/navigation/next/nextWarningHelper",[],function(){'use strict';var toBoolean=function(value,defaultValue){return"undefined"==typeof value?defaultValue:!0===value||"true"===value};return function(options){function itemCanBeTriedAtWill(){return!1===isLast&&!1===isLinear&&-1===remainingAttempts&&!isNextItemInLinearPart()}function isNextItemInLinearPart(){return nextPart&&"undefined"!=typeof nextPart.isLinear&&isLastOfPart()&&!0===nextPart.isLinear}function shouldWarnOnTestEnd(){return isLast&&(endTestWarning||warnBeforeNext)&&shouldWarnForUnansweredItems()}function shouldWarnForUnansweredItems(){var hasUnanswered=stats&&0!=stats.questions-stats.answered,hasFlagged=stats&&0!==stats.flagged;return!unansweredOnly||hasUnanswered||hasFlagged}function shouldWarnOnPartChange(){return nextPartWarning&&isLastOfPart()&&shouldWarnForUnansweredItems()}function isLastOfPart(){return nextPart&&nextPart.id&&testPartId!==nextPart.id}var endTestWarning=toBoolean(options.endTestWarning,!1),isLast=toBoolean(options.isLast,!1),isLinear=toBoolean(options.isLinear,!1),nextItemWarning=toBoolean(options.nextItemWarning,!1),nextPartWarning=toBoolean(options.nextPartWarning,!1),stats=options.stats,nextPart=options.nextPart||{},remainingAttempts="undefined"==typeof options.remainingAttempts?-1:options.remainingAttempts,testPartId=options.testPartId||"",unansweredOnly=toBoolean(options.unansweredOnly,!1),warnBeforeNext=function(){return nextItemWarning&&!itemCanBeTriedAtWill()}(),warnBeforeEnd=function(){return shouldWarnOnTestEnd()}(),warnBeforeEndPart=function(){return shouldWarnOnPartChange()}();return{shouldWarnBeforeEndPart:function(){return warnBeforeEndPart},shouldWarnBeforeEnd:function(){return warnBeforeEnd},shouldWarnBeforeNext:function(){return warnBeforeNext}}}}),define("taoQtiTest/runner/plugins/navigation/next",["jquery","i18n","ui/hider","taoTests/runner/plugin","taoQtiTest/runner/plugins/navigation/next/nextWarningHelper","taoQtiTest/runner/helpers/messages","taoQtiTest/runner/helpers/map","taoQtiTest/runner/helpers/navigation","taoQtiTest/runner/helpers/stats","util/shortcut","util/namespace","handlebars"],function($$1,__,hider,pluginFactory,nextWarningHelper,messages,mapHelper,navigationHelper,statsHelper,shortcut,namespaceHelper,Handlebars){'use strict';function buttonTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,nextWarningHelper=nextWarningHelper&&Object.prototype.hasOwnProperty.call(nextWarningHelper,"default")?nextWarningHelper["default"]:nextWarningHelper,messages=messages&&Object.prototype.hasOwnProperty.call(messages,"default")?messages["default"]:messages,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,navigationHelper=navigationHelper&&Object.prototype.hasOwnProperty.call(navigationHelper,"default")?navigationHelper["default"]:navigationHelper,statsHelper=statsHelper&&Object.prototype.hasOwnProperty.call(statsHelper,"default")?statsHelper["default"]:statsHelper,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" ",(helper=helpers.className)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.className,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),buffer}function program3(depth0,data){var buffer="",stack1;return buffer+="\n aria-"+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof2(depth0)?depth0.apply(depth0):depth0)+"\"\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="",buffer}function program6(){return" no-label"}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.text,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n\n",buffer}),buttonData={next:{control:"move-forward",title:__("Submit and go to the next item"),specificTitle:__("Submit and go to the item %s"),icon:"forward",text:__("Next")},end:{control:"move-end",title:__("Submit and go to the end of the test"),icon:"fast-forward",text:__("End test")}},createElement=function(){var isLast=!!(0= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="",buffer});return dialogConfirmNext}),define("taoQtiTest/runner/plugins/navigation/next/linearNextItemWarning",["i18n","taoTests/runner/plugin","taoQtiTest/runner/helpers/map","taoQtiTest/runner/helpers/currentItem","taoQtiTest/runner/plugins/navigation/next/dialogConfirmNext","taoQtiTest/runner/helpers/navigation"],function(__,pluginFactory,mapHelper,currentItemHelper,dialogConfirmNext,navigationHelper){'use strict';__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,currentItemHelper=currentItemHelper&&Object.prototype.hasOwnProperty.call(currentItemHelper,"default")?currentItemHelper["default"]:currentItemHelper,dialogConfirmNext=dialogConfirmNext&&Object.prototype.hasOwnProperty.call(dialogConfirmNext,"default")?dialogConfirmNext["default"]:dialogConfirmNext,navigationHelper=navigationHelper&&Object.prototype.hasOwnProperty.call(navigationHelper,"default")?navigationHelper["default"]:navigationHelper;var linearNextItemWarning=pluginFactory({name:"linearNextItemWarning",init:function(){function getNextItemCategories(){var testContext=testRunner.getTestContext(),testMap=testRunner.getTestMap();return{nextPartWarning:mapHelper.hasItemCategory(testMap,testContext.itemIdentifier,"nextPartWarning",!0),nextSectionWarning:mapHelper.hasItemCategory(testMap,testContext.itemIdentifier,"nextSectionWarning",!0)}}function getCustomNextMessage(action){var itemPartiallyAnswered=currentItemHelper.isAnswered(testRunner,!0),customNextMessage;return customNextMessage=itemPartiallyAnswered?"next"===action?__("Are you sure you want to go to the next item? You will not be able to go back and change your answer."):"skip"===action?__("Are you sure you want to clear your answer and go to the next item? You will not be able to go back and provide an answer."):__("Are you sure you want to go to the next item? You will not be able to go back."):__("Are you sure you want to go to the next item? You will not be able to go back and provide an answer."),customNextMessage}function doNextWarning(action){return testRunner.trigger("disablenav"),testStore.getStore(self.getName()).then(function(store){return store.getItem("dontShowLinearNextItemWarning").then(function(checkboxValue){var checkboxParams=null;if(!0!==checkboxValue)return testRunnerOptions.enableLinearNextItemWarningCheckbox&&(checkboxParams={checked:checkboxValue,submitChecked:function(){store.setItem("dontShowLinearNextItemWarning",!0)},submitUnchecked:function(){store.setItem("dontShowLinearNextItemWarning",!1)}}),new Promise(function(resolve,reject){dialogConfirmNext(__("Go to the next item?"),getCustomNextMessage(action),resolve,function(){reject({cancel:!0})},checkboxParams)})})}).catch(function(err){if(err&&err instanceof Error)throw err;return err&&!0===err.cancel?(testRunner.trigger("enablenav"),Promise.reject()):void 0})}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),testStore=testRunner.getTestStore();testStore.setVolatile(self.getName()),testRunner.on("init",function(){testStore.getStore(self.getName()).then(function(store){store.setItem("dontShowLinearNextItemWarning",null)})}).before("move skip",function(e,type,scope){var context=testRunner.getTestContext(),map=testRunner.getTestMap(),item=testRunner.getCurrentItem(),currentPart=testRunner.getCurrentPart(),categories=getNextItemCategories(),isLast=navigationHelper.isLast(map,context.itemIdentifier);if(currentPart&¤tPart.isLinear){if("section"===scope&&categories.nextSectionWarning)return;if(categories.nextPartWarning)return;if(item.informational)return;if("next"===type&&!isLast&&testRunnerOptions.forceEnableLinearNextItemWarning)return doNextWarning("next");if("skip"===e.name&&!isLast&&testRunnerOptions.forceEnableLinearNextItemWarning)return doNextWarning("skip")}})}});return linearNextItemWarning}),define("taoQtiTest/runner/plugins/navigation/nextSection",["jquery","lodash","i18n","ui/hider","taoTests/runner/plugin","taoQtiTest/runner/helpers/messages","handlebars","taoQtiTest/runner/helpers/map"],function($$1,_,__,hider,pluginFactory,messages,Handlebars,mapHelper){'use strict';function buttonTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,messages=messages&&Object.prototype.hasOwnProperty.call(messages,"default")?messages["default"]:messages,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" ",(helper=helpers.className)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.className,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),buffer}function program3(depth0,data){var buffer="",stack1;return buffer+="\n aria-"+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof2(depth0)?depth0.apply(depth0):depth0)+"\"\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="",buffer}function program6(){return" no-label"}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.text,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n\n",buffer}),nextSection=pluginFactory({name:"nextsection",init:function(){function getNextSectionCategories(){var testContext=testRunner.getTestContext(),testMap=testRunner.getTestMap();return{nextSection:mapHelper.hasItemCategory(testMap,testContext.itemIdentifier,"nextSection",!0),nextSectionWarning:mapHelper.hasItemCategory(testMap,testContext.itemIdentifier,"nextSectionWarning",!0),noExitTimedSectionWarning:mapHelper.hasItemCategory(testMap,testContext.itemIdentifier,"noExitTimedSectionWarning",!0)}}function toggle(){var categories=getNextSectionCategories();testRunnerOptions.nextSection&&(categories.nextSection||categories.nextSectionWarning)?self.show():self.hide()}function nextSection(){testRunner.next("section")}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),isWarnSectionLeavingEabled=function(){var testContext=testRunner.getTestContext(),categories=getNextSectionCategories(),timeConstraints=testContext.timeConstraints||[];return timeConstraints.some(function(_ref){var source=_ref.source;return source===testContext.sectionId})&&!categories.noExitTimedSectionWarning&&!(testRunnerOptions.timer||{}).keepUpToTimeout};this.$element=$$1(buttonTpl({control:"next-section",title:__("Skip to the next section"),icon:"fast-forward",text:__("Next Section")})),this.$element.on("click",function(e){var enable=_.bind(self.enable,self),categories=getNextSectionCategories();if(e.preventDefault(),!1!==self.getState("enabled"))if(self.disable(),categories.nextSectionWarning&&!isWarnSectionLeavingEabled()){var submitButtonLabel=__("CONTINUE TO THE NEXT SECTION");testRunner.trigger("confirm.nextsection",messages.getExitMessage("section",testRunner,"",!1,submitButtonLabel),nextSection,enable,{buttons:{labels:{ok:submitButtonLabel,cancel:__("CANCEL")}}})}else nextSection()}),this.disable(),toggle(),testRunner.on("loaditem",toggle).on("enablenav",function(){self.enable()}).on("disablenav",function(){self.disable()}).on("hidenav",function(){self.hide()}).on("shownav",function(){self.show()})},render:function(){var $container=this.getAreaBroker().getNavigationArea();$container.append(this.$element)},destroy:function(){this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}});return nextSection}),define("taoQtiTest/runner/plugins/navigation/previous",["jquery","lodash","i18n","ui/hider","taoTests/runner/plugin","util/shortcut","util/namespace","taoQtiTest/runner/helpers/navigation","taoQtiTest/runner/helpers/map","handlebars"],function($$1,_,__,hider,pluginFactory,shortcut,namespaceHelper,navigationHelper,mapHelper,Handlebars){'use strict';function buttonTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,navigationHelper=navigationHelper&&Object.prototype.hasOwnProperty.call(navigationHelper,"default")?navigationHelper["default"]:navigationHelper,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+=" ",(helper=helpers.className)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.className,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1),buffer}function program3(depth0,data){var buffer="",stack1;return buffer+="\n aria-"+escapeExpression((stack1=null==data||!1===data?data:data.key,"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"=\""+escapeExpression("function"===_typeof2(depth0)?depth0.apply(depth0):depth0)+"\"\n ",buffer}function program5(depth0,data){var buffer="",stack1,helper;return buffer+="",buffer}function program6(){return" no-label"}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.text,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n\n",buffer}),previous=pluginFactory({name:"previous",init:function(){function doPrevious(previousItemWarning){function triggerAction(){testRunner.previous()}var context=testRunner.getTestContext();testRunner.trigger("disablenav"),!1!==self.getState("enabled")&&(previousItemWarning&&-1!==context.remainingAttempts?testRunner.trigger("confirm.previous",__("You are about to go to the previous item. Click OK to continue and go to the previous item."),triggerAction,function(){testRunner.trigger("enablenav")}):triggerAction())}var _this=this,self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})[this.getName()]||{},canDoPrevious=function(){var testMap=testRunner.getTestMap(),context=testRunner.getTestContext(),currentSection=testRunner.getCurrentSection(),noExitTimedSectionWarning=mapHelper.hasItemCategory(testMap,context.itemIdentifier,"noExitTimedSectionWarning",!0),currentPart=testRunner.getCurrentPart(),previousSection,previousPart;if(_.isPlainObject(testMap)&&0===_.size(testMap))return!1;if(navigationHelper.isFirst(testMap,context.itemIdentifier))return!1;if(navigationHelper.isFirstOf(testMap,context.itemIdentifier,"section")){if(currentSection.isCatAdaptive)return!1;if(previousSection=mapHelper.getItemSection(testMap,context.itemPosition-1),previousSection.isCatAdaptive||previousSection.timeConstraint&&!noExitTimedSectionWarning)return!1}return!(navigationHelper.isFirstOf(testMap,context.itemIdentifier,"part")&&(previousPart=mapHelper.getItemPart(testMap,context.itemPosition-1),previousPart.isLinear))&&!1===currentPart.isLinear&&!0===context.canMoveBackward},toggle=function(){canDoPrevious()?self.show():self.hide()};this.$element=$$1(buttonTpl({control:"move-backward",title:__("Submit and go to the previous item"),icon:"backward",text:__("Previous")})),this.$element.on("click",function(e){e.preventDefault(),testRunner.trigger("nav-previous")});var registerShortcut=function(kbdShortcut){testRunnerOptions.allowShortcuts&&kbdShortcut&&shortcut.add(namespaceHelper.namespaceAll(kbdShortcut,_this.getName(),!0),function(){canDoPrevious()&&!0===self.getState("enabled")&&testRunner.trigger("nav-previous",[!0])},{avoidInput:!0,prevent:!0})};registerShortcut(pluginShortcuts.trigger),toggle(),self.disable(),testRunner.on("loaditem",toggle).on("enablenav",function(){self.enable()}).on("disablenav",function(){self.disable()}).on("hidenav",function(){self.hide()}).on("shownav",function(){self.show()}).on("nav-previous",function(previousItemWarning){doPrevious(previousItemWarning)}).on("enableaccessibilitymode",function(){var kbdShortcut=pluginShortcuts.triggerAccessibility;kbdShortcut&&!_this.getState("eaccessibilitymode")&&(shortcut.remove(".".concat(_this.getName())),registerShortcut(kbdShortcut),_this.setState("eaccessibilitymode"))})},render:function(){var $container=this.getAreaBroker().getNavigationArea();$container.append(this.$element)},destroy:function(){shortcut.remove(".".concat(this.getName())),this.$element.remove()},enable:function(){this.$element.removeProp("disabled").removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}});return previous}),define("taoQtiTest/runner/plugins/navigation/review/navigator",["jquery","lodash","ui/component","ui/autoscroll","taoQtiTest/runner/helpers/map","handlebars"],function($$1,_,component,autoscroll,mapHelper,Handlebars){'use strict';function navigatorTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function navigatorTreeTpl(data,options,asString){var html=Template$1(data,options);return asString||!0?html:$(html)}function navigatorFactory(config,map,context){function flagItem($item){var position=$item.data("position"),flagged=!$item.hasClass(_cssCls.flagged);navigator.setItemFlag(position,flagged),navigator.trigger("flag",position,flagged)}function jump($item){var position=$item.data("position");navigator.trigger("jump",position)}var navigator;return navigator=component(navigatorApi,_defaults).setTemplate(navigatorTpl).on("destroy",function(){this.controls=null}).on("show",function(){this.autoScroll()}).on("render",function(){var self=this,$component=this.getElement(),$filterBar=$component.find(_selectors.filterBar),$filters=$filterBar.find("li"),$tree=$component.find(_selectors.tree);this.controls={$infoAnswered:$component.find(_selectors.infoAnswered),$infoViewed:$component.find(_selectors.infoViewed),$infoAll:$component.find(_selectors.tabInfoAll),$infoUnanswered:this.config.showLegend?$component.find(_selectors.infoUnanswered):$component.find(_selectors.tabInfoUnanswered),$infoFlagged:this.config.showLegend?$component.find(_selectors.infoFlagged):$component.find(_selectors.tabInfoFlagged),$filterBar:$filterBar,$filters:$filters,$tree:$tree,$linearState:$component.find(_selectors.linearState)},this.updateConfig(),$component.on("click".concat(_selectors.component),_selectors.collapseHandle,function(){self.is("disabled")||($component.toggleClass(_cssCls.collapsed),$component.hasClass(_cssCls.collapsed)&&self.openSelected())}),$component.on("click".concat(_selectors.component),_selectors.infoPanelLabels,function(){self.is("disabled")||self.togglePanel($$1(this).closest(_selectors.infoPanel),_selectors.infoPanel)}),$tree.on("click".concat(_selectors.component),_selectors.partLabels,function(){var $panel;self.is("disabled")||($panel=$$1(this).closest(_selectors.parts),self.togglePanel($panel,_selectors.parts)&&($panel.hasClass(_cssCls.active)?self.openSelected():self.openOnly($panel.find(_selectors.sections).first(),$panel)))}),$tree.on("click".concat(_selectors.component),_selectors.sectionLabels,function(){self.is("disabled")||self.togglePanel($$1(this).closest(_selectors.sections),_selectors.sections)}),$tree.on("click".concat(_selectors.component),_selectors.itemLabels,function(event){var $item,$target;self.is("disabled")||($item=$$1(this).closest(_selectors.items),!$item.hasClass(_cssCls.disabled)&&($target=$$1(event.target),self.config.canFlag&&$target.is(_selectors.icons)&&!$component.hasClass(_cssCls.collapsed)?!$item.hasClass(_cssCls.unseen)&&!$item.hasClass(_cssCls.info)&&flagItem($item):!$item.hasClass(_cssCls.active)&&(self.select($item),jump($item))))}),$tree.on("click".concat(_selectors.component),_selectors.linearStart,function(){var $btn;self.is("disabled")||($btn=$$1(this),!$btn.hasClass(_cssCls.disabled)&&($btn.addClass(_cssCls.disabled),jump($btn)))}),$filterBar.on("click".concat(_selectors.component),_selectors.filter,function(){var $btn,mode;self.is("disabled")||($btn=$$1(this),mode=$btn.data("mode"),$filters.removeClass(_cssCls.active),$filters.attr("aria-selected",!1),$component.removeClass(_cssCls.collapsed),$btn.addClass(_cssCls.active),$btn.attr("aria-selected",!0),self.filter(mode),self.autoScroll())}),this.update(map,context)}),navigator.currentFilter="all",navigator.init(config)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,autoscroll=autoscroll&&Object.prototype.hasOwnProperty.call(autoscroll,"default")?autoscroll["default"]:autoscroll,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program3(depth0,data){var buffer="",helper,options;return buffer+="\n
    \n \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Test status",options):helperMissing.call(depth0,"__","Test status",options)))+"\n \n \n \n
      \n
    • \n \n \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Viewed",options):helperMissing.call(depth0,"__","Viewed",options)))+"\n -/-\n \n
    • \n
    • \n \n \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Answered",options):helperMissing.call(depth0,"__","Answered",options)))+"\n -/-\n \n
    • \n
    • \n \n \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Unanswered",options):helperMissing.call(depth0,"__","Unanswered",options)))+"\n -/-\n \n
    • \n
    • \n \n \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Flagged",options):helperMissing.call(depth0,"__","Flagged",options)))+"\n -/-\n \n
    • \n
    \n
    \n ",buffer}function program9(depth0,data){var buffer="",helper,options;return buffer+=escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Unanswered",options):helperMissing.call(depth0,"__","Unanswered",options)))+" (0)",buffer}function program13(depth0,data){var buffer="",helper,options;return buffer+=escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Flagged",options):helperMissing.call(depth0,"__","Flagged",options)))+" (0)",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1,helper,options;return buffer+="
    \n
    \n \n \n
    \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.showLegend,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n\n\n
    \n
      \n
    • \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"All",options):helperMissing.call(depth0,"__","All",options)))+"\n ",stack1=helpers.unless.call(depth0,depth0&&depth0.showLegend,{hash:{},inverse:self.noop,fn:self.program(5,function(){return"(0)"},data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n
    • \n\n
    • \n \n ",stack1=helpers.unless.call(depth0,depth0&&depth0.showLegend,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n
    • \n\n
    • \n \n ",stack1=helpers.unless.call(depth0,depth0&&depth0.showLegend,{hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n
    • \n
    \n
    \n\n \n\n
    \n \n

    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"In this part of the test navigation is not allowed.",options):helperMissing.call(depth0,"__","In this part of the test navigation is not allowed.",options)))+"\n

    \n
    \n
    \n",buffer}),Template$1=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var buffer="",stack1,helper;return buffer+="\n
  • \n \n ",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n \n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.isLinear,{hash:{},inverse:self.program(8,program8,data),fn:self.program(6,program6,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
  • \n ",buffer}function program2(){return"active"}function program4(){return"collapsed"}function program6(depth0,data){var buffer="",stack1,helper,options;return buffer+="\n
    \n \n

    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"In this part of the test navigation is not allowed.",options):helperMissing.call(depth0,"__","In this part of the test navigation is not allowed.",options)))+"\n

    \n

    \n \n

    \n
    \n ",buffer}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="\n
      \n ",stack1=helpers.each.call(depth0,depth0&&depth0.sections,{hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n ",buffer}function program9(depth0,data){var buffer="",stack1,helper;return buffer+="\n
  • \n \n ",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n "+escapeExpression((stack1=(stack1=depth0&&depth0.stats,null==stack1||!1===stack1?stack1:stack1.answered),"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"/"+escapeExpression((stack1=(stack1=depth0&&depth0.stats,null==stack1||!1===stack1?stack1:stack1.total),"function"===_typeof2(stack1)?stack1.apply(depth0):stack1))+"\n \n
      \n ",stack1=helpers.each.call(depth0,depth0&&depth0.items,{hash:{},inverse:self.noop,fn:self.programWithDepth(10,program10,data,depth0),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n
  • \n ",buffer}function program10(depth0,data,depth1){var buffer="",stack1,helper;return buffer+="\n
  • \n \n \n ",(helper=helpers.index)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.index,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n ",(helper=helpers.label)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.label,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n
  • \n ",buffer}function program11(){return"false"}function program13(){return"true"}function program15(){return"aria-current=\"page\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this,stack1;return buffer+="
      \n ",stack1=helpers.each.call(depth0,depth0&&depth0.parts,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n
    \n",buffer}),_defaults={scope:"test",canCollapse:!1,preventsUnseen:!0,hidden:!1},_cssCls={active:"active",collapsed:"collapsed",collapsible:"collapsible",hidden:"hidden",disabled:"disabled",flagged:"flagged",answered:"answered",viewed:"viewed",unseen:"unseen",info:"info",icon:"qti-navigator-icon",scope:{test:"scope-test",testPart:"scope-test-part",testSection:"scope-test-section"}},_iconCls=[_cssCls.info,_cssCls.flagged,_cssCls.answered,_cssCls.viewed],_selectors={component:".qti-navigator",filterBar:".qti-navigator-filters",filter:".qti-navigator-filter",tree:".qti-navigator-tree",collapseHandle:".qti-navigator-collapsible",linearState:".qti-navigator-linear",infoAnswered:".qti-navigator-answered .qti-navigator-counter",infoViewed:".qti-navigator-viewed .qti-navigator-counter",infoUnanswered:".qti-navigator-unanswered .qti-navigator-counter",infoFlagged:".qti-navigator-flagged .qti-navigator-counter",infoPanel:".qti-navigator-info",infoPanelLabels:".qti-navigator-info > .qti-navigator-label",tabInfoAll:"[data-mode=\"all\"] .qti-navigator-counter",tabInfoUnanswered:"[data-mode=\"unanswered\"] .qti-navigator-counter",tabInfoFlagged:"[data-mode=\"flagged\"] .qti-navigator-counter",parts:".qti-navigator-part",partLabels:".qti-navigator-part > .qti-navigator-label",sections:".qti-navigator-section",sectionLabels:".qti-navigator-section > .qti-navigator-label",items:".qti-navigator-item",itemLabels:".qti-navigator-item > .qti-navigator-label",itemIcons:".qti-navigator-item > .qti-navigator-icon",activeItem:".qti-navigator-item.active",icons:".qti-navigator-icon",linearStart:".qti-navigator-linear-part button",counters:".qti-navigator-counter",actives:".active",collapsible:".collapsible",collapsiblePanels:".collapsible-panel",unseen:".unseen",answered:".answered",flagged:".flagged",notFlagged:":not(.flagged)",notAnswered:":not(.answered)",notInformational:":not(.info)",informational:".info",hidden:".hidden",disabled:".disabled"},_filterMap={all:"",unanswered:[_selectors.answered,_selectors.informational].join(","),flagged:_selectors.notFlagged,answered:_selectors.notAnswered,filtered:_selectors.hidden},navigatorApi={updateStats:function(position,flag){var map=this.map,item;map&&(item=mapHelper.getItemAt(map,position),item&&(item.flagged=flag,mapHelper.updateItemStats(map,position)))},getProgressionTotal:function(progression,target){var total;return total="questions"===target?progression.questions:progression.total,total},setItemFlag:function(position,flag){var $item=position&&position.jquery?position:this.controls.$tree.find("[data-position=".concat(position,"]")),progression=this.progression,icon;this.updateStats(position,flag),$item.toggleClass(_cssCls.flagged,flag),icon=_.find(_iconCls,_.bind($item.hasClass,$item))||_cssCls.unseen,$item.find(_selectors.icons).attr("class","".concat(_cssCls.icon," icon-").concat(icon)),progression.flagged=this.controls.$tree.find(_selectors.flagged).length,this.writeCount(this.controls.$infoFlagged,progression.flagged,this.getProgressionTotal(progression,"questions")),this.filter(this.currentFilter)},filter:function(criteria){var self=this,$items=this.controls.$tree.find(_selectors.items).removeClass(_cssCls.hidden),filterCb=_filterMap[criteria];filterCb&&$items.filter(filterCb).addClass(_cssCls.hidden),this.controls.$tree.find(_selectors.sections).each(function(){var $section=$$1(this),$itemsFound=$section.find(_selectors.items).not(_selectors.hidden),$filtered=$itemsFound.not(_selectors.disabled);self.writeCount($section.find(_selectors.counters),$filtered.length,$itemsFound.length)}),this.currentFilter=criteria},updateConfig:function(config){var $component=this.getElement(),scopeClass=_cssCls.scope[this.config.scope||_defaults.scope];return config=_.merge(this.config,config||{}),$component.toggleClass(_cssCls.collapsible,config.canCollapse),$component.removeClass(scopeClass),scopeClass=_cssCls.scope[this.config.scope||_defaults.scope],$component.addClass(scopeClass),this},autoScroll:function(){autoscroll(this.controls.$tree.find(_selectors.activeItem),this.controls.$tree)},update:function(map,context){var scopedMap=this.getScopedMap(map,context),testPart=mapHelper.getPart(map,context.testPartId),progression=scopedMap.stats||{questions:0,answered:0,flagged:0,viewed:0,total:0},totalQuestions=this.getProgressionTotal(progression,"questions");if(this.map=map,this.progression=progression,this.writeCount(this.controls.$infoAnswered,progression.answered,totalQuestions),this.writeCount(this.controls.$infoUnanswered,totalQuestions-progression.answered,totalQuestions),this.writeCount(this.controls.$infoViewed,progression.viewed,this.getProgressionTotal(progression,"total")),this.writeCount(this.controls.$infoFlagged,progression.flagged,totalQuestions),this.writeCount(this.controls.$infoAll,totalQuestions,null),!testPart.isLinear){this.controls.$filterBar.show(),this.controls.$linearState.hide(),this.controls.$tree.html(navigatorTreeTpl(scopedMap)),this.autoScroll();var activeItem=mapHelper.getActiveItem(scopedMap);this.setState("prevents-unseen",this.config.preventsUnseen);var isSkipaheadEnabled=activeItem&&activeItem.categories&&0<=_.indexOf(activeItem.categories,"x-tao-option-review-skipahead");this.setState("skipahead-enabled",isSkipaheadEnabled),this.config.preventsUnseen&&!isSkipaheadEnabled&&this.controls.$tree.find(_selectors.unseen).addClass(_cssCls.disabled)}else this.controls.$filterBar.hide(),this.controls.$linearState.show(),this.controls.$tree.empty();return this.filter(this.controls.$filters.filter(_selectors.actives).data("mode")),this.trigger("update"),this},getScopedMap:function(map,context){var scopedMap=mapHelper.getScopeMapFromContext(map,context,this.config.scope),testPart=mapHelper.getPart(scopedMap,context.testPartId)||{},section=mapHelper.getSection(scopedMap,context.sectionId)||{},item=mapHelper.getItem(scopedMap,context.itemIdentifier)||{};return testPart.active=!0,section.active=!0,item.active=!0,mapHelper.each(scopedMap,function(itm){var cls=[],icon="";itm.active&&cls.push("active"),itm.informational&&(cls.push("info"),icon=icon||"info"),itm.flagged&&(cls.push("flagged"),icon=icon||"flagged"),itm.answered&&(cls.push("answered"),icon=icon||"answered"),itm.viewed?(cls.push("viewed"),icon=icon||"viewed"):(cls.push("unseen"),icon=icon||"unseen"),itm.cls=cls.join(" "),itm.icon=icon})},writeCount:function($place,count,total){var display=0;$place.parent().hasClass("qti-navigator-tab")?display=Math.max(count,0):0",buffer}function program6(){return" no-label"}function program8(depth0,data){var buffer="",stack1,helper;return buffer+="",(helper=helpers.text)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.text,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",buffer}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,self=this,stack1,helper;return buffer+="\n \n ",stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n ",stack1=helpers["if"].call(depth0,depth0&&depth0.text,{hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data}),(stack1||0===stack1)&&(buffer+=stack1),buffer+="\n \n\n",buffer}),buttonData={skip:{control:"skip",title:__("Skip and go to the next item"),icon:"external",text:__("Skip")},end:{control:"skip-end",title:__("Skip and go to the end of the test"),icon:"external",text:__("Skip and end test")}},createElement=function(testRunner){var testContext=testRunner.getTestContext(),testMap=testRunner.getTestMap(),isLast=navigationHelper.isLast(testMap,testContext.itemIdentifier),dataType=isLast?"end":"skip";return $$1(buttonTpl(buttonData[dataType]))},updateElement=function($element){var isLast=!!(1= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),"
    \n \n
    "});return answerMaskingFactory}),define("taoQtiTest/runner/plugins/tools/answerMasking/plugin",["i18n","taoTests/runner/plugin","ui/hider","util/shortcut","util/namespace","taoQtiTest/runner/helpers/map","taoQtiTest/runner/plugins/tools/answerMasking/answerMasking"],function(__,pluginFactory,hider,shortcut,namespaceHelper,mapHelper,answerMaskingFactory){'use strict';__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,answerMaskingFactory=answerMaskingFactory&&Object.prototype.hasOwnProperty.call(answerMaskingFactory,"default")?answerMaskingFactory["default"]:answerMaskingFactory;var actionPrefix="tool-".concat("answer-masking","-"),itemStates={},defaultConfig={restoreStateOnToggle:!0,restoreStateOnMove:!0},plugin=pluginFactory({name:"answer-masking",init:function(){function isPluginEnabled(){var answerMaskingCategory=mapHelper.hasItemCategory(testRunner.getTestMap(),testRunner.getTestContext().itemIdentifier,"answerMasking",!0);return answerMaskingCategory&&itemContainsChoiceInteraction()}function itemContainsChoiceInteraction(){var $container=self.getAreaBroker().getContentArea().parent();return $container.find(".qti-choiceInteraction").length}function togglePluginButton(){isPluginEnabled()?self.show():self.hide()}function togglePlugin(){answerMasking.getState("enabled")?disableMasking():enableMasking()}function enableMasking(){var testContext=testRunner.getTestContext(),itemId=testContext.itemIdentifier;answerMasking.enable(),pluginConfig.restoreStateOnToggle&&answerMasking.setMasksState(itemStates[itemId]),self.button.turnOn(),self.trigger("start")}function disableMasking(){var testContext=testRunner.getTestContext(),itemId=testContext.itemIdentifier;answerMasking.getState("enabled")&&(itemStates[itemId]=answerMasking.getMasksState()),answerMasking.disable(),self.button.turnOff(),self.trigger("end")}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginConfig=Object.assign({},defaultConfig,this.getConfig()),pluginShortcuts=(testRunnerOptions.shortcuts||{})["answer-masking"]||{},$contentArea=this.getAreaBroker().getContentArea(),answerMasking=answerMaskingFactory($contentArea);this.button=this.getAreaBroker().getToolbox().createEntry({title:__("Answer Masking"),icon:"result-nok",control:"answer-masking",text:__("Answer Masking")}),this.button.on("click",function(e){e.preventDefault(),testRunner.trigger("".concat(actionPrefix,"toggle"))}),testRunnerOptions.allowShortcuts&&pluginShortcuts.toggle&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.toggle,this.getName(),!0),function(){testRunner.trigger("".concat(actionPrefix,"toggle"))},{avoidInput:!0,prevent:!0}),this.disable(),testRunner.on("loaditem",function(){var testContext=testRunner.getTestContext(),itemId=testContext.itemIdentifier;pluginConfig.restoreStateOnMove||(itemStates[itemId]=[]),togglePluginButton()}).on("enabletools renderitem",function(){togglePluginButton(),self.enable()}).on("beforeunloaditem",function(){disableMasking()}).on("disabletools unloaditem",function(){self.disable(),disableMasking()}).on("".concat(actionPrefix,"toggle"),function(){isPluginEnabled()&&togglePlugin()}).on("tool-eliminator-toggle",function(){disableMasking()})},destroy:function(){shortcut.remove(".".concat(this.getName()))},enable:function(){this.button.enable()},disable:function(){this.button.disable()},show:function(){this.button.show()},hide:function(){this.button.hide()}});return plugin}),define("taoQtiTest/runner/plugins/tools/apipTextToSpeech/textToSpeech",["jquery","i18n","handlebars","ui/component","interact","ui/component/stackable","ui/component/placeable","ui/feedback","nouislider"],function($$1,__,Handlebars,component,interact,makeStackable,makePlaceable,feedback){'use strict';function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);imaxXPosition?maxXPosition:x,y)}},defaultConfig),currentItem,playbackRate;return makePlaceable(ttsComponent),makeStackable(ttsComponent,stackingOptions),ttsComponent.setTemplate(ttsTemplate).on("init",function(){if(container.hasClass("tts-component-container"))throw new Error("Container already has assigned text to speech component");container.addClass("tts-component-container"),this.render(container)}).on("render",function(){var _this=this,_this$getConfig=this.getConfig(),left=_this$getConfig.left,maxPlaybackRate=_this$getConfig.maxPlaybackRate,minPlaybackRate=_this$getConfig.minPlaybackRate,defaultPlaybackRate=_this$getConfig.playbackRate,top=_this$getConfig.top;0>left&&(left=window.innerWidth-this.getElement().width()+left);var $element=this.getElement(),$closeElement=$$1(".tts-control-close",$element),$dragElement=$$1(".tts-control-drag",$element),$playbackElement=$$1(".tts-control-playback",$element),$sfhModeElement=$$1(".tts-control-mode",$element),$sliderElement=$$1(".tts-slider",$element),$settingsElement=$$1(".tts-control-settings",$element);playbackRate=defaultPlaybackRate,$element.css("touch-action","none");var interactElement=interact($element).draggable({autoScroll:!0,manualStart:!0,restrict:{restriction:container[0],elementRect:{left:0,right:1,top:0,bottom:1}},onmove:function(event){var _Mathround=Math.round,xOffset=_Mathround(event.dx),yOffset=_Mathround(event.dy);_this.moveBy(xOffset,yOffset)}});interact($dragElement[0]).on("down",function(event){var interaction=event.interaction;interaction.start({name:"drag"},interactElement,$element[0])}),$sliderElement.noUiSlider({animate:!0,connected:!0,range:{min:minPlaybackRate,max:maxPlaybackRate},start:defaultPlaybackRate,step:.1}).on("change",this.setPlaybackRate),$closeElement.on("click",this.close),$playbackElement.on("mousedown touchstart",this.togglePlayback),$sfhModeElement.on("click",this.toggleSFHMode),$settingsElement.on("click",this.toggleSettings),audio.addEventListener("ended",this.initNextItem),audio.addEventListener("error",function(){feedback().error(__("Can not playback media file!")),_this.initNextItem()}),window.addEventListener("resize",this.handleResize),this.moveTo(left,top)}).on("hide",function(){this.setTTSStateOnContainer("visible",!1)}).on("show",function(){this.setTTSStateOnContainer("visible",!0)}).on("destroy",function(){container.removeClass("tts-component-container"),this.clearAPIPElements(),this.stop(),window.removeEventListener("resize",this.handleResize)}),ttsComponent.init(config),ttsComponent}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,component=component&&Object.prototype.hasOwnProperty.call(component,"default")?component["default"]:component,interact=interact&&Object.prototype.hasOwnProperty.call(interact,"default")?interact["default"]:interact,makeStackable=makeStackable&&Object.prototype.hasOwnProperty.call(makeStackable,"default")?makeStackable["default"]:makeStackable,makePlaceable=makePlaceable&&Object.prototype.hasOwnProperty.call(makePlaceable,"default")?makePlaceable["default"]:makePlaceable,feedback=feedback&&Object.prototype.hasOwnProperty.call(feedback,"default")?feedback["default"]:feedback;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="
    \n
    \n
    \n \n \n \n
    \n \n
    \n \n \n \n \n
    \n
    \n \n \n \n
    \n
    \n \n \n \n
    \n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"Speed",options):helperMissing.call(depth0,"__","Speed",options)))+"
    \n
    \n
    \n
    \n
    \n",buffer}),defaultConfig={activeElementClass:"tts-active-content-node",elementClass:"tts-content-node",left:-10,maxPlaybackRate:2,minPlaybackRate:.5,playbackRate:1,top:50},stackingOptions={stackingScope:"test-runner"};return maskingComponentFactory}),define("taoQtiTest/runner/plugins/tools/apipTextToSpeech/ttsApipDataProvider",[],function(){'use strict';var getTTSItemData=function(apipElement){var identifier=apipElement["@attributes"].identifier,_apipElement$contentL=apipElement.contentLinkInfo,contentLinkInfo=void 0===_apipElement$contentL?{"@attributes":{}}:_apipElement$contentL,_apipElement$relatedE=apipElement.relatedElementInfo;_apipElement$relatedE=void 0===_apipElement$relatedE?{}:_apipElement$relatedE;var _apipElement$relatedE2=_apipElement$relatedE.spoken;_apipElement$relatedE2=void 0===_apipElement$relatedE2?{}:_apipElement$relatedE2;var _apipElement$relatedE3=_apipElement$relatedE2.audioFileInfo,audioFileInfo=void 0===_apipElement$relatedE3?[]:_apipElement$relatedE3,_ref=audioFileInfo.find(function(audioFile){return"audio/mpeg"===audioFile["@attributes"].mimeType})||{},_ref$fileHref=_ref.fileHref,fileHref=void 0===_ref$fileHref?"":_ref$fileHref,elementId=contentLinkInfo["@attributes"].qtiLinkIdentifierRef;return{identifier:identifier,selector:elementId&&"#".concat(elementId),url:fileHref.replace("assets/","")}},getTTSItemOrder=function(identifier,elementOrder){var _ref2=elementOrder.find(function(apipElementOrder){return apipElementOrder["@attributes"].identifierRef===identifier})||{},order=_ref2.order;return parseInt(order)||Number.POSITIVE_INFINITY};return function ttsApipDataProvider(apipData){var _apipData$accessibili=apipData.accessibilityInfo;_apipData$accessibili=void 0===_apipData$accessibili?{}:_apipData$accessibili;var _apipData$accessibili2=_apipData$accessibili.accessElement,accessElement=void 0===_apipData$accessibili2?[]:_apipData$accessibili2,_apipData$inclusionOr=apipData.inclusionOrder;_apipData$inclusionOr=void 0===_apipData$inclusionOr?{}:_apipData$inclusionOr;var _apipData$inclusionOr2=_apipData$inclusionOr.textGraphicsDefaultOrder;_apipData$inclusionOr2=void 0===_apipData$inclusionOr2?{}:_apipData$inclusionOr2;var _apipData$inclusionOr3=_apipData$inclusionOr2.elementOrder,elementOrder=void 0===_apipData$inclusionOr3?[]:_apipData$inclusionOr3;return accessElement.map(getTTSItemData).filter(function(_ref3){var url=_ref3.url;return!!url}).sort(function(a,b){return getTTSItemOrder(a.identifier,elementOrder)-getTTSItemOrder(b.identifier,elementOrder)})}}),define("taoQtiTest/runner/plugins/tools/apipTextToSpeech/plugin",["lodash","i18n","ui/hider","util/shortcut","util/namespace","taoTests/runner/plugin","taoQtiTest/runner/helpers/map","ui/keyNavigation/navigator","ui/keyNavigation/navigableDomElement","taoQtiTest/runner/plugins/tools/apipTextToSpeech/textToSpeech","taoQtiTest/runner/plugins/tools/apipTextToSpeech/ttsApipDataProvider"],function(_,__,hider,shortcut,namespaceHelper,pluginFactory,mapHelper,keyNavigator,navigableDomElement,ttsComponentFactory,ttsApipDataProvider){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,keyNavigator=keyNavigator&&Object.prototype.hasOwnProperty.call(keyNavigator,"default")?keyNavigator["default"]:keyNavigator,navigableDomElement=navigableDomElement&&Object.prototype.hasOwnProperty.call(navigableDomElement,"default")?navigableDomElement["default"]:navigableDomElement,ttsComponentFactory=ttsComponentFactory&&Object.prototype.hasOwnProperty.call(ttsComponentFactory,"default")?ttsComponentFactory["default"]:ttsComponentFactory,ttsApipDataProvider=ttsApipDataProvider&&Object.prototype.hasOwnProperty.call(ttsApipDataProvider,"default")?ttsApipDataProvider["default"]:ttsApipDataProvider;var actionPrefix="tool-".concat("apiptts","-"),plugin=pluginFactory({name:"apiptts",init:function(){var _this=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})[this.getName()]||{},createNavigationGroup=function(){var $container=testRunner.getAreaBroker().getContainer(),$navigationGroupElement=_this.button.getElement(),groupNavigationId="".concat("apiptts","_navigation_group"),$navigationElements=$container.find(ttsApipData.map(function(_ref){var selector=_ref.selector;return selector}).join(", "));_this.navigationGroup=keyNavigator({id:groupNavigationId,group:$navigationGroupElement,elements:navigableDomElement.createFromDoms($navigationElements.add($navigationGroupElement)),propagateTab:!1,loop:!0,keepState:!0}).on("tab",function(){ttsComponent.is("sfhMode")&&(_this.navigationGroup.next(),testRunner.trigger("".concat(actionPrefix,"next")))}).on("shift+tab",function(){ttsComponent.is("sfhMode")&&(_this.navigationGroup.previous(),testRunner.trigger("".concat(actionPrefix,"previous")))}).on("activate",function(){ttsComponent.is("sfhMode")&&testRunner.trigger("".concat(actionPrefix,"togglePlayback"))}).on("blur",function(){setTimeout(function(){_this.navigationGroup.isFocused()||_this.navigationGroup.focus()},0)}).setCursorAt($navigationElements.length),ttsComponent.on("next finish",function(){if(ttsComponent.is("sfhMode")){var $currentElement=_this.navigationGroup.getCursor().navigable.getElement(),_ref2=ttsComponent.getCurrentItem()||{},selector=_ref2.selector;selector&&$currentElement.is(selector)||_this.navigationGroup.next()}})},getTTSComponent=function(){if(!ttsComponent){var $container=testRunner.getAreaBroker().getContainer();ttsComponent=ttsComponentFactory($container,{}).on("close",function(){_this.getState("active")&&testRunner.trigger("".concat(actionPrefix,"toggle"))}).hide()}return ttsComponent},isConfigured=function(){return mapHelper.hasItemCategory(testRunner.getTestMap(),testRunner.getTestContext().itemIdentifier,"apiptts",!0)},togglePlugin=function(){isConfigured()?_this.show():_this.hide()},enablePlugin=function(){createNavigationGroup(),_this.button.turnOn(),_this.setState("active",!0),_this.trigger("open"),ttsComponent.is("hidden")&&ttsComponent.show()},disablePlugin=function(){_this.getState("active")&&(_this.navigationGroup.blur(),_this.navigationGroup.destroy(),_this.setState("active",!1),_this.button.turnOff(),_this.trigger("close"),ttsComponent&&!ttsComponent.is("hidden")&&(ttsComponent.close(),ttsComponent.hide()))},toggleTool=function(){_this.getState("enabled")&&(_this.getState("active")?(disablePlugin(),_this.setState("sleep",!0)):(enablePlugin(),_this.setState("sleep",!1)))},ttsComponent,ttsApipData;this.button=this.getAreaBroker().getToolbox().createEntry({className:"".concat(this.getName(),"-plugin"),control:this.getName(),icon:"headphones",text:__("Text To Speech"),title:__("Enable text to speech")}),this.button.on("click",function(e){e.preventDefault(),testRunner.trigger("".concat(actionPrefix,"toggle"))}),testRunnerOptions.allowShortcuts&&_.forEach(pluginShortcuts,function(command,key){shortcut.add(namespaceHelper.namespaceAll(command,"apiptts",!0),function(){if(!("spaceTogglePlayback"===key&&ttsComponent&&ttsComponent.is("sfhMode"))){var eventKey=key.endsWith("TogglePlayback")?"togglePlayback":key;testRunner.trigger(actionPrefix+eventKey)}},{avoidInput:!0})}),togglePlugin(),this.disable(),this.hide(),testRunner.on("loaditem",function(){togglePlugin(),_this.disable()}).on("enabletools renderitem",function(){_this.enable()}).on("disabletools unloaditem",function(){disablePlugin(),_this.disable()}).on("".concat(actionPrefix,"toggle"),function(){isConfigured()&&toggleTool()}).on("".concat(actionPrefix,"togglePlayback"),function(){if(_this.getState("enabled")&&_this.getState("active")){if(ttsComponent.is("sfhMode")){var $currentElement=_this.navigationGroup.getCursor().navigable.getElement(),_ref3=ttsComponent.getCurrentItem()||{},selector=_ref3.selector;if(!$currentElement.is(selector))return void(_this.button.getElement()[0]!==$currentElement[0]&&$currentElement.trigger("click"))}ttsComponent.togglePlayback()}}).on("renderitem",function(){if(isConfigured())return ttsApipData=ttsApipDataProvider(testRunner.itemRunner.getData().apipAccessibility||{}).map(function(apipItemData){return Object.assign({},apipItemData,{url:testRunner.itemRunner.assetManager.resolve(apipItemData.url)})}),ttsApipData.length?void(getTTSComponent().setMediaContentData(ttsApipData),_this.show(),!_this.getState("sleep")&&(_this.setState("enabled",!0),toggleTool())):(disablePlugin(),void _this.hide())})},destroy:function(){shortcut.remove(".".concat(this.getName()))},enable:function(){this.button.enable()},disable:function(){this.button.disable()},show:function(){this.button.show()},hide:function(){this.button.hide()}});return plugin}),define("taoQtiTest/runner/plugins/tools/areaMasking/mask",["lodash","handlebars","ui/dynamicComponent"],function(_,Handlebars,dynamicComponent){'use strict';function areaMaskingTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function maskingComponentFactory(){var dynamicComponentInstance;return dynamicComponentInstance=dynamicComponent({preview:function(){var self=this,delay=this.config.previewDelay||1e3;return!this.is("rendered")||this.is("disabled")||this.is("previewing")||(this.setState("previewing",!0),this.trigger("preview"),_.delay(function(){self.setState("previewing",!1)},delay)),this}},defaultConfig).on("rendercontent",function($content){var self=this,$element=this.getElement();$content.append(areaMaskingTpl({})),$element.addClass("mask-container"),$element.on("click touchstart",".view",function(e){e.preventDefault(),self.preview()}).on("click touchend",".close",function(e){e.preventDefault(),self.destroy()})}).init(),dynamicComponentInstance}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars,dynamicComponent=dynamicComponent&&Object.prototype.hasOwnProperty.call(dynamicComponent,"default")?dynamicComponent["default"]:dynamicComponent;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="
    \n
    \n
    \n \n \n
    \n
    \n",buffer}),defaultConfig={draggable:!0,resizable:!0,preserveAspectRatio:!1,width:250,minWidth:160,maxWidth:1e3,minHeight:60,height:100,stackingScope:"test-runner",top:50,left:10,previewDelay:3e3};return maskingComponentFactory}),define("taoQtiTest/runner/plugins/tools/areaMasking/areaMasking",["lodash","i18n","ui/hider","util/shortcut","util/namespace","taoTests/runner/plugin","taoQtiTest/runner/plugins/tools/areaMasking/mask","taoQtiTest/runner/helpers/map"],function(_,__,hider,shortcut,namespaceHelper,pluginFactory,maskComponent,mapHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,maskComponent=maskComponent&&Object.prototype.hasOwnProperty.call(maskComponent,"default")?maskComponent["default"]:maskComponent,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper;var actionPrefix="tool-".concat("area-masking","-"),defaultConfig={max:5,foo:!0},areaMasking=pluginFactory({name:"area-masking",init:function(){function addMask(){maskComponent().on("render",function(){self.masks.push(this),self.button.turnOn(),self.trigger("maskadd")}).on("destroy",function(){self.masks=_.without(self.masks,this),self.masks.length"),this.calculator=null,this.button.on("click",function(e){$(e.target).closest(".widget-calculator").length||(e.preventDefault(),testRunner.trigger("tool-calculator"))}),testRunnerOptions.allowShortcuts&&pluginShortcuts.toggle&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.toggle,this.getName(),!0),function(){testRunner.trigger("tool-calculator")},{avoidInput:!0,allowIn:".widget-calculator"}),togglePlugin(),this.disable(),testRunner.on("loaditem",togglePlugin).on("enabletools renderitem",function(){self.enable()}).on("disabletools unloaditem",function(){self.disable(),self.calculator&&(self.calculator.destroy(),self.calculator=null)}).on("tool-calculator",function(){isEnabled()&&toggleCalculator()})},render:function(){var areaBroker=this.getAreaBroker();areaBroker.getContainer().append(this.$calculatorContainer)},destroy:function(){shortcut.remove(".".concat(this.getName())),this.$calculatorContainer.remove(),this.calculator&&this.calculator.destroy()},enable:function(){this.button.enable()},disable:function(){this.button.disable(),this.calculator&&this.calculator.hide()},show:function(){this.button.show()},hide:function(){this.button.hide(),this.calculator&&this.calculator.hide()}});return calculator}),define("taoQtiTest/runner/plugins/tools/comment/comment",["jquery","i18n","taoTests/runner/plugin","ui/hider","ui/stacker","util/shortcut","util/namespace","handlebars"],function($$1,__,pluginFactory,hider,stackerFactory,shortcut,namespaceHelper,Handlebars){'use strict';function commentTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,stackerFactory=stackerFactory&&Object.prototype.hasOwnProperty.call(stackerFactory,"default")?stackerFactory["default"]:stackerFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,helper,options;return buffer+="
    \n \n \n \n
    \n",buffer}),comment=pluginFactory({name:"comment",init:function(){function isEnabled(){var currentItem=testRunner.getCurrentItem();if("boolean"==typeof currentItem.allowComment)return currentItem.allowComment;var testContext=testRunner.getTestContext(),contextOptions=testContext.options||{};return!!contextOptions.allowComment}function togglePlugin(){isEnabled()?self.show():self.hide()}function toggleComment(){!1!==self.getState("enabled")&&(hider.toggle(self.$form),hider.isHidden(self.$form)?self.button.turnOff():(self.$input.val("").focus(),self.button.turnOn(),stacker.bringToFront(self.$form)))}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})[this.getName()]||{},stacker=stackerFactory("test-runner");this.button=this.getAreaBroker().getToolbox().createEntry({control:"comment",title:__("Leave a comment"),icon:"tag",text:__("Comment")}),this.button.on("render",function(){self.$button=self.button.getElement(),self.$form=$$1(commentTpl()).appendTo(self.$button),self.$input=self.$button.find("[data-control=\"qti-comment-text\"]"),self.$cancel=self.$button.find("[data-control=\"qti-comment-cancel\"]"),self.$submit=self.$button.find("[data-control=\"qti-comment-send\"]"),stacker.autoBringToFront(self.$form),self.$cancel.on("click",function(){hider.hide(self.$form),self.button.turnOff()}),self.$submit.on("click",function(){var comment=self.$input.val();comment&&(self.disable(),self.button.turnOff(),testRunner.getProxy().callTestAction("comment",{comment:comment}).then(function(){hider.hide(self.$form),self.enable()}).catch(function(){hider.hide(self.$form),self.enable()}))})}),this.button.on("click",function(e){$$1(e.target).closest("[data-control=\"qti-comment\"]").length||(e.preventDefault(),testRunner.trigger("tool-comment"))}),testRunnerOptions.allowShortcuts&&pluginShortcuts.toggle&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.toggle,this.getName(),!0),function(){testRunner.trigger("tool-comment")},{avoidInput:!0}),togglePlugin(),this.disable(),testRunner.on("loaditem",togglePlugin).on("renderitem enabletools",function(){self.enable()}).on("unloaditem disabletools",function(){self.disable()}).on("tool-comment",function(){isEnabled()&&toggleComment()})},destroy:function(){shortcut.remove(".".concat(this.getName()))},enable:function(){this.button.enable()},disable:function(){this.$form&&hider.hide(this.$form),this.button.disable(),this.button.turnOff()},show:function(){this.button.show()},hide:function(){this.$form&&hider.hide(this.$form),this.button.hide()}});return comment}),define("taoQtiTest/runner/plugins/tools/documentViewer/documentViewer",["jquery","lodash","ui/hider","ui/documentViewer","ui/documentViewer/providers/pdfViewer","taoTests/runner/plugin","handlebars"],function($$1,_,hider,viewerFactory,pdfViewer,pluginFactory,Handlebars){'use strict';function panelTpl(data,options,asString){var html=Template(data,options);return asString||!0?html:$(html)}function showPanel(plugin){hider.show(plugin.controls.$panel),plugin.trigger("panelshow"),$$1(window).on("resize.".concat(plugin.getName()),_.debounce(_.partial(resizeViewer,plugin),50))}function hidePanel(plugin){hider.hide(plugin.controls.$panel),plugin.trigger("panelhide"),$$1(window).off("resize.".concat(plugin.getName()))}function hideIfVisible(plugin){var isVisible=!hider.isHidden(plugin.controls.$panel,!0);return isVisible&&hidePanel(plugin),isVisible}function initPanelEvents(plugin){function stopPropagation(e){e.stopImmediatePropagation(),e.stopPropagation()}var namespace=".".concat(plugin.getName()),stopEvents=["click","mousedown","mouseup","touchstart","touchend","keyup","keydow","keypress","scroll","drop"].join("".concat(namespace," "))+namespace,hideViewer=_.partial(hidePanel,plugin);plugin.controls.$overlay.off(namespace).on("click".concat(namespace),hideViewer).on(stopEvents,stopPropagation),plugin.controls.$panel.off(namespace).on("click".concat(namespace),".icon-close",hideViewer).on(stopEvents,stopPropagation)}function resizeViewer(plugin){var $content=plugin.controls.$content;plugin.viewer.setSize($content.width(),$content.height())}$$1=$$1&&Object.prototype.hasOwnProperty.call($$1,"default")?$$1["default"]:$$1,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,hider=hider&&Object.prototype.hasOwnProperty.call(hider,"default")?hider["default"]:hider,viewerFactory=viewerFactory&&Object.prototype.hasOwnProperty.call(viewerFactory,"default")?viewerFactory["default"]:viewerFactory,pdfViewer=pdfViewer&&Object.prototype.hasOwnProperty.call(pdfViewer,"default")?pdfViewer["default"]:pdfViewer,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,Handlebars=Handlebars&&Object.prototype.hasOwnProperty.call(Handlebars,"default")?Handlebars["default"]:Handlebars;var Template=Handlebars.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,stack1,helper;return buffer+="
    \n
    \n
    \n
    \n ",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"\n \n
    \n
    ",(helper=helpers.content)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.content,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="
    \n
    \n
    \n
    \n",buffer});viewerFactory.registerProvider("pdf",pdfViewer);var documentViewer=pluginFactory({name:"documentViewer",init:function(){function displayViewer(data){!1!==self.getState("enabled")&&(showPanel(self),self.controls.$title.text(data.label),resizeViewer(self),self.viewer.load(data.document,"pdf"))}var self=this,testRunner=this.getTestRunner(),$panel=$$1(panelTpl());this.controls={$panel:$panel,$overlay:$panel.find(".viewer-overlay"),$title:$panel.find(".viewer-title"),$content:$panel.find(".viewer-content")},this.viewer=viewerFactory({renderTo:this.controls.$content,replace:!0,fitToWidth:!0,allowSearch:!0}),testRunner.on("renderitem enabletools",function(){self.enable()}).on("renderitem",function(){self.getAreaBroker().getContentArea().append(self.controls.$panel).off(".".concat(self.getName())).on("viewDocument.".concat(self.getName()),function(event){var data=event.originalEvent.detail;displayViewer(data)}),initPanelEvents(self)}).on("move",function(){hideIfVisible(self)}).on("skip",function(){hideIfVisible(self)}).on("unloaditem disabletools",function(){self.disable()}).on("tool-documentViewer",function(data){displayViewer(data)})},render:function(){},destroy:function(){this.getAreaBroker().getContentArea().off(".".concat(this.getName())),this.viewer&&this.viewer.destroy(),this.controls.$panel&&this.controls.$panel.remove(),this.viewer=null,this.controls={}},enable:function(){},disable:function(){hideIfVisible(this)},show:function(){},hide:function(){hideIfVisible(this)}});return documentViewer}),define("taoQtiTest/runner/plugins/tools/highlighter/highlighter",["lodash","jquery","core/eventifier","ui/highlighter"],function(_,$,eventifier,highlighterFactory){'use strict';function getAllRanges(){var allRanges=[],i;for(i=0;iarr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i",{class:"resize-control"});$element.append($resizeControll)}},mask;return mask=componentFactory(maskAPI,maskConfig),makeResizable(mask),makeStackable(mask,stackingOptions),mask.on("render",function(){var $element=this.getElement();this.styleResizableEdges(),this.config.resizeControll&&this.addResizeControll(),$element.addClass("line-reader-mask ".concat(maskConfig.id)).on("mousedown touchstart",function(){bringAllToFront()})}).on("resizestart",function(){innerDrag.hide(),closer.hide(),invokeOnOverlays("hide"),invokeOnMasks("setState",["resizing",!0]),this.setState("resizer",!0)}).on("beforeresize",maskConfig.beforeResize||_.noop).on("resize",maskConfig.onResize||_.noop).on("resizeend",function(){applyTransformsToOverlays(),applyTransformsToInnerDrag(),applyTransformsToCloser(),invokeOnMasks("setState",["resizing",!1]),invokeOnOverlays("show"),innerDrag.show(),closer.show(),this.setState("resizer",!1)}).init()}function createOverlay(overlayConfig){var overlay;return overlay=componentFactory({transformOverlay:function(){var $element=this.getElement();this._sizeBackup=this.getSize(),this._posBackup=this.getPosition(),this.setSize(dimensions.outerWidth,dimensions.outerHeight).moveTo(position.outerX,position.outerY),$element.addClass("moving"),this.setState("transformed",!0)},restoreOverlay:function(){var $element=this.getElement();this.is("transformed")&&(this.setSize(this._sizeBackup.width,this._sizeBackup.height).moveTo(this._posBackup.x,this._posBackup.y),$element.removeClass("moving"),this._sizeBackup=null,this._posBackup=null,this.setState("transformed",!1))},appendVisualGuides:function(){var $element=this.getElement();$element.append(visualGuides.$maskBg),$element.append(visualGuides.$innerWindow),visualGuides.$maskBg.css({width:dimensions.outerWidth-2,height:dimensions.outerHeight-2,"border-top-width":dimensions.topHeight-2,"border-right-width":dimensions.rightWidth-2,"border-bottom-width":dimensions.bottomHeight-2,"border-left-width":dimensions.leftWidth-2}),visualGuides.$innerWindow.css({width:dimensions.innerWidth,height:dimensions.innerHeight,left:dimensions.leftWidth-2,top:dimensions.topHeight-2})},removeVisualGuides:function(){visualGuides.$maskBg.remove(),visualGuides.$innerWindow.remove()}},overlayConfig),makeDraggable(overlay),makeStackable(overlay,stackingOptions),overlay.on("render",function(){var self=this,$element=this.getElement(),pointerEventsPrefix=window.PointerEvent?"pointer":"mouse",$moveIcon=$("
    ",{class:"icon icon-mobile-menu"});$element.addClass("line-reader-overlay ".concat(overlayConfig.id)).on("".concat(pointerEventsPrefix,"down")+" touchstart",function(){bringAllToFront(),self.transformOverlay()}).on("".concat(pointerEventsPrefix,"up")+" touchend",function(){self.restoreOverlay()}).prepend($moveIcon)}).on("dragstart",function(){innerDrag.hide(),closer.hide(),invokeOnMasks("hide"),this.appendVisualGuides()}).on("dragmove",function(xOffsetRelative,yOffsetRelative){position.outerX+=xOffsetRelative,position.outerY+=yOffsetRelative,position.innerX+=xOffsetRelative,position.innerY+=yOffsetRelative}).on("dragend",function(){this.removeVisualGuides(),invokeOnAll("show"),innerDrag.show(),closer.show(),applyTransforms()}).init()}function createInnerDragHandle(){innerDrag=componentFactory(),makeStackable(innerDrag,stackingOptions),makeDraggable(innerDrag,{dragRestriction:function(){var fixedXY=allParts.nw.mask.getElement().offset(),rect;return rect={x:fixedXY.left+constrains.minWidth,y:fixedXY.top+(constrains.minTopHeight+dimensions.innerHeight+options.resizeHandleSize),width:dimensions.outerWidth-2*constrains.minWidth,height:dimensions.outerHeight-(dimensions.innerHeight+constrains.minTopHeight+constrains.minBottomHeight-options.innerDragHeight)},rect}}).on("render",function(){var $element=this.getElement(),$dragIcon=$("
    ",{class:"icon icon-move"});$element.css("touch-action","none"),$element.addClass("line-reader-inner-drag"),$element.css({background:"none"}),$element.append($dragIcon)}).on("dragstart",function(){closer.hide(),bringAllToFront(),invokeOnMasks("setState",["resizing",!0])}).on("dragmove",function(xOffsetRelative,yOffsetRelative){position.innerX+=xOffsetRelative,position.innerY+=yOffsetRelative,dimensions.leftWidth+=xOffsetRelative,dimensions.topHeight+=yOffsetRelative,dimensions.rightWidth-=xOffsetRelative,dimensions.bottomHeight-=yOffsetRelative,applyTransformsToMasks()}).on("dragend",function(){innerDrag.bringToFront(),closer.show(),invokeOnMasks("setState",["resizing",!1]),applyTransformsToOverlays()}).init()}function createCloser(){closer=componentFactory(),makeStackable(closer,stackingOptions),makePlaceable(closer).on("render",function(){var self=this,$element=this.getElement(),$closeIcon=$("
    ",{class:"icon icon-result-nok"});$element.append($closeIcon),$element.addClass("line-reader-closer"),$element.on("mousedown touchstart",function(){bringAllToFront()}),$element.on("click",function(e){e.stopPropagation(),self.trigger("click")})}).init()}function bringAllToFront(){invokeOnAll("bringToFront"),innerDrag.bringToFront(),closer.bringToFront()}function invokeOnAll(fn,args){invokeOnMasks(fn,args),invokeOnOverlays(fn,args)}function invokeOnMasks(fn,args){invokeOn("mask",fn,args)}function invokeOnOverlays(fn,args){invokeOn("overlay",fn,args)}function invokeOn(target,fn,args){_.forOwn(allParts,function(part){if(_.isObject(part[target])&&_.isFunction(part[target][fn])){var _part$target;(_part$target=part[target])[fn].apply(_part$target,_toConsumableArray(args||[]))}})}function applyTransforms(){applyTransformsToMasks(),applyTransformsToOverlays(),applyTransformsToInnerDrag(),applyTransformsToCloser()}function applyTransformsToMasks(){invokeOnMasks("place")}function applyTransformsToOverlays(){_.forOwn(allParts,function(part){part.overlay&&part.mask.placeOverlay(part.overlay)})}function applyTransformsToInnerDrag(){innerDrag&&innerDrag.setSize(dimensions.innerWidth-20,options.innerDragHeight).moveTo(position.innerX+10,position.innerY+dimensions.innerHeight+options.resizeHandleSize)}function applyTransformsToCloser(){closer&&closer.setSize(constrains.minWidth-options.resizeHandleSize,constrains.minHeight-options.resizeHandleSize).moveTo(position.outerX+dimensions.outerWidth-constrains.minWidth-5,position.outerY+options.resizeHandleSize-4)}function correctTransforms(){dimensions.topHeight",{class:"mask-bg"}),visualGuides.$innerWindow=$("
    ",{class:"inner-window"})}var allParts={},visualGuides={},setInnerHeight=function(newHeight){dimensions.innerHeight=newHeight,dimensions.bottomHeight=dimensions.outerHeight-dimensions.innerHeight-dimensions.topHeight},compoundMask,innerDrag,closer;return dimensions=_.defaults(dimensions||{},defaultDimensions),position=_.defaults(position||{},defaultPosition),options=_.defaults(options||{},defaultOptions),constrains={minWidth:2*options.resizeHandleSize+options.dragMinWidth,minHeight:2*options.resizeHandleSize+options.dragMinHeight,minBottomHeight:2*options.resizeHandleSize+options.innerDragHeight,minTopHeight:2*options.resizeHandleSize+18},compoundMask={init:function(){var self=this;return this.setTransforms(dimensions,position),createCompoundMask(),createVisualGuides(),createInnerDragHandle(),createCloser(),closer.on("click",function(){self.hide(),self.trigger("close")}),this},render:function($container){return invokeOnAll("render",[$container]),innerDrag.render($container),closer.render($container),applyTransforms(),this},destroy:function(){return invokeOnAll("destroy"),visualGuides=null,innerDrag=null,closer=null,this},show:function(){return invokeOnAll("show"),innerDrag.show(),closer.show(),this.setState("hidden",!1),this},hide:function(){return invokeOnAll("hide"),innerDrag.hide(),closer.hide(),this.setState("hidden",!0),this},setTransforms:function(dim,pos){dimensions=_.defaults(dim||{},dimensions),position=_.defaults(pos||{},position),dimensions.topHeight=pos.innerY-pos.outerY,dimensions.rightWidth=dim.outerWidth-(pos.innerX-pos.outerX)-dim.innerWidth,dimensions.bottomHeight=dim.outerHeight-(pos.innerY-pos.outerY)-dim.innerHeight,dimensions.leftWidth=pos.innerX-pos.outerX,correctTransforms(),applyTransforms()},getDimensions:function(){return dimensions},getPosition:function(){return position},getParts:function(){return allParts}},statifier(compoundMask),eventifier(compoundMask),compoundMask}$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,statifier=statifier&&Object.prototype.hasOwnProperty.call(statifier,"default")?statifier["default"]:statifier,eventifier=eventifier&&Object.prototype.hasOwnProperty.call(eventifier,"default")?eventifier["default"]:eventifier,componentFactory=componentFactory&&Object.prototype.hasOwnProperty.call(componentFactory,"default")?componentFactory["default"]:componentFactory,makePlaceable=makePlaceable&&Object.prototype.hasOwnProperty.call(makePlaceable,"default")?makePlaceable["default"]:makePlaceable,makeDraggable=makeDraggable&&Object.prototype.hasOwnProperty.call(makeDraggable,"default")?makeDraggable["default"]:makeDraggable,makeResizable=makeResizable&&Object.prototype.hasOwnProperty.call(makeResizable,"default")?makeResizable["default"]:makeResizable,makeStackable=makeStackable&&Object.prototype.hasOwnProperty.call(makeStackable,"default")?makeStackable["default"]:makeStackable;var defaultDimensions={outerWidth:600,outerHeight:400,innerWidth:500,innerHeight:20},defaultPosition={outerX:0,outerY:0,innerX:50,innerY:50},defaultOptions={dragMinWidth:10,dragMinHeight:10,resizeHandleSize:10,innerDragHeight:20},stackingOptions={stackingScope:"test-runner"},constrains;return compoundMaskFactory}),define("taoQtiTest/runner/plugins/tools/lineReader/plugin",["lodash","i18n","taoTests/runner/plugin","ui/hider","util/shortcut","util/namespace","taoQtiTest/runner/helpers/map","taoQtiTest/runner/plugins/tools/lineReader/compoundMask"],function(_,__,pluginFactory,hider,shortcut,namespaceHelper,mapHelper,compoundMaskFactory){'use strict';function getDimensions($container){var $qtiContent=$container.find("#qti-content"),$qtiItem=$qtiContent.find(".qti-item"),lineHeight=Math.ceil(parseFloat($qtiContent.css("line-height")))||20;return{outerWidth:$qtiItem.width()+4*maskOptions.resizeHandleSize+2*maskOptions.dragMinWidth,outerHeight:175,innerWidth:$qtiItem.width(),innerHeight:lineHeight}}function getPosition($container){var $qtiContent=$container.find("#qti-content"),$qtiItem=$qtiContent.find(".qti-item"),itemPosition=$qtiItem.position()||{},paddingLeft=parseInt($qtiItem.css("padding-left"),10),paddingTop=parseInt($qtiItem.css("padding-top"),10),innerX=parseInt(itemPosition.left,10)+paddingLeft-3,innerY=parseInt(itemPosition.top,10)+paddingTop-3;return{outerX:innerX-2*maskOptions.resizeHandleSize-maskOptions.dragMinWidth,outerY:0,innerX:innerX,innerY:innerY}}function containerWidthHasChanged($container){var newDimensions=getDimensions($container);return newDimensions.outerWidth!==dimensions.outerWidth}_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper,compoundMaskFactory=compoundMaskFactory&&Object.prototype.hasOwnProperty.call(compoundMaskFactory,"default")?compoundMaskFactory["default"]:compoundMaskFactory;var actionPrefix="tool-".concat("line-reader","-"),maskOptions={dragMinWidth:17,dragMinHeight:7,resizeHandleSize:7,innerDragHeight:20},plugin=pluginFactory({name:"line-reader",init:function(){function isEnabled(){return mapHelper.hasItemCategory(testRunner.getTestMap(),testRunner.getTestContext().itemIdentifier,"lineReader",!0)}function toggleMask(){self.compoundMask.getState("hidden")?(containerWidthHasChanged($container)&&transformMask($container),openMask()):closeMask()}function openMask(){self.compoundMask.show(),self.trigger("start"),self.button.turnOn()}function closeMask(){self.compoundMask.getState("hidden")||self.compoundMask.hide(),self.trigger("end"),self.button.turnOff()}function transformMask($maskContainer){dimensions=getDimensions($maskContainer),position=getPosition($maskContainer),self.compoundMask.setTransforms(_.clone(dimensions),_.clone(position))}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})["line-reader"]||{},$container=testRunner.getAreaBroker().getContentArea().parent();this.compoundMask=compoundMaskFactory(maskOptions).init().render($container).on("close",function(){closeMask()}).hide(),this.button=this.getAreaBroker().getToolbox().createEntry({title:__("Line Reader"),icon:"insert-horizontal-line",control:"line-reader",text:__("Line Reader")}),this.button.on("click",function(e){e.preventDefault(),testRunner.trigger("".concat(actionPrefix,"toggle"))}),testRunnerOptions.allowShortcuts&&pluginShortcuts.toggle&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.toggle,this.getName(),!0),function(){testRunner.trigger("".concat(actionPrefix,"toggle"))},{avoidInput:!0,prevent:!0}),this.disable(),testRunner.on("loaditem",function(){isEnabled()?self.show():self.hide()}).on("renderitem",function(){transformMask($container)}).on("enabletools renderitem",function(){self.enable()}).on("disabletools unloaditem",function(){self.disable(),closeMask()}).on("".concat(actionPrefix,"toggle"),function(){isEnabled()&&toggleMask()})},destroy:function(){this.compoundMask.destroy(),shortcut.remove(".".concat(this.getName()))},enable:function(){this.button.enable()},disable:function(){this.button.disable()},show:function(){this.button.show()},hide:function(){this.button.hide()}}),dimensions,position;return plugin}),define("taoQtiTest/runner/plugins/tools/magnifier/magnifierPanel",["jquery","lodash","ui/component","handlebars","ui/dynamicComponent"],function($$1,_,component,Handlebars,dynamicComponent){'use strict';var _Mathmin=Math.min,_Mathmax2=Math.max;function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,stack1,helper,options;return buffer+="
    \n
    ",(helper=helpers.level)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.level,stack1="function"===_typeof2(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"
    \n
    \n
    \n
    \n \n \n \n
    \n
    \n",buffer}),screenRatio=window.screen.width/window.screen.height,defaultBaseSize=116,defaultLevelMin=2,defaultLevel=defaultLevelMin,defaultConfig={level:defaultLevel,levelMin:defaultLevelMin,levelMax:8,levelStep:.5,baseSize:defaultBaseSize,maxRatio:.5},dynamicComponentDefaultConfig={draggable:!0,resizable:!0,preserveAspectRatio:!1,width:defaultBaseSize*defaultLevel,height:defaultBaseSize*defaultLevel/screenRatio,minWidth:defaultBaseSize*defaultLevelMin,minHeight:defaultBaseSize*defaultLevelMin/screenRatio,stackingScope:"test-runner",top:50,left:10};return magnifierPanelFactory}),define("taoQtiTest/runner/plugins/tools/magnifier/magnifier",["lodash","i18n","taoTests/runner/plugin","ui/hider","util/shortcut","util/namespace","taoQtiTest/runner/plugins/tools/magnifier/magnifierPanel","taoQtiTest/runner/helpers/map"],function(_,__,pluginFactory,hider,shortcut,namespaceHelper,magnifierPanelFactory,mapHelper){'use strict';_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_["default"]:_,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,magnifierPanelFactory=magnifierPanelFactory&&Object.prototype.hasOwnProperty.call(magnifierPanelFactory,"default")?magnifierPanelFactory["default"]:magnifierPanelFactory,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper;var actionPrefix="tool-".concat("magnifier","-"),defaultOptions={zoomMin:2,zoomMax:8,zoomStep:.5},magnifier=pluginFactory({name:"magnifier",init:function(){function getMagnifierPanel(){var $container;return magnifierPanel||($container=testRunner.getAreaBroker().getContainer(),magnifierPanel=magnifierPanelFactory({levelMin:pluginConfig.zoomMin,levelMax:pluginConfig.zoomMax,levelStep:pluginConfig.zoomStep,component:{renderTo:$container.parent(),draggableContainer:$container.parent()}}).on("show",function(){self.trigger("magnifier-show")}).on("hide",function(){self.trigger("magnifier-hide")}).on("zoom",function(level){self.trigger("magnifier-zoom",level)}).on("close",function(){hideMagnifier()}).setTarget($container),self.trigger("magnifier-create")),magnifierPanel}function isEnabled(){return mapHelper.hasItemCategory(testRunner.getTestMap(),testRunner.getTestContext().itemIdentifier,"magnifier",!0)}function togglePlugin(){isEnabled()?self.show():self.hide()}function toggleMagnifier(){self.getState("enabled")&&(self.getState("active")?hideMagnifier():showMagnifier())}function showMagnifier(){getMagnifierPanel(),magnifierPanel.is("hidden")&&magnifierPanel.show(),self.button.turnOn(),testRunner.trigger("plugin-open.".concat("magnifier")),self.setState("active",!0)}function hideMagnifier(){self.setState("active",!1),self.button.turnOff(),testRunner.trigger("plugin-close.".concat("magnifier")),magnifierPanel&&!magnifierPanel.is("hidden")&&magnifierPanel.hide()}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginConfig=Object.assign({},defaultOptions,this.getConfig()),pluginShortcuts=(testRunnerOptions.shortcuts||{}).magnifier||{},magnifierPanel=null;this.button=this.getAreaBroker().getToolbox().createEntry({control:"magnify",title:__("Displays a customisable magnifier"),text:__("Magnifying Glass"),icon:"find"}),this.button.on("click",function(event){event.preventDefault(),testRunner.trigger("".concat(actionPrefix,"toggle"))}),testRunnerOptions.allowShortcuts&&_.forEach(pluginShortcuts,function(command,key){shortcut.add(namespaceHelper.namespaceAll(command,"magnifier",!0),function(){testRunner.trigger(actionPrefix+key)},{avoidInput:!0})}),togglePlugin(),this.disable(),testRunner.on("loaditem",function(){togglePlugin(),self.disable()}).on("renderitem",function(){magnifierPanel&&magnifierPanel.update().zoomTo(pluginConfig.zoomMin)}).on("enabletools renderitem",function(){self.enable()}).on("disabletools unloaditem",function(){self.getState("active")&&hideMagnifier(),self.disable()}).on("destroy",function(){magnifierPanel&&magnifierPanel.destroy(),magnifierPanel=null}).on("".concat(actionPrefix,"toggle"),function(){isEnabled()&&toggleMagnifier()}).on("".concat(actionPrefix,"in"),function(){isEnabled()&&self.getState("enabled")&&self.getState("active")&&getMagnifierPanel().zoomIn()}).on("".concat(actionPrefix,"out"),function(){isEnabled()&&self.getState("enabled")&&self.getState("active")&&getMagnifierPanel().zoomOut()}).on("".concat(actionPrefix,"close"),function(){self.getState("active")&&hideMagnifier()})},destroy:function(){shortcut.remove(".".concat("magnifier"))},enable:function(){this.button.enable()},disable:function(){this.button.disable()},show:function(){this.button.show()},hide:function(){this.button.hide()}});return magnifier}),define("taoQtiTest/runner/plugins/tools/zoom",["jquery","i18n","ui/hider","ui/transformer","util/shortcut","util/namespace","taoTests/runner/plugin","taoQtiTest/runner/helpers/map"],function($,__,hider,transformer,shortcut,namespaceHelper,pluginFactory,mapHelper){'use strict';var _Mathmax3=Math.max;$=$&&Object.prototype.hasOwnProperty.call($,"default")?$["default"]:$,__=__&&Object.prototype.hasOwnProperty.call(__,"default")?__["default"]:__,transformer=transformer&&Object.prototype.hasOwnProperty.call(transformer,"default")?transformer["default"]:transformer,shortcut=shortcut&&Object.prototype.hasOwnProperty.call(shortcut,"default")?shortcut["default"]:shortcut,namespaceHelper=namespaceHelper&&Object.prototype.hasOwnProperty.call(namespaceHelper,"default")?namespaceHelper["default"]:namespaceHelper,pluginFactory=pluginFactory&&Object.prototype.hasOwnProperty.call(pluginFactory,"default")?pluginFactory["default"]:pluginFactory,mapHelper=mapHelper&&Object.prototype.hasOwnProperty.call(mapHelper,"default")?mapHelper["default"]:mapHelper;var threshold={lower:10,upper:200},_setZoomLevel=function($target,level){var $parent=$target.parent(),newScale=level/100,isOverZoom=$parent.outerWidth(!0)<$target.width()*newScale;isOverZoom?(transformer.setTransformOrigin($target,"0 0"),$parent.css("margin-left","0")):(transformer.setTransformOrigin($target,"50% 0"),$parent.css("margin-left","")),transformer.scale($target,newScale)},_resetZoom=function($target){transformer.reset($target)},forceRepaint=function($target){var sel=$target[0];sel&&(sel.style.display="none",sel.offsetHeight,sel.style.display="")},zoom=pluginFactory({name:"zoom",init:function(){function isConfigured(){return mapHelper.hasItemCategory(testRunner.getTestMap(),testRunner.getTestContext().itemIdentifier,"zoom",!0)}function togglePlugin(){isConfigured()?self.show():self.hide()}function zoomAction(dir){var el,sx,sy,before,after;self.$zoomTarget&&(el=self.$zoomTarget[0],before=el.getBoundingClientRect(),sx=self.$container.scrollLeft(),sy=self.$container.scrollTop(),self.zoom=_Mathmax3(threshold.lower,Math.min(threshold.upper,self.zoom+10*dir)),self.zoom===100?_resetZoom(self.$zoomTarget):_setZoomLevel(self.$zoomTarget,self.zoom),forceRepaint(self.$zoomTarget),after=el.getBoundingClientRect(),sx=_Mathmax3(0,sx+(after.width-before.width)/2),sy=_Mathmax3(0,sy+(after.height-before.height)/2),self.$container.scrollLeft(sx).scrollTop(sy))}var self=this,testRunner=this.getTestRunner(),testRunnerOptions=testRunner.getOptions(),pluginShortcuts=(testRunnerOptions.shortcuts||{})[this.getName()]||{};this.buttonZoomOut=this.getAreaBroker().getToolbox().createEntry({control:"zoomOut",title:__("Zoom out"),icon:"remove"}),this.buttonZoomIn=this.getAreaBroker().getToolbox().createEntry({control:"zoomIn",title:__("Zoom in"),icon:"add"}),this.buttonZoomIn.on("click",function(e){e.preventDefault(),testRunner.trigger("tool-zoomin")}),this.buttonZoomOut.on("click",function(e){e.preventDefault(),testRunner.trigger("tool-zoomout")}),testRunnerOptions.allowShortcuts&&(pluginShortcuts.in&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.in,this.getName(),!0),function(){testRunner.trigger("tool-zoomin")},{avoidInput:!0}),pluginShortcuts.out&&shortcut.add(namespaceHelper.namespaceAll(pluginShortcuts.out,this.getName(),!0),function(){testRunner.trigger("tool-zoomout")},{avoidInput:!0})),togglePlugin(),this.disable(),testRunner.on("loaditem",function(){self.zoom=100,togglePlugin(),self.disable()}).on("renderitem",function(){self.$container=$("#qti-content"),self.$zoomTarget=$(".qti-item"),self.enable()}).on("enabletools",function(){self.enable()}).on("disabletools unloaditem",function(){self.disable()}).on("tool-zoomin",function(){!1!==self.getState("enabled")&&zoomAction(1)}).on("tool-zoomout",function(){!1!==self.getState("enabled")&&zoomAction(-1)})},destroy:function(){shortcut.remove(".".concat(this.getName()))},enable:function(){this.buttonZoomIn.enable(),this.buttonZoomOut.enable()},disable:function(){this.buttonZoomIn.disable(),this.buttonZoomOut.disable()},show:function(){this.buttonZoomIn.show(),this.buttonZoomOut.show()},hide:function(){this.buttonZoomIn.hide(),this.buttonZoomOut.hide()}});return zoom}),function(c){var d=document,s=d.createElement("style");s.type="text/css",d.getElementsByTagName("head")[0].appendChild(s),s.styleSheet?s.styleSheet.cssText=c:s.appendChild(d.createTextNode(c))}("/*\nUsage:\n- linear-gradient((color1, color2, color3)) - returns linear-gradient with evenly distributed colors,\n if 3 colors used then the position of each will be 33,33%\n- linear-gradient((color1 0%, color2 30%, color3 80%)) - returns linear-gradient with manually distributed colors,\n first param - color, second - position. Also you can use px or other valid units for set position.\n*/\n/* Do not edit */\n.test-runner-scope .content-wrapper p.key-navigation-group, .test-runner-scope .content-wrapper div.key-navigation-group:not(.select2-container) {\n padding: 5px !important;\n}\n\n.test-runner-scope .content-wrapper .key-navigation-group:not(.qti-extendedTextInteraction):not(.qti-textEntryInteraction):not(.qti-customInteraction) {\n border-width: 1px !important;\n border-style: solid;\n border-color: transparent;\n}\n\n.test-runner-scope .content-wrapper .key-navigation-group:not(.qti-extendedTextInteraction):not(.qti-textEntryInteraction):not(.qti-customInteraction).focusin {\n border-color: #0e5d91 !important;\n outline: none;\n}\n\n.test-runner-scope .content-wrapper .key-navigation-group:not(.qti-extendedTextInteraction):not(.qti-textEntryInteraction):not(.qti-customInteraction).qti-interaction .qti-choice.key-navigation-highlight:not(.tts-content-node) {\n background: #e7eff4 !important;\n}\n\n.test-runner-scope .content-wrapper span.key-navigation-group {\n border: none !important;\n}\n\n.test-runner-scope .content-wrapper span.key-navigation-group.focusin {\n outline: solid #0e5d91 1px !important;\n outline-offset: 1px;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group.focusin {\n background: #e7eff4;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group .qti-navigator-filters .key-navigation-highlight .qti-navigator-tab {\n border-width: 2px;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group .qti-navigator-filters .key-navigation-highlight:focus {\n outline: none;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group .qti-navigator-filters .key-navigation-highlight:focus .qti-navigator-tab {\n border-top-color: #222 !important;\n border-left-color: #222 !important;\n border-right-color: #222 !important;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group li.qti-navigator-item.key-navigation-highlight {\n padding-left: 8px;\n border-left: solid 2px #222;\n}\n\n.test-runner-scope .test-sidebar .key-navigation-group li.qti-navigator-item.key-navigation-highlight .key-navigation-highlight:focus {\n outline: none;\n}\n\n.test-runner-scope .bottom-action-bar.content-action-bar.key-navigation-group.focusin {\n -ms-box-shadow: 0 0 6px 2px #3e7da7;\n -o-box-shadow: 0 0 6px 2px #3e7da7;\n box-shadow: 0 0 6px 2px #3e7da7;\n}\n\n.test-runner-scope .bottom-action-bar.content-action-bar.key-navigation-group .key-navigation-highlight:focus {\n margin-bottom: 0;\n border-bottom-color: #e7eff4 !important;\n outline: none;\n}\n\n.test-runner-scope .bottom-action-bar.content-action-bar.key-navigation-group .key-navigation-highlight:focus.active {\n border-bottom-color: transparent !important;\n background: #e7eff4 !important;\n}\n\n.test-runner-scope .bottom-action-bar.content-action-bar.key-navigation-group .key-navigation-highlight:focus:not(.active):not(:active) .li-inner {\n color: #e7eff4;\n}\n\nheader .settings-menu .key-navigation-group {\n padding-right: 5px;\n}\n\nheader .settings-menu .key-navigation-group.focusin {\n background-color: rgba(14, 93, 145, 0.5);\n padding-bottom: 10px;\n}\n\nheader .settings-menu .key-navigation-highlight:focus {\n height: 54px;\n color: white !important;\n border-bottom: solid 2px white !important;\n}\n\n/*# sourceMappingURL=../../../taoQtiTest/views/node_modules/@oat-sa/tao-test-runner-qti/dist/plugins/content/accessibility/css/key-navigation.css.map *//*\nUsage:\n- linear-gradient((color1, color2, color3)) - returns linear-gradient with evenly distributed colors,\n if 3 colors used then the position of each will be 33,33%\n- linear-gradient((color1 0%, color2 30%, color3 80%)) - returns linear-gradient with manually distributed colors,\n first param - color, second - position. Also you can use px or other valid units for set position.\n*/\n/* Do not edit */\n.countdown {\n opacity: 0;\n position: relative;\n display: inline-block;\n overflow: hidden;\n text-align: center;\n vertical-align: top;\n line-height: 1.2;\n padding: 0 20px;\n margin-top: -1px;\n height: 100%;\n}\n\n.countdown.rendered {\n opacity: 1;\n transition: opacity, 300ms, linear, 0s;\n}\n\n.countdown .label {\n max-width: 130px;\n display: block;\n font-size: 12px;\n font-size: 1.2rem;\n}\n\n/*# sourceMappingURL=../../../taoQtiTest/views/node_modules/@oat-sa/tao-test-runner-qti/dist/plugins/controls/timer/component/css/countdown.css.map *//*\nUsage:\n- linear-gradient((color1, color2, color3)) - returns linear-gradient with evenly distributed colors,\n if 3 colors used then the position of each will be 33,33%\n- linear-gradient((color1 0%, color2 30%, color3 80%)) - returns linear-gradient with manually distributed colors,\n first param - color, second - position. Also you can use px or other valid units for set position.\n*/\n/* Do not edit */\n.timer-box {\n opacity: 0;\n padding-top: 0;\n white-space: nowrap;\n /*flex item of control-box */\n flex: 1 0 auto;\n /* is also a flex container for .qti-timer */\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n}\n\n.timer-box.rendered {\n opacity: 1;\n transition: opacity, 300ms, linear, 0s;\n}\n\n.timer-box .timer-toggler {\n text-decoration: none;\n color: white;\n line-height: 1.3;\n opacity: .68;\n padding: 8px 20px;\n position: relative;\n top: -1px;\n left: 20px;\n z-index: 2;\n transition: opacity, 0.5s, ease-out, 0s;\n}\n\n.timer-box .timer-toggler:hover, .timer-box .timer-toggler:active, .timer-box .timer-toggler:focus {\n outline: unset;\n}\n\n.timer-box .timer-toggler:active, .timer-box .timer-toggler:focus {\n border: 2px solid white;\n}\n\n.timer-box .timer-toggler:hover {\n opacity: .93;\n transition: opacity, 0.5s, ease-out, 0s;\n}\n\n.timer-box.zen .timer-toggler {\n opacity: .93;\n transition: opacity, 0.5s, ease-out, 0s;\n}\n\n.timer-box.zen .countdown .time {\n opacity: 0;\n transition: opacity, 1s, ease-out, 0s;\n}\n\n.timer-box .countdown::before {\n content: ' ';\n background: rgba(255, 255, 255, 0.3);\n width: 1px;\n height: 20px;\n position: absolute;\n left: 0;\n top: 5px;\n}\n\n.timer-box .countdown:first-child::before {\n content: none;\n}\n\n.timer-box .countdown[data-scope=test][data-type=min] {\n order: 5;\n}\n\n.timer-box .countdown[data-scope=test] {\n order: 10;\n}\n\n.timer-box .countdown[data-scope=testPart][data-type=min] {\n order: 15;\n}\n\n.timer-box .countdown[data-scope=testPart] {\n order: 20;\n}\n\n.timer-box .countdown[data-scope=section][data-type=min] {\n order: 25;\n}\n\n.timer-box .countdown[data-scope=section] {\n order: 30;\n}\n\n.timer-box .countdown[data-scope=item][data-type=min] {\n order: 35;\n}\n\n.timer-box .countdown[data-scope=item] {\n order: 40;\n}\n\n/*# sourceMappingURL=../../../taoQtiTest/views/node_modules/@oat-sa/tao-test-runner-qti/dist/plugins/controls/timer/component/css/timerbox.css.map */"),define("taoQtiTest/loader/testPlugins.bundle",function(){}); //# sourceMappingURL=testPlugins.min.js.map