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)}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}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 _iterableToArray(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}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||{},"
"})}),define("taoQtiTestPreviewer/previewer/runner",["taoTests/runner/runnerComponent","tpl!taoQtiTestPreviewer/previewer/runner"],function(runnerComponentFactory,runnerTpl){'use strict';return function(container){var config=1= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;return buffer+="
\n\t
\n\t\t
\n\t\t\n\t
\n\t
\n
",buffer})}),define("tpl!taoQtiTestPreviewer/previewer/component/topBlock/tpl/topBlockData",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,buffer="",escapeExpression=this.escapeExpression;return buffer+="

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

",buffer})}),define("css!taoQtiTestPreviewer/previewer/component/topBlock/css/topBlock",[],function(){}),define("taoQtiTestPreviewer/previewer/component/topBlock/topBlock",["jquery","lodash","i18n","ui/component","tpl!taoQtiTestPreviewer/previewer/component/topBlock/tpl/topBlock","tpl!taoQtiTestPreviewer/previewer/component/topBlock/tpl/topBlockData","css!taoQtiTestPreviewer/previewer/component/topBlock/css/topBlock"],function($,_,__,componentFactory,topBlockTpl,topBlockDataTpl){'use strict';return function(container,config){var topBlock=componentFactory().setTemplate(topBlockTpl).on("init",function(){this.render(container)}).on("render",function(){var $info=$(topBlockDataTpl({name:config.isTest?__("Test Preview:"):__("Item Preview:"),title:config.title})),$element=this.getElement();$element.find(".top-block-preview-info").append($info),$element.find(".close").on("click",config.onClose);var $icon=$element.find(".top-block-preview-collapser .icon");$element.find(".top-block-preview-collapser").on("click",function(){$icon.toggleClass("icon-up"),$icon.toggleClass("icon-down"),$element.toggleClass("open"),$element.toggleClass("close")}),this.trigger("ready")});return _.defer(function(){topBlock.init(config)}),topBlock}}),define("taoQtiTestPreviewer/previewer/config/item",["lodash","util/url","util/config"],function(_,urlUtil,configHelper){'use strict';var _defaults={bootstrap:{serviceController:"Previewer",serviceExtension:"taoQtiTestPreviewer"}},_entries={serviceCallId:!0,bootstrap:!1,timeout:!1};return function(config){var undef,storage=configHelper.from(config,_entries,_defaults);return storage.timeout?storage.timeout*=1e3:storage.timeout=undef,{getParameters:function(itemIdentifier){var type=_typeof(itemIdentifier),parameters={serviceCallId:this.getServiceCallId()};if("string"===type)parameters.itemUri=itemIdentifier;else if("object"===type&&_.isPlainObject(itemIdentifier))_.merge(parameters,itemIdentifier);else if("undefined"!==type)throw new TypeError("Wrong parameter type provided for itemIdentifier: "+type+". Only string or plain object are allowed!");return parameters},getServiceCallId:function(){return storage.serviceCallId},getServiceController:function(){return storage.bootstrap.serviceController||_defaults.bootstrap.serviceController},getServiceExtension:function(){return storage.bootstrap.serviceExtension||_defaults.bootstrap.serviceExtension},getTestActionUrl:function(action){return urlUtil.route(action,this.getServiceController(),this.getServiceExtension(),this.getParameters())},getItemActionUrl:function(itemIdentifier,action){return urlUtil.route(action,this.getServiceController(),this.getServiceExtension(),this.getParameters(itemIdentifier))},getTimeout:function(){return storage.timeout}}}}),define("json!taoQtiTestPreviewer/previewer/resources/devices.json",function(){return{tablets:{"193986c3715c81838870f908fa98d69a":{label:"Amazon Kindle Fire HDX 7\u2033",width:960,height:600},"4e8eafab11aad1486992d7ee2c8c16ca":{label:"Apple iPad",width:1024,height:768},"5aac2932d9ad00d6d8a1604b8f9e4e8d":{label:"Google Nexus 10, Motorola Xoom, Xyboard",width:1280,height:800},"9805d9753ad08c7630a9ee5418aa6c6c":{label:"Google Nexus 7",width:966,height:604},d4a431cedf4705d6bf2cba6d5788378b:{label:"Samsung Galaxy Tab 7.7, 8.9, 10.1",width:1280,height:800}},phones:{"1b89338531ef0155c8d6abc2ac02c81a":{label:"Apple iPhone 3GS",width:320,height:480,scaleFactor:1,dpWidth:320,dpHeight:480},"3f89da99d84214cde7df87ebe0699a6f":{label:"Apple iPhone 4",width:640,height:960,scaleFactor:2,dpWidth:320,dpHeight:1920},"0d36971a5b98b367f54ced708c9af849":{label:"Apple iPhone 5",width:640,height:1136,scaleFactor:2,dpWidth:320,dpHeight:2272},"026beffcc051af995660ebdede986ace":{label:"BlackBerry Z10",width:768,height:1280,scaleFactor:2,dpWidth:384,dpHeight:2560},fd2dd53e667d6d49e4fa73356fa941dd:{label:"BlackBerry Z30",width:720,height:1280,scaleFactor:2,dpWidth:360,dpHeight:2560},"707584c1ae17d9b5b2cbe8603c91c147":{label:"Google Nexus 4",width:768,height:1280,scaleFactor:2,dpWidth:384,dpHeight:2560},"91823264de952e7f2347e07db5c4058b":{label:"Google Nexus 5",width:1080,height:1920,scaleFactor:3,dpWidth:360,dpHeight:5760},cd69817a6e147e8a4677389e56fcf568:{label:"Google Nexus S",width:480,height:800,scaleFactor:1.5,dpWidth:320,dpHeight:1200},"75994faa6a38e31e99b53fcd75534a33":{label:"HTC Evo, Touch HD, Desire HD, Desire",width:480,height:800,scaleFactor:1.5,dpWidth:320,dpHeight:1200},"0cab4dfccdfc880687cb608cfe4159db":{label:"HTC One X, EVO LTE",width:720,height:1280,scaleFactor:2,dpWidth:360,dpHeight:2560},c4ff41fcba24d74fc21dc3490ca1edc9:{label:"HTC Sensation, Evo 3D",width:540,height:960,scaleFactor:1.5,dpWidth:360,dpHeight:1440},fa969a5e0dd2de53700eeee4ba4ba142:{label:"LG Optimus 2X, Optimus 3D, Optimus Black",width:480,height:800,scaleFactor:1.5,dpWidth:320,dpHeight:1200},"33c4f9364e295ec03531f3a3425819cf":{label:"LG Optimus G",width:768,height:1280,scaleFactor:2,dpWidth:384,dpHeight:2560},bc47f5275f0efd56fee52d43a8082981:{label:"LG Optimus LTE, Optimus 4X HD",width:720,height:1280,scaleFactor:1.7,dpWidth:424,dpHeight:2176},"0732887e6e324fd10777b735520a34cf":{label:"LG Optimus One",width:320,height:480,scaleFactor:1.5,dpWidth:213,dpHeight:720},"2e38a78364f09d0da0e9e1a3a68e7fb0":{label:"Motorola Defy, Droid, Droid X, Milestone",width:480,height:854,scaleFactor:1.5,dpWidth:320,dpHeight:1281},bd4b78dddc7c9625a4141a1b1ddabb87:{label:"Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2",width:540,height:960,scaleFactor:1,dpWidth:540,dpHeight:960},"3bf1edf21cfa81006183d2b02974c84e":{label:"Motorola Droid Razr HD",width:720,height:1280,scaleFactor:1,dpWidth:720,dpHeight:1280},ab5a352e0e016b97dac986f06c394f55:{label:"Nokia C5, C6, C7, N97, N8, X7",width:360,height:640,scaleFactor:1,dpWidth:360,dpHeight:640},"4826fb7d7257aeaac992ce699df41b3c":{label:"Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900",width:480,height:800,scaleFactor:1.5,dpWidth:320,dpHeight:1200},"0a691ab20add7c432200f8fa6527b488":{label:"Samsung Galaxy Note",width:800,height:1280,scaleFactor:2,dpWidth:400,dpHeight:2560},"9c23ee31be29960fbac9e9bbfc2fc7b0":{label:"Samsung Galaxy Note 3",width:1080,height:1920,scaleFactor:2,dpWidth:540,dpHeight:3840},"92177c0508c1d73905a58e2338f2a81f":{label:"Samsung Galaxy Note II",width:720,height:1280,scaleFactor:2,dpWidth:360,dpHeight:2560},"5222b8866dc4cc606725e16ffcc0a783":{label:"Samsung Galaxy S III, Galaxy Nexus",width:720,height:1280,scaleFactor:2,dpWidth:360,dpHeight:2560},"37c1541e2bd55cfd0f4073b0ccdf68b3":{label:"Samsung Galaxy S, S II, W",width:480,height:800,scaleFactor:1.5,dpWidth:320,dpHeight:1200},"2f7f64b7dda0144907ff300e83eed465":{label:"Samsung Galaxy S4",width:1080,height:1920,scaleFactor:3,dpWidth:360,dpHeight:5760},"9c24f9057744dad56043702a9703127f":{label:"Sony Xperia S, Ion",width:720,height:1280,scaleFactor:2,dpWidth:360,dpHeight:2560},"0a8b2732a016a9395c3af5f12dd9c0da":{label:"Sony Xperia Sola, U",width:480,height:854,scaleFactor:1,dpWidth:480,dpHeight:854},"5a153d7f53d82dcb0801f041574a6a43":{label:"Sony Xperia Z, Z1",width:1080,height:1920,scaleFactor:3,dpWidth:360,dpHeight:5760}},screens:{"9e523ae15b61dc766f5c818726881ecf":{label:"1920 \xD7 1080",width:1920,height:1080,dpWidth:1920,dpHeight:1080,scaleFactor:1},"07769cd8d0a7d09818b2f0b018042fb7":{label:"1366 \xD7 768",width:1366,height:768,dpWidth:1366,dpHeight:768,scaleFactor:1},"72d5478a24194f98b9378e8e0fd65737":{label:"1280 \xD7 1024",width:1280,height:1024,dpWidth:1280,dpHeight:1024,scaleFactor:1},b7a6dd5900cc72e61f0d3479c7e314ec:{label:"1280 \xD7 800",width:1280,height:800,dpWidth:1280,dpHeight:800,scaleFactor:1},"43193b0ff671a37d8232ab664190a125":{label:"1024 \xD7 768",width:1024,height:768,dpWidth:1024,dpHeight:768,scaleFactor:1},c29e48814af5443ff5688d9e967ce917:{label:"800 \xD7 600",width:800,height:600,dpWidth:800,dpHeight:600,scaleFactor:1}}}}),define("taoQtiTestPreviewer/previewer/helpers/devices",["lodash","json!taoQtiTestPreviewer/previewer/resources/devices.json"],function(_,deviceList){'use strict';var deviceTypeMap={mobile:"tablets",desktop:"screens"},devicesHelper={getDevicesByType:function(type){var key=deviceTypeMap[type];return _.map(deviceList[key]||[],function(device,identifier){return{value:identifier,label:device.label,width:device.width,height:device.height}})},getMobileDevices:function(){return devicesHelper.getDevicesByType("mobile")},getDesktopDevices:function(){return devicesHelper.getDevicesByType("desktop")}};return devicesHelper}),define("taoQtiTestPreviewer/previewer/plugins/content/cloneLogoInTestPreview",["jquery","taoTests/runner/plugin"],function($,pluginFactory){'use strict';return pluginFactory({name:"cloneLogoInTestPreview",init:function init(){var testRunner=this.getTestRunner();testRunner.after("ready",function(){$("#tao-main-logo").clone().appendTo(".previewer-test-component header")})}})}),define("taoQtiTestPreviewer/previewer/plugins/content/enhancedReadOnlyMode",["jquery","lodash","i18n","taoTests/runner/plugin"],function($,_,__,pluginFactory){'use strict';return pluginFactory({name:"EnhancedReadOnlyMode",init:function init(){var testRunner=this.getTestRunner(),isPluginAllowed=function(){var config=testRunner.getConfig();return config.options.readOnly};testRunner.after("renderitem",function(){if(isPluginAllowed()){var $contentArea=testRunner.getAreaBroker().getContentArea(),$extendedTextinteractionTextAreas=$contentArea.find(".qti-extendedTextInteraction textarea.text-container"),$ckeEditorsContent=$contentArea.find(".qti-extendedTextInteraction div.cke_contents");$extendedTextinteractionTextAreas.length&&$extendedTextinteractionTextAreas.each(function(){this.style.height="".concat(this.scrollHeight+20,"px")}),$ckeEditorsContent.length&&$ckeEditorsContent.each(function(){var $ckeEditorContent=$(this),$ckeEditorIFrame=$ckeEditorContent.find("iframe.cke_wysiwyg_frame");$ckeEditorIFrame.on("load",function(){setTimeout(function(){var ckeEditorBody=$ckeEditorIFrame[0].contentWindow.document.querySelector("body");$ckeEditorContent[0].style.height="".concat(ckeEditorBody.scrollHeight+20,"px")},0)})})}})}})}),define("taoQtiTestPreviewer/previewer/plugins/controls/close",["jquery","lodash","i18n","ui/hider","taoTests/runner/plugin","tpl!taoQtiTest/runner/plugins/templates/button"],function($,_,__,hider,pluginFactory,buttonTpl){'use strict';return pluginFactory({name:"close",init:function(){function isPluginAllowed(){var config=testRunner.getConfig();return!config.options.hideActionBars}var self=this,testRunner=this.getTestRunner();this.$element=$(buttonTpl({control:"close",title:__("Close the previewer"),icon:"close",text:__("Close"),className:"context-action"})),this.$element.on("click",function(e){e.preventDefault(),!1!==self.getState("enabled")&&(self.disable(),testRunner.trigger("finish"))}),this.disable(),testRunner.on("enablenav",function(){isPluginAllowed()&&self.enable()}).on("disablenav",function(){self.disable()})},render:function(){var $container=this.getAreaBroker().getArea("context");$container.append(this.$element)},destroy:function(){this.$element.remove()},enable:function(){this.$element.prop("disabled",!1).removeClass("disabled")},disable:function(){this.$element.prop("disabled",!0).addClass("disabled")},show:function(){hider.show(this.$element)},hide:function(){hider.hide(this.$element)}})}),define("tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"
\n
    \n
    "})}),define("tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console-line",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,buffer="",escapeExpression=this.escapeExpression;return buffer+="
  • ",(helper=helpers.time)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.time,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",(helper=helpers.type)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.type,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"",(helper=helpers.message)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.message,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),(stack1||0===stack1)&&(buffer+=stack1),buffer+="
  • ",buffer})}),define("tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console-closer",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;return buffer+="",buffer})}),define("taoQtiTestPreviewer/previewer/plugins/navigation/submit/submit",["jquery","lodash","i18n","moment","ui/hider","ui/autoscroll","util/strPad","taoTests/runner/plugin","taoQtiItem/qtiCommonRenderer/helpers/PciResponse","taoQtiItem/runner/rendererStrategies","tpl!taoQtiTest/runner/plugins/templates/button","tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console","tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console-line","tpl!taoQtiTestPreviewer/previewer/plugins/navigation/submit/preview-console-closer"],function($,_,__,moment,hider,autoscroll,strPad,pluginFactory,pciResponse,rendererStrategies,buttonTpl,consoleTpl,consoleLineTpl,consoleCloserTpl){'use strict';var defaults={submitTitle:__("Submit and show the result"),submitText:__("Submit"),submitIcon:"forward"};return pluginFactory({name:"submit",init:function init(){var _this2=this,testRunner=this.getTestRunner(),pluginConfig=_.defaults(this.getConfig(),defaults),isPluginAllowed=function(){var config=testRunner.getConfig();return!config.options.readOnly&&"reviewRenderer"!==rendererStrategies(config.options.view).getName()},showConsole=function(){hider.show(_this2.controls.$console),hider.show(_this2.controls.$consoleBody),hider.show(_this2.controls.$consoleCloser),autoscroll(_this2.controls.$consoleBody.children().last(),_this2.controls.$consoleBody)},hideConsole=function(){hider.hide(_this2.controls.$console),hider.hide(_this2.controls.$consoleCloser)},addConsoleLine=function(type,message){var data={time:strPad(moment().format("HH:mm:ss"),12," "),type:strPad(type||"",18," "),message:strPad(message||"",18," ")};_this2.controls.$consoleBody.append($(consoleLineTpl(data)))},showResponses=function(type,responses){_.forEach(responses,function(response,identifier){addConsoleLine(type,strPad("".concat(identifier,": "),15," ")+_.escape(pciResponse.prettyPrint(response)))})};this.controls={$button:$(buttonTpl({control:"submit",title:pluginConfig.submitTitle,icon:pluginConfig.submitIcon,text:pluginConfig.submitText})),$console:$(consoleTpl()),$consoleCloser:$(consoleCloserTpl())},this.controls.$consoleBody=this.controls.$console.find(".preview-console-body"),this.controls.$button.on("click",function(e){e.preventDefault(),!1!==_this2.getState("enabled")&&(_this2.disable(),testRunner.trigger("submititem"))}),this.controls.$consoleCloser.on("click",function(e){e.preventDefault(),hideConsole()}),isPluginAllowed()||this.hide(),this.disable(),testRunner.on("render",function(){isPluginAllowed()?_this2.show():_this2.hide()}).on("submitresponse",function(responses){showResponses(__("Submitted data"),responses),showConsole()}).on("scoreitem",function(responses){responses.itemSession&&(showResponses(__("Output data"),responses.itemSession),showConsole())}).on("enablenav",function(){_this2.enable()}).on("disablenav",function(){_this2.disable()})},render:function render(){var $container=this.getAreaBroker().getContainer(),$navigation=this.getAreaBroker().getNavigationArea();$navigation.append(this.controls.$button),$navigation.append(this.controls.$consoleCloser),$container.append(this.controls.$console)},destroy:function destroy(){_.forEach(this.controls,function($el){return $el.remove()}),this.controls=null},enable:function enable(){this.controls.$button.prop("disabled",!1).removeClass("disabled")},disable:function disable(){this.controls.$button.prop("disabled",!0).addClass("disabled")},show:function show(){hider.show(this.controls.$button)},hide:function hide(){_.forEach(this.controls,hider.hide)}})}),define("tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/devices-previewer",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,buffer="",escapeExpression=this.escapeExpression;return buffer+="
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ",buffer})}),define("css!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesPreviewer",[],function(){}),define("taoQtiTestPreviewer/previewer/plugins/tools/scale/component/devicesPreviewer",["jquery","lodash","i18n","ui/component","ui/transformer","tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/devices-previewer","css!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesPreviewer.css"],function($,_,__,componentFactory,transformer,devicesPreviewerTpl){'use strict';var _Mathmin=Math.min,defaults={deviceType:"standard",deviceWith:0,deviceHeight:0,deviceOrientation:null};return function(container,config){var controls=null,resetScale=function(){controls&&(controls.$previewContent.removeAttr("style"),controls.$previewContainer.removeAttr("style"))},devicesPreviewer=componentFactory({getDeviceWidth:function(){return this.getConfig().deviceWidth},setDeviceWidth:function(width){var componentConfig=this.getConfig();return componentConfig.deviceWidth=parseInt(width,10)||0,this.trigger("devicewidthchange",componentConfig.deviceWidth),this},getDeviceHeight:function(){return this.getConfig().deviceHeight},setDeviceHeight:function(height){var componentConfig=this.getConfig();return componentConfig.deviceHeight=parseInt(height,10)||0,this.trigger("deviceheightchange",componentConfig.deviceHeight),this},getDeviceOrientation:function(){return this.getConfig().deviceOrientation},setDeviceOrientation:function(orientation){var componentConfig=this.getConfig();return componentConfig.deviceOrientation=orientation,this.is("rendered")&&this.getElement().attr("data-orientation",componentConfig.deviceOrientation),this.trigger("deviceorientationchange",componentConfig.deviceOrientation),this},isDeviceMode:function(){return"standard"!==this.getDeviceType()},getDeviceType:function(){return this.getConfig().deviceType},setDeviceType:function(type){var componentConfig=this.getConfig();return componentConfig.deviceType=type,this.is("rendered")&&this.getElement().attr("data-type",componentConfig.deviceType),this.trigger("devicetypechange",componentConfig.deviceType),this},previewDevice:function(){var width,height;return this.is("rendered")&&(this.is("disabled")||"standard"===this.getDeviceType()?this.clearScale():("portrait"===this.getDeviceOrientation()?(width=this.getDeviceHeight(),height=this.getDeviceWidth()):(width=this.getDeviceWidth(),height=this.getDeviceHeight()),this.applyScale(width,height)),this.trigger("devicepreview")),this},clearScale:function(){return this.is("rendered")&&(resetScale(),this.trigger("scaleclear")),this},applyScale:function(width,height){var frameSize,frameMargins,scaleFactor;return this.is("rendered")&&(resetScale(),frameSize=this.getFrameSize(),frameMargins=this.getFrameMargins(),scaleFactor=this.getScaleFactor(width,height),controls.$previewContent.width(width).height(height),controls.$previewContainer.css("left",(frameSize.width-(width+frameMargins.width)*scaleFactor)/2).width(width+frameMargins.width).height(height+frameMargins.height),transformer.setTransformOrigin(controls.$previewContainer,0,0),transformer.scale(controls.$previewContainer,scaleFactor),this.trigger("scalechange")),this},getFrameMargins:function(){var margins={width:0,height:0};return this.is("rendered")&&(margins.width=controls.$previewContainer.outerWidth()-controls.$previewContent.width(),margins.height=controls.$previewContainer.outerHeight()-controls.$previewContent.height()),margins},getFrameSize:function(){var size={width:0,height:0};return this.is("rendered")&&(size.width=this.getContainer().innerWidth(),size.height=this.getContainer().innerHeight()),size},getScaleFactor:function(width,height){var margins,frameSize,scaleFactor={x:1,y:1};return this.is("rendered")&&this.isDeviceMode()&&(frameSize=this.getFrameSize(),margins=this.getFrameMargins(),width+=margins.width,height+=margins.height,width>frameSize.width&&(scaleFactor.x=frameSize.width/width),height>frameSize.height&&(scaleFactor.y=frameSize.height/height)),_Mathmin(scaleFactor.x,scaleFactor.y)},wrap:function(element){return this.is("rendered")&&(this.unwrap(),controls.$wrappedElement=$(element),controls.$wrappedElementContainer=controls.$wrappedElement.parent(),controls.$previewContent.append(controls.$wrappedElement),this.trigger("wrap",controls.$wrappedElement)),this},unwrap:function(){var $wasWrappedElement;return this.is("rendered")&&controls.$wrappedElement&&($wasWrappedElement=controls.$wrappedElement,controls.$wrappedElementContainer.append(controls.$wrappedElement),controls.$wrappedElement=null,controls.$wrappedElementContainer=null,this.trigger("unwrap",$wasWrappedElement)),this}},defaults).setTemplate(devicesPreviewerTpl).on("init",function(){var componentConfig=this.getConfig();this.setDeviceType(componentConfig.deviceType),this.setDeviceWidth(componentConfig.deviceWidth),this.setDeviceHeight(componentConfig.deviceHeight),this.setDeviceOrientation(componentConfig.deviceOrientation),_.defer(function(){devicesPreviewer.render(container)})}).on("render",function(){var $element=this.getElement();controls={$previewContainer:$element.find(".preview-container"),$previewFrame:$element.find(".preview-frame"),$previewContent:$element.find(".preview-content"),$wrappedElement:null,$wrappedElementContainer:null},this.trigger("ready")}).on("disable enable",function(){var self=this;this.is("rendered")&&_.defer(function(){self.previewDevice()})}).on("destroy",function(){this.unwrap(),controls=null});return _.defer(function(){devicesPreviewer.init(config)}),devicesPreviewer}}),define("tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/devices-selector",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"
    \n
    \n
    \n
    \n
    \n
    "})}),define("tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/selector",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(depth0,data){var stack1,helper,buffer="";return buffer+="\n \n ",buffer}function program2(){return"selected=\"selected\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,buffer="",escapeExpression=this.escapeExpression,self=this;return buffer+="",buffer})}),define("css!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesSelector",[],function(){}),define("taoQtiTestPreviewer/previewer/plugins/tools/scale/component/devicesSelector",["jquery","lodash","i18n","ui/component","ui/selecter","taoQtiTestPreviewer/previewer/helpers/devices","tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/devices-selector","tpl!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/tpl/selector","css!taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesSelector.css"],function($,_,__,componentFactory,lookupSelecter,devicesHelper,devicesSelectorTpl,selectorTpl){'use strict';function getSelectorData(selected,list){return selected&&_.size(list)?_.find(list,{value:selected})||null:null}function getValidIdentifier(identifier,list){return list&&list.length?_.find(list,{value:identifier})?identifier:_.first(list).value:null}function updateSelect2($selector,value){var current=$selector.val();return current!==value&&($selector.val(value),$selector.trigger("change")),$selector}function removeSelect2($selector){return $selector.hasClass("select2-offscreen")&&$selector.select2("destroy"),$selector}var defaults={type:"standard",device:null,orientation:"landscape"},deviceTypesList=[{value:"standard",label:__("Actual size"),devicesList:!1,orientation:!1},{value:"desktop",label:__("Desktop preview"),devicesList:!0,orientation:!1},{value:"mobile",label:__("Mobile preview"),devicesList:!0,orientation:!0}],deviceOrientationsList=[{value:"landscape",label:__("Landscape")},{value:"portrait",label:__("Portrait")}],callbackMap={type:"setType",device:"setDevice",mobile:"setDevice",desktop:"setDevice",orientation:"setOrientation"};return function(container,config){var selected={type:null,device:null,orientation:null,desktop:null,mobile:null},devicesList=[],typeData=null,controls=null,setControlsProp=function(property,value){_.forEach(controls,function($selector){$selector.prop(property,value)})},devicesSelector=componentFactory({isDeviceMode:function(){return"standard"!==selected.type},updateMode:function(){return this.is("rendered")&&this.getElement().attr("data-type",selected.type),this},getType:function(){return selected.type},getOrientation:function(){return typeData&&typeData.orientation?selected.orientation:null},getDevice:function(){return typeData&&typeData.devicesList?selected.device:null},getDeviceData:function(){return getSelectorData(this.getDevice(),devicesList)},setType:function(identifier){return identifier=getValidIdentifier(identifier,deviceTypesList),identifier!==selected.type&&(selected.type=identifier,selected.device=null,devicesList=devicesHelper.getDevicesByType(selected.type),typeData=getSelectorData(selected.type,deviceTypesList),this.is("rendered")&&(updateSelect2(controls.$typeSelector,selected.type),this.updateMode()),this.trigger("typechange",selected.type),typeData.devicesList&&this.setDevice(selected[selected.type])),this},setOrientation:function(identifier){return identifier=getValidIdentifier(identifier,deviceOrientationsList),identifier!==selected.orientation&&(selected.orientation=identifier,this.is("rendered")&&updateSelect2(controls.$orientationSelector,selected.orientation),this.trigger("orientationchange",selected.orientation)),this},setDevice:function(identifier){var $selector;return identifier=getValidIdentifier(identifier,devicesList),identifier!==selected.device&&(selected.device=identifier,selected[selected.type]=identifier,this.is("rendered")&&this.isDeviceMode()&&($selector=controls["$"+selected.type+"Selector"],$selector&&updateSelect2($selector,selected.device)),this.trigger("devicechange",selected.device,this.getDeviceData())),this},select:function(name,value){var setterName=callbackMap[name];return setterName&&_.isFunction(this[setterName])&&this[setterName](value),this},reset:function(){var componentConfig=this.getConfig();return this.setType(componentConfig.type),this.setDevice(componentConfig.device),this.setOrientation(componentConfig.orientation),this}},defaults).setTemplate(devicesSelectorTpl).on("init",function(){this.reset(),_.defer(function(){devicesSelector.render(container)})}).on("render",function(){function renderSelector(name,list,selectedValue,category){var $selector=$(selectorTpl({name:name,category:category||name,items:_.map(list,function(item){return{value:item.value,label:item.label,selected:selectedValue===item.value}})}));return self.getElement().find("."+name+"-selector").html($selector),$selector}var self=this;controls={$typeSelector:renderSelector("type",deviceTypesList,selected.type),$desktopSelector:renderSelector("desktop",devicesHelper.getDesktopDevices(),selected.device,"device"),$mobileSelector:renderSelector("mobile",devicesHelper.getMobileDevices(),selected.device,"device"),$orientationSelector:renderSelector("orientation",deviceOrientationsList,selected.orientation)},lookupSelecter(this.getElement()),this.getElement().on("change",".selector",function(e){var $selector=$(e.target).closest("select");self.select($selector.attr("name"),$selector.val())}),this.updateMode(),this.trigger("ready")}).on("disable",function(){this.is("rendered")&&setControlsProp("disabled",!0)}).on("enable",function(){this.is("rendered")&&setControlsProp("disabled",!1)}).on("destroy",function(){_.forEach(controls,removeSelect2),controls=null,selected=null,typeData=null,devicesList=null});return _.defer(function(){devicesSelector.init(config)}),devicesSelector}}),define("taoQtiTestPreviewer/previewer/plugins/tools/scale/scale",["jquery","lodash","lib/uuid","util/namespace","taoTests/runner/plugin","taoQtiTestPreviewer/previewer/plugins/tools/scale/component/devicesPreviewer","taoQtiTestPreviewer/previewer/plugins/tools/scale/component/devicesSelector"],function($,_,uuid,namespaceHelper,pluginFactory,devicesPreviewerFactory,devicesSelectorFactory){'use strict';return pluginFactory({name:"scale",init:function(){function isPluginAllowed(){var config=testRunner.getConfig();return!config.options.readOnly}var self=this,testRunner=this.getTestRunner();this.nsId=this.getName()+uuid(6),isPluginAllowed()||this.hide(),this.disable(),testRunner.on("render",function(){isPluginAllowed()?self.show():self.hide()}).on("resizeitem",function(size,orientation,type){self.devicesPreviewer&&self.devicesPreviewer.setDeviceType(type).setDeviceOrientation(orientation).setDeviceWidth(size&&size.width).setDeviceHeight(size&&size.height).previewDevice()}).on("enablenav",function(){self.enable()}).on("disablenav",function(){self.disable()})},render:function(){function resizeItem(){self.devicesSelector&&self.getState("enabled")&&testRunner.trigger("resizeitem",self.devicesSelector.getDeviceData(),self.devicesSelector.getOrientation(),self.devicesSelector.getType())}var self=this,testRunner=this.getTestRunner(),areaBroker=this.getAreaBroker();return $(window).on(namespaceHelper.namespaceAll("resize orientationchange",this.nsId),_.throttle(function(){self.devicesSelector&&self.devicesSelector.isDeviceMode()&&resizeItem()},50)),Promise.all([new Promise(function(resolve){self.devicesSelector=devicesSelectorFactory(areaBroker.getHeaderArea()).on("ready",function(){self.getState("enabled")||this.disable(),this.on("typechange",function(){this.isDeviceMode()||resizeItem()}),this.on("devicechange orientationchange",function(){resizeItem()}),resolve()})}),new Promise(function(resolve){self.devicesPreviewer=devicesPreviewerFactory(areaBroker.getArea("contentWrapper")).on("ready",function(){this.wrap(areaBroker.getContentArea()),resolve()})})])},destroy:function(){this.nsId&&$(window).off("."+this.nsId),this.devicesSelector&&this.devicesSelector.destroy(),this.devicesPreviewer&&this.devicesPreviewer.destroy(),this.devicesSelector=null,this.devicesPreviewer=null},enable:function(){this.devicesSelector&&this.devicesSelector.enable()},disable:function(){this.devicesSelector&&this.devicesSelector.disable()},show:function(){this.devicesSelector&&this.devicesSelector.show()},hide:function(){this.devicesSelector&&this.devicesSelector.hide()}})}),define("tpl!taoQtiTestPreviewer/previewer/provider/item/tpl/item",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){return this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{},"
    \n
    \n
    \n
    \n
    \n
      \n
      \n
      \n
      \n\n
      \n\n \n\n
      \n
      \n
      \n
      \n\n \n\n
      "})}),define("taoQtiTestPreviewer/previewer/provider/item/item",["jquery","lodash","i18n","ui/feedback","taoTests/runner/areaBroker","taoTests/runner/testStore","taoTests/runner/proxy","taoQtiTest/runner/ui/toolbox/toolbox","taoQtiItem/runner/qtiItemRunner","taoQtiTest/runner/config/assetManager","taoItems/assets/strategies","taoQtiItem/qtiCommonRenderer/helpers/container","tpl!taoQtiTestPreviewer/previewer/provider/item/tpl/item"],function($,_,__,feedback,areaBrokerFactory,testStoreFactory,proxyFactory,toolboxFactory,qtiItemRunner,assetManagerFactory,assetStrategies,containerHelper,layoutTpl){'use strict';function setContext($context){_$previousContext=containerHelper.getContext(),containerHelper.setContext($context)}function restoreContext(){containerHelper.setContext(_$previousContext),_$previousContext=null}var assetManager=assetManagerFactory();assetManager.prependStrategy(assetStrategies.taomedia);var _$previousContext=null;return{name:"qtiItemPreviewer",loadAreaBroker:function loadAreaBroker(){var $layout=$(layoutTpl());return areaBrokerFactory($layout,{contentWrapper:$(".content-wrapper",$layout),content:$("#qti-content",$layout),toolbox:$(".bottom-action-bar .tools-box",$layout),navigation:$(".bottom-action-bar .navi-box-list",$layout),control:$(".top-action-bar .control-box",$layout),actionsBar:$(".bottom-action-bar .control-box",$layout),panel:$(".test-sidebar-left",$layout),header:$(".top-action-bar .tools-box",$layout),context:$(".top-action-bar .navi-box-list",$layout)})},loadProxy:function loadProxy(){var _this$getConfig=this.getConfig(),proxyProvider=_this$getConfig.proxyProvider,serviceCallId=_this$getConfig.serviceCallId,bootstrap=_this$getConfig.bootstrap,timeout=_this$getConfig.timeout;return proxyFactory(proxyProvider||"qtiItemPreviewerProxy",{serviceCallId:serviceCallId,bootstrap:bootstrap,timeout:timeout})},loadTestStore:function loadTestStore(){var config=this.getConfig(),identifier=config.serviceCallId||"test-".concat(Date.now());return testStoreFactory(identifier)},install:function install(){var plugins=this.getConfig().options.plugins;plugins&&_.forEach(this.getPlugins(),function(plugin){if(_.isPlainObject(plugin)&&_.isFunction(plugin.setConfig)){var config=plugins[plugin.getName()];_.isPlainObject(config)&&plugin.setConfig(config)}})},init:function init(){var _this3=this,dataHolder=this.getDataHolder(),areaBroker=this.getAreaBroker();return areaBroker.setComponent("toolbox",toolboxFactory()),areaBroker.getToolbox().init(),this.on("submititem",function(){var itemState=_this3.itemRunner.getState(),itemResponses=_this3.itemRunner.getResponses();return _this3.trigger("disabletools disablenav"),_this3.trigger("submitresponse",itemResponses,itemState),_this3.getProxy().submitItem(dataHolder.get("itemIdentifier"),itemState,itemResponses).then(function(response){_this3.trigger("scoreitem",response),_this3.trigger("enabletools enablenav resumeitem")}).catch(function(err){_this3.trigger("enabletools enablenav"),200===err.code&&_this3.trigger("alert.submitError",err.message||__("An error occurred during results submission. Please retry."),function(){return _this3.trigger("resumeitem")})})}).on("ready",function(){var itemIdentifier=dataHolder.get("itemIdentifier"),itemData=dataHolder.get("itemData");itemIdentifier&&(itemData?_this3.renderItem(itemIdentifier,itemData):_this3.loadItem(itemIdentifier))}).on("loaditem",function(itemRef,itemData){dataHolder.set("itemIdentifier",itemRef),dataHolder.set("itemData",itemData)}).on("renderitem",function(){_this3.trigger("enabletools enablenav")}).on("resumeitem",function(){_this3.trigger("enableitem enablenav")}).on("disableitem",function(){_this3.trigger("disabletools")}).on("enableitem",function(){_this3.trigger("enabletools")}).on("error",function(){_this3.trigger("disabletools enablenav")}).on("finish leave",function(){_this3.trigger("disablenav disabletools"),_this3.flush()}).on("flush",function(){_this3.destroy()}),this.getProxy().init().then(function(data){dataHolder.set("itemIdentifier",data.itemIdentifier),dataHolder.set("itemData",data.itemData)})},render:function render(){var config=this.getConfig(),areaBroker=this.getAreaBroker();config.renderTo.append(areaBroker.getContainer()),areaBroker.getToolbox().render(areaBroker.getToolboxArea())},loadItem:function loadItem(itemIdentifier){return this.getProxy().getItem(itemIdentifier)},renderItem:function renderItem(itemIdentifier,itemData){var _this4=this,areaBroker=this.getAreaBroker(),options=this.getConfig().options,changeState=function(){_this4.setItemState(itemIdentifier,"changed",!0)};return setContext(areaBroker.getContentArea()),new Promise(function(resolve,reject){assetManager.setData("baseUrl",itemData.baseUrl),itemData.content=itemData.content||{},_this4.itemRunner=qtiItemRunner(itemData.content.type,itemData.content.data,Object.assign({assetManager:assetManager},options)).on("error",function(err){_this4.trigger("enablenav"),reject(err),feedback().error(__("It seems that there is an error during item preview loading. Please, try again."))}).on("init",function(){var state=itemData.state,portableElements=itemData.portableElements;this.render(areaBroker.getContentArea(),{state:state,portableElements:portableElements})}).on("render",function(){this.on("responsechange",changeState),this.on("statechange",changeState),resolve()}).init()})},unloadItem:function unloadItem(){var _this5=this;return this.trigger("beforeunloaditem disablenav disabletools"),this.itemRunner?new Promise(function(resolve){_this5.itemRunner.on("clear",resolve).clear()}):Promise.resolve()},destroy:function destroy(){var areaBroker=this.getAreaBroker();this.itemRunner&&this.itemRunner.on("clear",restoreContext).clear(),this.itemRunner=null,areaBroker&&areaBroker.getToolbox().destroy()}}}),define("taoQtiTestPreviewer/previewer/proxy/item",["jquery","lodash","i18n","core/promiseQueue","core/request","taoQtiTestPreviewer/previewer/config/item"],function($,_,__,promiseQueue,coreRequest,configFactory){'use strict';return{name:"qtiItemPreviewerProxy",install:function(){var self=this;this.queue=promiseQueue(),this.prepareParams=function(actionParams){var stringifyParams=["itemState","itemResponse"];return _.isPlainObject(actionParams)?_.mapValues(actionParams,function(value,key){return _.contains(stringifyParams,key)?JSON.stringify(value):value}):actionParams},this.request=function(url,reqParams,contentType,noToken){return coreRequest({url:url,data:self.prepareParams(reqParams),method:reqParams?"POST":"GET",contentType:contentType,noToken:noToken,background:!1,sequential:!0,timeout:self.configStorage.getTimeout()}).then(function(response){return self.setOnline(),response&&response.success?Promise.resolve(response):Promise.reject(response)}).catch(function(error){return error.data&&self.isConnectivityError(error.data)&&self.setOffline("request"),Promise.reject(error)})}},init:function(config,params){return this.configStorage=configFactory(config||{}),this.request(this.configStorage.getTestActionUrl("init"),params,void 0,!0)},destroy:function(){return this.configStorage=null,this.queue=null,Promise.resolve()},callTestAction:function(action,params){return this.request(this.configStorage.getTestActionUrl(action),params)},callItemAction:function(itemIdentifier,action,params){return this.request(this.configStorage.getItemActionUrl(itemIdentifier,action),params)},getItem:function(itemIdentifier,params){return this.request(this.configStorage.getItemActionUrl(itemIdentifier,"getItem"),params,void 0,!0)},submitItem:function(itemIdentifier,state,response,params){var body=_.merge({itemState:state,itemResponse:response},params||{});return this.request(this.configStorage.getItemActionUrl(itemIdentifier,"submitItem"),body,void 0,!0)}}}),define("taoQtiTestPreviewer/previewer/proxy/test",["core/promiseQueue","core/request","util/url","taoQtiTest/runner/helpers/map"],function(promiseQueue,request,urlUtil,mapHelper){'use strict';var _Mathmin2=Math.min;function updateTestContextWithItem(testMap,position,testContext,presetMap){var jump=mapHelper.getJump(testMap,position),item=mapHelper.getItemAt(testMap,position);item&&(testContext.testPartId=jump.part,testContext.sectionId=jump.section,testContext.itemIdentifier=jump.identifier,testContext.itemSessionState=itemSessionStates.initial,testContext.options=createContextOptions(item,presetMap))}function createContextOptions(item,presetMap){var options={};return presetMap.forEach(function(category){var pluginId=Object.keys(category)[0],categoryId=category[pluginId];item.categories.includes(categoryId)&&(options[pluginId]=!0)}),options}var serviceExtension="taoQtiTestPreviewer",testSessionStates=Object.freeze({initial:0,interacting:1,modalFeedback:2,suspended:3,closed:4}),itemSessionStates=Object.freeze({initial:0,interacting:1,modalFeedback:2,suspended:3,closed:4,solution:5,review:6});return{name:"qtiTestPreviewerProxy",install:function install(){this.queue=promiseQueue()},init:function init(configs){var _this6=this;return this.itemStore={},request({url:urlUtil.route("init","TestPreviewer",serviceExtension),data:{testUri:configs.options.testUri}}).then(function(response){var data=response.data;_this6.builtTestMap=mapHelper.reindex(data.testMap),_this6.presetMap=data.presetMap||[],delete data.presetMap;var firstJump=_this6.builtTestMap.jumps[0]||{},firstItem=mapHelper.getItemAt(_this6.builtTestMap,0);return data.testContext={itemIdentifier:firstJump.identifier,itemPosition:0,itemSessionState:0,testPartId:firstJump.part,sectionId:firstJump.section,canMoveBackward:!0,state:testSessionStates.interacting,attempt:1,options:createContextOptions(firstItem,_this6.presetMap)},data})},destroy:function destroy(){return this.queue=null,this.itemStore&&(this.itemStore=null),Promise.resolve()},getItem:function getItem(itemIdentifier){var _this7=this;if(itemIdentifier in this.itemStore)return Promise.resolve(this.itemStore[itemIdentifier]);var _ref=mapHelper.getItem(this.builtTestMap,itemIdentifier)||{},uri=_ref.uri;if(!uri)throw new Error("There is no item ".concat(itemIdentifier," in the testMap!"));return request({url:urlUtil.route("getItem","Previewer",serviceExtension),data:{serviceCallId:"previewer",itemUri:uri},noToken:!0}).then(function(data){return data.itemData=data.content,data.itemIdentifier=data.content.data.identifier,data.itemState={},_this7.itemStore[itemIdentifier]=data,data})},callItemAction:function callItemAction(itemIdentifier,action){var _this8=this,params=2testPartPosition}).sort(function(a,b){return a.position-b.position});0===nextPartsSorted.length?testContext.state=testSessionStates.closed:testContext.itemPosition=_Mathmin2(testMap.stats.total-1,nextPartsSorted[0].position)}else testContext.itemPosition+1>=testMap.stats.total?testContext.state=testSessionStates.closed:testContext.itemPosition=_Mathmin2(testMap.stats.total-1,testContext.itemPosition+1);return"previous"===params.direction&&(testContext.itemPosition=_Mathmax(0,testContext.itemPosition-1)),"jump"===params.direction&&0<=params.ref&&(testContext.itemPosition=params.ref),updateTestContextWithItem(testMap,testContext.itemPosition,testContext,_this8.presetMap),{testContext:testContext,testMap:testMap}},flagItem:function flagItem(){return Promise.resolve()}};if(actions.skip=actions.move,params.itemState&&(this.itemStore[itemIdentifier].itemState=params.itemState),"function"==typeof actions[action])return actions[action]()},callTestAction:function callTestAction(){return Promise.resolve()}}}),define("tpl!taoQtiTestPreviewer/previewer/component/test/tpl/qtiTest",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;return buffer+="",buffer})}),define("css!taoQtiTestPreviewer/previewer/component/test/css/qtiTest",[],function(){}),define("taoQtiTestPreviewer/previewer/component/test/qtiTest",["context","lodash","layout/loading-bar","taoTests/runner/runnerComponent","taoQtiTest/runner/config/assetManager","taoItems/assets/strategies","tpl!taoQtiTestPreviewer/previewer/component/test/tpl/qtiTest","css!taoQtiTestPreviewer/previewer/component/test/css/qtiTest","css!taoQtiTestCss/new-test-runner"],function(context,__,loadingBar,runnerComponentFactory,assetManagerFactory,assetStrategies,runnerTpl){'use strict';return function(container){var config=1.qti-panel{max-width:350px;padding:10px}@media only screen and (max-device-width: 800px){.item-previewer-scope .test-sidebar{max-width:200px}.item-previewer-scope .test-sidebar>.qti-panel{max-width:200px}}@media only screen and (min-device-width: 800px) and (max-device-width: 1280px){.item-previewer-scope .test-sidebar{max-width:250px}.item-previewer-scope .test-sidebar>.qti-panel{max-width:250px}}@media only screen and (min-device-width: 1280px) and (max-device-width: 1440px){.item-previewer-scope .test-sidebar{max-width:300px}.item-previewer-scope .test-sidebar>.qti-panel{max-width:300px}}.item-previewer-scope .test-sidebar-left{border-right:1px #ddd solid}.item-previewer-scope .test-sidebar-right{border-left:1px #ddd solid}.item-previewer-scope .content-wrapper{position:relative;-webkit-flex:1 1 0%;-ms-flex:1 1 0%;flex:1 1 0%;overflow:auto;padding:0}.item-previewer-scope .content-wrapper .overlay{position:absolute;left:0;right:0;top:0;bottom:0;width:100%;opacity:.9}.item-previewer-scope .content-wrapper .overlay-full{background-color:#fff;opacity:1}.item-previewer-scope #qti-content{-webkit-overflow-scrolling:touch;max-width:1024px;width:100%;margin:auto}.item-previewer-scope #qti-item{width:100%;min-width:100%;height:auto;overflow:visible}.item-previewer-scope .qti-item{padding:30px}.item-previewer-scope .size-wrapper{max-width:1280px;margin:auto;width:100%;padding-right:40px}.item-previewer-scope #qti-rubrics{margin:auto;max-width:1024px;width:100%}.item-previewer-scope #qti-rubrics .qti-rubricBlock{margin:20px 0}.item-previewer-scope #qti-rubrics .hidden{display:none}.no-controls .item-previewer-scope{height:100vh}.previewer-component{background:inherit}.previewer-component.fullpage{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100000}.previewer-component.fullpage .item-previewer-scope{height:100vh}.previewer-component.readonly .qti-item::before{content:' ';position:absolute;top:0;left:0;right:0;bottom:0;z-index:100000}.previewer-component.hideactionbars .test-sidebar{height:100%}.previewer-component.hideactionbars .action-bar{display:none}.item-previewer-scope .preview-console-closer{position:absolute;right:10px;top:10px;cursor:pointer;color:rgba(255,255,255,0.9);text-shadow:none}.item-previewer-scope .preview-console-closer:hover{color:white}.item-previewer-scope .preview-console{background:#2b2b2b;color:#fff;font-family:Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace;position:relative}.item-previewer-scope .preview-console .preview-console-body{padding:5px;margin:0;height:30vh;overflow:auto}.item-previewer-scope .preview-console .preview-console-body .log-time{color:#999}.item-previewer-scope .preview-console .preview-console-body .log-type{color:#eee}.item-previewer-scope .preview-console .preview-console-body .log-message{color:#69f}.item-previewer-scope .preview-console .preview-console-body pre{margin:0}.item-previewer-scope .action-bar.content-action-bar{padding:2px}.item-previewer-scope .action-bar.content-action-bar li{margin:2px 0 0 10px;border:none}.item-previewer-scope .action-bar.content-action-bar li.btn-info{padding-top:6px;height:33px;margin-top:0;border-bottom:solid 2px transparent;border-radius:0}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group{border:none !important;overflow:hidden;padding:0}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a{float:left;margin:0 2px;padding:0 15px;border:1px solid rgba(255,255,255,0.3);border-radius:0px;display:inline-block;height:inherit}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a:first-of-type{border-top-left-radius:3px;border-bottom-left-radius:3px;margin-left:0}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a:last-of-type{border-top-right-radius:3px;border-bottom-right-radius:3px;margin-right:0}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a:hover,.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a.active{border-color:rgba(255,255,255,0.8)}.item-previewer-scope .action-bar.content-action-bar li.btn-info.btn-group a .no-label{padding-right:0}.item-previewer-scope .action-bar.content-action-bar li.btn-info:hover,.item-previewer-scope .action-bar.content-action-bar li.btn-info.active{border-bottom-color:rgba(255,255,255,0.8)}.item-previewer-scope .action-bar.content-action-bar li.btn-info:active,.item-previewer-scope .action-bar.content-action-bar li.btn-info.active{background:#e7eff4;border-color:rgba(255,255,255,0.8)}.item-previewer-scope .action-bar.content-action-bar li.btn-info:active a,.item-previewer-scope .action-bar.content-action-bar li.btn-info.active a{color:#266d9c;text-shadow:none}.item-previewer-scope .action-bar.content-action-bar li.btn-info:active:hover,.item-previewer-scope .action-bar.content-action-bar li.btn-info.active:hover{background:#fff}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar{opacity:1;height:40px}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.top-action-bar>.control-box{height:40px;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-justify-content:space-between;-ms-flex-pack:space-between;justify-content:space-between;padding-left:10px;padding-right:40px}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box{color:rgba(255,255,255,0.9);text-shadow:1px 1px 0 black}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .lft,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .rgt{padding-left:20px}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .lft:first-child,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .rgt:first-child{padding-left:0}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .lft:last-child ul,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box .rgt:last-child ul{display:inline-block}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box [class^=\"btn-\"],.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar>.control-box [class*=\" btn-\"]{white-space:nowrap}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box{position:relative;overflow:visible}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .action{position:relative;overflow:visible}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu{color:#222;background:#f3f1ef;border:1px solid #aaa9a7;overflow:auto;list-style:none;min-width:150px;margin:0;padding:0;position:absolute;bottom:36px;left:-3px}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action{display:inline-block;text-align:left;width:100%;white-space:nowrap;overflow:hidden;color:#222;border-bottom:1px solid #c2c1bf;margin:0;-moz-border-radius:0px;-webkit-border-radius:0px;border-radius:0px;height:32px;padding:6px 15px;line-height:1;border-left:solid 3px transparent}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action .icon-checkbox-checked{display:none}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.active{background-color:#dbd9d7;font-weight:bold}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover .icon-checkbox,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover .icon-checkbox,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.active .icon-checkbox{display:none}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover .icon-checkbox-checked,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover .icon-checkbox-checked,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.active .icon-checkbox-checked{display:inline-block}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover{background-color:#0e5d91;color:#fff;border-left-color:#313030 !important}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover .label,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover .label,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover .icon{color:#fff}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action.hover .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action:hover .icon{color:#e7eff4}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action .label,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar .tools-box .menu .action .icon{font-size:14px;font-size:1.4rem;text-shadow:none;color:#222}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar{overflow:visible;position:relative}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .action{line-height:1.6}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .icon.no-label{padding-right:0}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .tool-label-collapsed .btn-info .text,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .tool-label-collapsed-hover .btn-info:not(:hover) .text,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.no-tool-label .text,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.tool-label-collapsed .text,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.tool-label-collapsed-over:not(:hover) .text{display:none}.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .tool-label-collapsed .btn-info .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .tool-label-collapsed-hover .btn-info:not(:hover) .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.no-tool-label .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.tool-label-collapsed .icon,.item-previewer-scope .action-bar.content-action-bar.horizontal-action-bar.bottom-action-bar .btn-info.tool-label-collapsed-over:not(:hover) .icon{padding:0}\n\n/*# sourceMappingURL=taoQtiTestPreviewer/previewer/provider/item/css/item.css.map */.top-block-preview{position:fixed;top:0;left:50%;z-index:10000;display:flex;flex-direction:column;align-items:center;justify-content:center}.top-block-preview.open{transform:translate(-50%, 0);transition:transform .5s ease-out}.top-block-preview.close{transform:translate(-50%, calc(30px - 100%));transition:transform .5s ease-out}.top-block-preview-main{display:flex;padding:12px 24px;background-color:#f3f1ef;border:solid 1px #E5E4E4}.top-block-preview-main .btn-info{margin-left:16px;white-space:nowrap}.top-block-preview-main .btn-info .icon{padding-left:9px;padding-right:0}.top-block-preview-info{display:flex;align-items:center;justify-content:center}.top-block-preview-info p{margin-bottom:0}.top-block-preview-collapser{position:relative;width:60px;height:30px;background-color:#f3f1ef;border-bottom-left-radius:30px;border-bottom-right-radius:30px;transform:translateY(-10px);display:flex;align-items:center;justify-content:center;cursor:pointer;border-left:solid 1px #E5E4E4;border-right:solid 1px #E5E4E4}.top-block-preview-collapser::before{content:\" \";width:60px;height:10px;background-color:#f3f1ef;position:absolute;top:-1px}\n\n/*# sourceMappingURL=taoQtiTestPreviewer/previewer/component/topBlock/css/topBlock.css.map */.devices-previewer{width:100%;height:100%}.devices-previewer:not(.disabled)[data-type=\"desktop\"],.devices-previewer:not(.disabled)[data-type=\"mobile\"]{overflow:hidden}.devices-previewer:not(.disabled)[data-type=\"desktop\"] .preview-container,.devices-previewer:not(.disabled)[data-type=\"mobile\"] .preview-container{position:relative}.devices-previewer:not(.disabled)[data-type=\"desktop\"] .preview-frame,.devices-previewer:not(.disabled)[data-type=\"mobile\"] .preview-frame{position:relative;border:3px #aaa ridge;background:#5a5a5a;background:linear-gradient(135deg, #5a5a5a 0%, #565656 7%, #444 15%, #141414 30%);-webkit-box-shadow:5px 5px 10px 0 rgba(0,0,0,0.7);-moz-box-shadow:5px 5px 10px 0 rgba(0,0,0,0.7);-ms-box-shadow:5px 5px 10px 0 rgba(0,0,0,0.7);-o-box-shadow:5px 5px 10px 0 rgba(0,0,0,0.7);box-shadow:5px 5px 10px 0 rgba(0,0,0,0.7)}.devices-previewer:not(.disabled)[data-type=\"desktop\"] .preview-content,.devices-previewer:not(.disabled)[data-type=\"mobile\"] .preview-content{background:#fff;border-radius:3px;border:2px solid;border-color:#444 #999 #999 #444;overflow:auto}.devices-previewer:not(.disabled)[data-type=\"mobile\"] .preview-frame{border-radius:25px;padding:40px}.devices-previewer:not(.disabled)[data-type=\"desktop\"] .preview-frame{border-radius:5px;padding:30px}\n\n/*# sourceMappingURL=taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesPreviewer.css.map */.devices-selector{display:-ms-flex;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row}.devices-selector[data-type=\"standard\"] .desktop-selector,.devices-selector[data-type=\"standard\"] .mobile-selector,.devices-selector[data-type=\"standard\"] .orientation-selector{display:none}.devices-selector[data-type=\"desktop\"] .mobile-selector,.devices-selector[data-type=\"desktop\"] .orientation-selector{display:none}.devices-selector[data-type=\"mobile\"] .desktop-selector{display:none}.devices-selector .selector{display:inline-block;margin-top:0.3em}.devices-selector .selector:not(:last-child){margin-right:1rem}.devices-selector .selector select{overflow:visible}.devices-selector .selector .select2-container{text-shadow:none}\n\n/*# sourceMappingURL=taoQtiTestPreviewer/previewer/plugins/tools/scale/component/css/devicesSelector.css.map */.previewer-test-component{background:inherit}.previewer-test-component.fullpage{position:absolute;top:0;left:0;right:0;bottom:64px;z-index:1000}.previewer-test-component.fullpage .item-previewer-scope{height:100vh}.previewer-test-component.readonly .qti-item::before{content:' ';position:absolute;top:0;left:0;right:0;bottom:0;z-index:100000}.previewer-test-component.hideactionbars .test-sidebar{height:100%}.previewer-test-component.hideactionbars .action-bar{display:none}.previewer-test-component #preview-logo{margin:6px 30px 6px 30px;display:block;max-width:200px;height:52px;background:transparent}.previewer-test-component footer{z-index:10000;position:relative;font-size:11px;padding:10px;border-top:1px #ddd solid}\n\n/*# sourceMappingURL=taoQtiTestPreviewer/previewer/component/test/css/qtiTest.css.map */"),define("taoQtiTestPreviewer/loader/qtiPreviewer.bundle",function(){}),define("taoQtiTestPreviewer/loader/qtiPreviewer.min",["taoItems/loader/taoItemsRunner.min","taoTests/loader/taoTestsRunner.min","taoQtiItem/loader/taoQtiItemRunner.min","taoQtiTest/loader/taoQtiTestRunner.min","taoQtiTest/loader/testPlugins.min"],function(){}); //# sourceMappingURL=qtiPreviewer.min.js.map