diff --git a/migrations/Version202209151238261465_qtiItemPci.php b/migrations/Version202209151238261465_qtiItemPci.php
new file mode 100644
index 00000000..186d7820
--- /dev/null
+++ b/migrations/Version202209151238261465_qtiItemPci.php
@@ -0,0 +1,42 @@
+addReport(
+ $this->propagate(
+ new RegisterPciMathEntry()
+ )(
+ ['2.0.3']
+ )
+ );
+
+ }
+
+ public function down(Schema $schema): void
+ {
+ throw new IrreversibleMigration(
+ 'In order to undo this migration, please revert the client-side changes and run ' . RegisterPciMathEntry::class
+ );
+
+ }
+}
diff --git a/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js b/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js
index 870d8da5..187dd4a5 100644
--- a/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js
+++ b/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js
@@ -303,10 +303,9 @@ define([
}
MathEntryInteractionStateResponse.prototype.inGapMode = function inGapMode() {
- var self = this,
- interaction = self.widget.element;
-
- return interaction.prop('useGapExpression');
+ var interaction = this.widget.element;
+ var useGapExpression = interaction.prop('useGapExpression');
+ return useGapExpression && useGapExpression !== 'false' || false;
}
return MathEntryInteractionStateResponse;
diff --git a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.json b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.json
index e766da5a..298b78d8 100644
--- a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.json
+++ b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.json
@@ -8,7 +8,7 @@
"label": "Math entry",
"short": "Math entry",
"description": "Allow test taker to type math formulas",
- "version": "2.0.2",
+ "version": "2.0.3",
"author": "Christophe Noël",
"email": "christophe@taotesting.com",
"tags": [
diff --git a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js
index 639ebccf..fe6ce7fa 100644
--- a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js
+++ b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js
@@ -1 +1,1274 @@
-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)}define("tpl!mathEntryInteraction/creator/tpl/propertiesForm",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){function program1(){return"checked=\"checked\""}this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;return buffer+="
\n \n \n
"+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options):helperMissing.call(depth0,"__","The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.",options)))+"
"
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.", options) : helperMissing.call(depth0, "__", "The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\"_\") and contain only Letters, underscores, hyphens (\"-\"), period (\".\", a.k.a. full-stop), Digits, CombiningChars and Extenders.", options)))
+ + "
";
+ return buffer;
+ });
+});
+
+/**
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; under version 2
+ * of the License (non-upgradable).
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright (c) 2016-2021 (original work) Open Assessment Technologies SA;
+ *
+ * @author Christophe Noël
+ *
+ */
+
+define('mathEntryInteraction/imsPciCreator',[
+ 'lodash',
+ 'mathEntryInteraction/creator/widget/Widget',
+ 'tpl!mathEntryInteraction/creator/tpl/markup'
+], function (_, Widget, markupTpl) {
+ 'use strict';
+
+ var _typeIdentifier = 'mathEntryInteraction';
+
+ var mathEntryInteractionCreator = {
+ /**
+ * (required) Get the typeIdentifier of the custom interaction
+ *
+ * @returns {String}
+ */
+ getTypeIdentifier: function getTypeIdentifier() {
+ return _typeIdentifier;
+ },
+ /**
+ * (required) Get the widget prototype
+ * Used in the renderer
+ *
+ * @returns {Object} Widget
+ */
+ getWidget: function getWidget() {
+ return Widget;
+ },
+ /**
+ * (optional) Get the default properties values of the pci.
+ * Used on new pci instance creation
+ *
+ * @returns {Object}
+ */
+ getDefaultProperties: function getDefaultProperties() {
+ return {
+ authorizeWhiteSpace: 'false',
+ useGapExpression: 'false',
+ inResponseState: 'false',
+ gapExpression: '',
+ gapStyle: '',
+ focusOnDenominator: false,
+
+ tool_frac: 'true',
+ tool_sqrt: 'true',
+ tool_exp: 'true',
+ tool_log: 'true',
+ tool_ln: 'true',
+ tool_e: 'true',
+ tool_infinity: 'true',
+ tool_lbrack: 'true',
+ tool_rbrack: 'true',
+ tool_pi: 'true',
+ tool_cos: 'true',
+ tool_sin: 'true',
+ tool_lte: 'true',
+ tool_gte: 'true',
+ tool_times: 'true',
+ tool_divide: 'true',
+ tool_plusminus: 'true',
+ tool_angle: 'true',
+ tool_minus: 'true',
+ tool_plus: 'true',
+ tool_equal: 'true',
+ tool_lower: 'true',
+ tool_greater: 'true',
+ tool_subscript: 'true',
+ tool_lbrace: 'true',
+ tool_rbrace: 'true',
+ tool_lparen: 'true',
+ tool_rparen: 'true',
+ tool_integral: 'true',
+ tool_timesdot: 'true',
+ tool_triangle: 'true',
+ tool_similar: 'true',
+ tool_paral: 'true',
+ tool_perp: 'true',
+ tool_inmem: 'true',
+ tool_ninmem: 'true',
+ tool_union: 'true',
+ tool_intersec: 'true',
+ allowNewLine: 'false',
+ enableAutoWrap: 'false'
+ };
+ },
+ /**
+ * (optional) Callback to execute on the
+ * Used on new pci instance creation
+ *
+ * @returns {Object}
+ */
+ afterCreate: function afterCreate(pci) {
+ //do some stuff
+ },
+ /**
+ * (required) Gives the qti pci xml template
+ *
+ * @returns {function} handlebar template
+ */
+ getMarkupTemplate: function getMarkupTemplate() {
+ return markupTpl;
+ },
+ /**
+ * (optional) Allows passing additional data to xml template
+ *
+ * @returns {function} handlebar template
+ */
+ getMarkupData: function getMarkupData(pci, defaultData) {
+ defaultData.prompt = pci.data('prompt');
+ return defaultData;
+ }
+ };
+
+ //since we assume we are in a tao context, there is no use to expose the a global object for lib registration
+ //all libs should be declared here
+ return mathEntryInteractionCreator;
+});
+
+define(['mathEntryInteraction/imsPciCreator'],function(IMSPCI){return IMSPCI});
+
+//# sourceMappingURL=imsPciCreator.min.js.map
\ No newline at end of file
diff --git a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js.map b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js.map
index 48635938..d48fbfac 100644
--- a/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js.map
+++ b/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.min.js.map
@@ -1 +1,38 @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A,CAKAC,6BAMAC,+CACA,4BACA,CARA,CAeAC,+BACA,aACA,CAjBA,CAwBAC,qDACA,OACAjF,2BADA,CAEAC,wBAFA,CAGAiF,uBAHA,CAIAnB,gBAJA,CAKAnB,WALA,CAMA1C,qBANA,CAQAC,gBARA,CASAC,gBATA,CAUAC,eAVA,CAWAC,eAXA,CAYAC,cAZA,CAaAC,aAbA,CAcAC,oBAdA,CAeA0E,kBAfA,CAgBAC,kBAhBA,CAiBAzE,cAjBA,CAkBAC,eAlBA,CAmBAC,eAnBA,CAoBAC,eApBA,CAqBAC,eArBA,CAsBAC,iBAtBA,CAuBAC,kBAvBA,CAwBAC,qBAxBA,CAyBAG,iBAzBA,CA0BAC,iBA1BA,CA2BAC,gBA3BA,CA4BAC,iBA5BA,CA6BAC,iBA7BA,CA8BAC,mBA9BA,CA+BAC,qBA/BA,CAgCA0D,kBAhCA,CAiCAC,kBAjCA,CAkCAC,kBAlCA,CAmCAC,kBAnCA,CAoCA5D,oBApCA,CAqCAC,oBArCA,CAsCAC,oBAtCA,CAuCAC,mBAvCA,CAwCAC,iBAxCA,CAyCAC,gBAzCA,CA0CAC,iBA1CA,CA2CAC,kBA3CA,CA4CAC,iBA5CA,CA6CAC,oBA7CA,CA8CAC,oBA9CA,CA+CAC,sBA/CA,CAiDA,CA1EA,CAiFAkD,sCAEA,CAnFA,CAyFAC,+CACA,gBACA,CA3FA,CAiGAC,sDAEA,MADAC,sCACA,YACA,CApGA,CALA,CA8GA,kCACA,CAnHA,C,CAqHAlI,MC1IA,wE","names":["define","helpers","data","buffer","escapeExpression","helper","stack1","loaded","Promise","moduleLoader","add","load","then","MathJax","postRender","window","$element","defaultValue","interaction","$addGapBtn","MathEntryInteractionStateQuestion","$prompt","containerEditor","change","mathInPrompt","markup","markupSelector","related","areaBroker","toBoolean","simpleEditor","$gapStyleBox","$gapStyleSelector","_widget","$form","response","serial","identifier","authorizeWhiteSpace","useGapExpression","focusOnDenominator","tool_frac","tool_sqrt","tool_exp","tool_log","tool_ln","tool_e","tool_infinity","squarebkts","tool_pi","tool_cos","tool_sin","tool_lte","tool_gte","tool_times","tool_divide","tool_plusminus","roundbkts","curlybkts","tool_angle","tool_minus","tool_plus","tool_equal","tool_lower","tool_greater","tool_subscript","tool_integral","tool_timesdot","tool_triangle","tool_similar","tool_paral","tool_perp","tool_inmem","tool_ninmem","tool_union","tool_intersec","allowNewLine","enableAutoWrap","formElement","self","i","configChangeCallBack","gapStyle","width","minimumResultsForSearch","val","trigger","$container","$toolbar","Correct","hb","__","_","$","stateFactory","Map","answerFormTpl","addAnswerOptionBtn","MathEntryInteractionStateResponse","$responseForm","$addAnswerBtn","gapExpression","gapCount","newCorrectAnswer","mapEntries","$entryConfig","$editButtons","e","base","string","$deleteButtons","responseDeclaration","MathEntryInteractionWidget","Widget","$interaction","_typeIdentifier","mathEntryInteractionCreator","getTypeIdentifier","getWidget","getDefaultProperties","inResponseState","tool_lbrack","tool_rbrack","tool_lbrace","tool_rbrace","tool_lparen","tool_rparen","afterCreate","getMarkupTemplate","getMarkupData","defaultData"],"sources":["../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/propertiesForm!tpl","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/addGapBtn!tpl","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/helper/mathInPrompt.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Question.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Correct.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/answerForm!tpl","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/addAnswerOption!tpl","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/states.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/Widget.js","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/markup!tpl","../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.js","../build/config-wrap-end-default.js"],"sourcesContent":["\ndefine('tpl!mathEntryInteraction/creator/tpl/propertiesForm', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType=\"function\", self=this;\n\nfunction program1(depth0,data) {\n \n \n return \"checked=\\\"checked\\\"\";\n }\n\nfunction program3(depth0,data) {\n \n \n return \"style=\\\"display:none\\\"\";\n }\n\n buffer += \"
\\n \\n \\n
\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\\\"_\\\") and contain only Letters, underscores, hyphens (\\\"-\\\"), period (\\\".\\\", a.k.a. full-stop), Digits, CombiningChars and Extenders.\", options) : helperMissing.call(depth0, \"__\", \"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\\\"_\\\") and contain only Letters, underscores, hyphens (\\\"-\\\"), period (\\\".\\\", a.k.a. full-stop), Digits, CombiningChars and Extenders.\", options)))\n + \"
\";\n return buffer;\n });\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2022 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/helper/mathInPrompt',['core/moduleLoader'], function (moduleLoader) {\n 'use strict';\n\n let MathJax;\n let loaded = false;\n\n /***\n * lazy-load MathJax dependency\n * @returns {Promise}\n */\n function load() {\n if (loaded) {\n return Promise.resolve();\n }\n return moduleLoader([], () => true)\n .add({ module: 'mathJax', category: 'mathEntryInteraction' })\n .load()\n .then(loadedModule => {\n loaded = true;\n MathJax = loadedModule && loadedModule.length ? loadedModule[0] : void 0;\n\n /**\n * Do not wait between rendering each individual math element\n * http://docs.mathjax.org/en/latest/api/hub.html\n * @see https://github.com/oat-sa/tao-item-runner-qti-fe/blob/master/src/qtiCommonRenderer/renderers/Math.js\n */\n if (MathJax && MathJax.Hub) {\n MathJax.Hub.processSectionDelay = 0;\n }\n });\n }\n\n const mathInPrompt = {\n /**\n * On dom element containing `` MathML markup,\n * run MathJax renderer (\"typeset\" it)\n * @param {Object} $element\n * @returns {Promise}\n */\n postRender: function postRender($element) {\n if ($element.find('math').length === 0) {\n return Promise.resolve();\n }\n return load().then(() => {\n if (MathJax && MathJax.Hub && typeof MathJax.Hub.Queue === 'function') {\n /**\n * MathJax needs to be exported globally to integrate with tools like TTS, it's weird...\n * @see https://github.com/oat-sa/tao-item-runner-qti-fe/blob/master/src/qtiCommonRenderer/renderers/Math.js\n */\n if (!window.MathJax) {\n window.MathJax = MathJax;\n }\n if ($element.length) {\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, $element[0]]);\n }\n }\n });\n }\n };\n\n return mathInPrompt;\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016-2017 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/states/Question',[\n 'jquery',\n 'i18n',\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/interactions/states/Question',\n 'taoQtiItem/qtiCreator/widgets/helpers/formElement',\n 'taoQtiItem/qtiCreator/editor/simpleContentEditableElement',\n 'taoQtiItem/qtiCreator/editor/containerEditor',\n 'tpl!mathEntryInteraction/creator/tpl/propertiesForm',\n 'tpl!mathEntryInteraction/creator/tpl/addGapBtn',\n 'mathEntryInteraction/creator/helper/mathInPrompt'\n], function($, __, stateFactory, Question, formElement, simpleEditor, containerEditor, formTpl, addGapBtnTpl, mathInPrompt){\n 'use strict';\n\n var $addGapBtn = $(addGapBtnTpl());\n\n var MathEntryInteractionStateQuestion = stateFactory.extend(Question, function create(){\n var $container = this.widget.$container,\n $prompt = $container.find('.prompt'),\n interaction = this.widget.element;\n\n containerEditor.create($prompt, {\n change : function(text){\n interaction.data('prompt', text);\n interaction.updateMarkup();\n\n if (!$prompt.is('[data-html-editable-container=\"true\"]')) {\n mathInPrompt.postRender($prompt);\n }\n },\n markup : interaction.markup,\n markupSelector : '.prompt',\n related : interaction,\n areaBroker: this.widget.getAreaBroker()\n });\n\n if (toBoolean(interaction.prop('useGapExpression'), false)) {\n this.createAddGapBtn();\n }\n\n this.addMathFieldListener();\n\n }, function exit(){\n var $container = this.widget.$container,\n $prompt = $container.find('.prompt');\n\n simpleEditor.destroy($container);\n containerEditor.destroy($prompt);\n\n this.removeAddGapBtn();\n });\n\n function toBoolean(value, defaultValue) {\n if (typeof(value) === \"undefined\") {\n return defaultValue;\n } else {\n return (value === true || value === \"true\");\n }\n }\n /**\n * Callback for configuration change\n * @param {Object} interaction - the current interaction\n * @param {String} value - new value of the changed property\n * @param {String} name - changed property\n */\n function configChangeCallBack(interaction, value, name) {\n interaction.prop(name, value);\n interaction.triggerPci('configChange', [interaction.getProperties()]);\n }\n\n MathEntryInteractionStateQuestion.prototype.initForm = function initForm(){\n\n var self = this,\n _widget = this.widget,\n $form = _widget.$form,\n interaction = _widget.element,\n response = interaction.getResponseDeclaration(),\n $gapStyleBox,\n $gapStyleSelector;\n\n //render the form using the form template\n $form.html(formTpl({\n serial : response.serial,\n identifier : interaction.attr('responseIdentifier'),\n\n authorizeWhiteSpace: toBoolean(interaction.prop('authorizeWhiteSpace'), false),\n useGapExpression: toBoolean(interaction.prop('useGapExpression'), false),\n focusOnDenominator: toBoolean(interaction.prop('focusOnDenominator'), false),\n\n tool_frac: toBoolean(interaction.prop('tool_frac'), true),\n tool_sqrt: toBoolean(interaction.prop('tool_sqrt'), true),\n tool_exp: toBoolean(interaction.prop('tool_exp'), true),\n tool_log: toBoolean(interaction.prop('tool_log'), true),\n tool_ln: toBoolean(interaction.prop('tool_ln'), true),\n tool_e: toBoolean(interaction.prop('tool_e'), true),\n tool_infinity: toBoolean(interaction.prop('tool_infinity'),true),\n squarebkts: toBoolean(interaction.prop('tool_rbrack'), true) && toBoolean(interaction.prop('tool_lbrack'), true),\n tool_pi: toBoolean(interaction.prop('tool_pi'), true),\n tool_cos: toBoolean(interaction.prop('tool_cos'), true),\n tool_sin: toBoolean(interaction.prop('tool_sin'), true),\n tool_lte: toBoolean(interaction.prop('tool_lte'), true),\n tool_gte: toBoolean(interaction.prop('tool_gte'), true),\n tool_times: toBoolean(interaction.prop('tool_times'), true),\n tool_divide: toBoolean(interaction.prop('tool_divide'), true),\n tool_plusminus: toBoolean(interaction.prop('tool_plusminus'),true),\n roundbkts: toBoolean(interaction.prop('tool_rparen'), true) && toBoolean(interaction.prop('tool_lparen'), true),\n curlybkts: toBoolean(interaction.prop('tool_rbrace'), true) && toBoolean(interaction.prop('tool_lbrace'), true),\n tool_angle: toBoolean(interaction.prop('tool_angle'), true),\n tool_minus: toBoolean(interaction.prop('tool_minus'), true),\n tool_plus: toBoolean(interaction.prop('tool_plus'), true),\n tool_equal: toBoolean(interaction.prop('tool_equal'), true),\n tool_lower: toBoolean(interaction.prop('tool_lower'), true),\n tool_greater: toBoolean(interaction.prop('tool_greater'), true),\n tool_subscript: toBoolean(interaction.prop('tool_subscript'),true),\n tool_integral: toBoolean(interaction.prop('tool_integral'),true),\n tool_timesdot: toBoolean(interaction.prop('tool_timesdot'),true),\n tool_triangle: toBoolean(interaction.prop('tool_triangle'),true),\n tool_similar: toBoolean(interaction.prop('tool_similar'), true),\n tool_paral: toBoolean(interaction.prop('tool_paral'), true),\n tool_perp: toBoolean(interaction.prop('tool_perp'), true),\n tool_inmem: toBoolean(interaction.prop('tool_inmem'), true),\n tool_ninmem: toBoolean(interaction.prop('tool_ninmem'), true),\n tool_union: toBoolean(interaction.prop('tool_union'), true),\n tool_intersec: toBoolean(interaction.prop('tool_intersec'),true),\n allowNewLine: toBoolean(interaction.prop('allowNewLine'), false),\n enableAutoWrap: toBoolean(interaction.prop('enableAutoWrap'), false)\n }));\n\n //init form javascript\n formElement.initWidget($form);\n\n //init data change callbacks\n formElement.setChangeCallbacks($form, interaction, {\n identifier: function(i, value){\n response.id(value);\n interaction.attr('responseIdentifier', value);\n },\n useGapExpression: function gapChangeCallback(i, value) {\n if (toBoolean(value, false)) {\n self.createAddGapBtn();\n $gapStyleBox.show();\n } else {\n i.prop('gapExpression', '');\n self.removeAddGapBtn();\n $gapStyleBox.hide();\n }\n\n response.attr('cardinality', 'single');\n configChangeCallBack(i, value, 'useGapExpression');\n },\n gapStyle: function gapStyleChangeCallback(i, newStyle) {\n\n i.prop('gapStyle', newStyle);\n\n configChangeCallBack(i, newStyle, 'gapStyle');\n },\n authorizeWhiteSpace: configChangeCallBack,\n focusOnDenominator: configChangeCallBack,\n\n tool_frac: configChangeCallBack,\n tool_sqrt: configChangeCallBack,\n tool_exp: configChangeCallBack,\n tool_log: configChangeCallBack,\n tool_ln: configChangeCallBack,\n tool_e: configChangeCallBack,\n tool_infinity: configChangeCallBack,\n tool_pi: configChangeCallBack,\n tool_cos: configChangeCallBack,\n tool_sin: configChangeCallBack,\n tool_lte: configChangeCallBack,\n tool_gte: configChangeCallBack,\n tool_times: configChangeCallBack,\n tool_divide: configChangeCallBack,\n tool_plusminus: configChangeCallBack,\n tool_angle: configChangeCallBack,\n tool_minus: configChangeCallBack,\n tool_plus: configChangeCallBack,\n tool_equal: configChangeCallBack,\n tool_lower: configChangeCallBack,\n tool_greater: configChangeCallBack,\n tool_subscript: configChangeCallBack,\n tool_integral: configChangeCallBack,\n tool_timesdot: configChangeCallBack,\n tool_triangle: configChangeCallBack,\n tool_similar: configChangeCallBack,\n tool_paral: configChangeCallBack,\n tool_perp: configChangeCallBack,\n tool_inmem: configChangeCallBack,\n tool_ninmem: configChangeCallBack,\n tool_union: configChangeCallBack,\n tool_intersec: configChangeCallBack,\n\n squarebkts: function squarebktsChangeCallBack(i, value) {\n i.prop('tool_lbrack', value);\n i.prop('tool_rbrack', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n roundbkts: function roundbktsChangeCallBack(i, value) {\n i.prop('tool_lparen', value);\n i.prop('tool_rparen', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n curlybkts: function curlybktsChangeCallBack(i, value) {\n i.prop('tool_lbrace', value);\n i.prop('tool_rbrace', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n\n allowNewLine: configChangeCallBack,\n enableAutoWrap: configChangeCallBack\n });\n\n\n $gapStyleBox = $form.find('.mathgap-style-box');\n $gapStyleSelector = $gapStyleBox.find('[data-mathgap-style]');\n\n $gapStyleSelector.select2({\n width: '100%',\n minimumResultsForSearch: Infinity\n })\n .val(interaction.prop('gapStyle'))\n .trigger('change');\n };\n\n /**\n * Change callback for editable math field\n */\n\n MathEntryInteractionStateQuestion.prototype.addMathFieldListener = function addMathFieldListener() {\n var _widget = this.widget,\n interaction = _widget.element;\n\n interaction.onPci('responseChange', function(latex) {\n if (toBoolean(interaction.prop('useGapExpression'), false)) {\n interaction.prop('gapExpression', latex);\n } else {\n interaction.prop('gapExpression', '');\n }\n });\n };\n\n /**\n * Display the \"Add Gap\" button\n */\n MathEntryInteractionStateQuestion.prototype.createAddGapBtn = function createAddGapBtn() {\n var _widget = this.widget,\n $container = _widget.$container,\n $toolbar = $container.find('.toolbar'),\n interaction =_widget.element;\n\n if ($toolbar.length) {\n $toolbar.after($addGapBtn);\n $addGapBtn.on('click', function() {\n interaction.getResponseDeclaration().removeMapEntries();\n interaction.triggerPci('addGap');\n });\n }\n };\n\n /**\n * Remove the \"Add Gap\" button from the DOM\n */\n MathEntryInteractionStateQuestion.prototype.removeAddGapBtn = function removeAddGapBtn() {\n $addGapBtn.off('click');\n $addGapBtn.remove();\n };\n\n return MathEntryInteractionStateQuestion;\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2021 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/widget/states/Correct',[\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/states/Correct'\n], function (stateFactory, Correct) {\n 'use strict';\n\n var InteractionStateCorrect = stateFactory.create(\n Correct,\n function init() {\n this.widget.element.getResponseDeclaration().setTemplate('MAP_RESPONSE');\n this.widget.changeState('map');\n },\n function exit() {\n }\n );\n\n return InteractionStateCorrect;\n});\n\n","\ndefine('tpl!mathEntryInteraction/creator/tpl/answerForm', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, functionType=\"function\", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;\n\nfunction program1(depth0,data) {\n \n var buffer = \"\", stack1, helper, options;\n buffer += \"\\n
\";\n return buffer;\n });\n});\n\n","\ndefine('tpl!mathEntryInteraction/creator/tpl/addAnswerOption', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;\n\n\n buffer += \"\";\n return buffer;\n });\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2021 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/widget/states/Map',[\n 'handlebars',\n 'i18n',\n 'lodash',\n 'jquery',\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/states/Map',\n 'taoQtiItem/qtiCreator/widgets/helpers/formElement',\n 'tpl!mathEntryInteraction/creator/tpl/answerForm',\n 'tpl!mathEntryInteraction/creator/tpl/addAnswerOption',\n], function (\n hb,\n __,\n _,\n $,\n stateFactory,\n Map,\n formElement,\n answerFormTpl,\n addAnswerOptionBtn\n) {\n 'use strict';\n var CORRECT_ANSWER_VALUE = 1;\n hb.registerHelper('increaseIndex', function (value, options) {\n return parseInt(value) + 1;\n });\n\n var MathEntryInteractionStateResponse = stateFactory.create(\n Map,\n function init() {\n this.initGlobalVariables();\n this.initForm();\n },\n function exit() {\n this.emptyGapFields();\n this.toggleResponseMode(false);\n this.saveAnswers();\n this.removeResponseChangeEventListener();\n this.removeEditDeleteListeners();\n this.removeAddButtonListener();\n this.destroyForm();\n }\n );\n\n\n MathEntryInteractionStateResponse.prototype.initGlobalVariables = function initGlobalVariables() {\n var self = this,\n interaction = self.widget.element;\n self.activeEditId = null;\n self.correctResponses = [];\n\n if (this.inGapMode(self) === true) {\n interaction = self.widget.element;\n self.gapTemplate = interaction.prop('gapExpression');\n }\n }\n\n MathEntryInteractionStateResponse.prototype.initForm = function initForm() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm;\n\n this.initResponseChangeEventListener();\n self.correctResponses = this.getExistingCorrectAnswerOptions();\n $responseForm.html(addAnswerOptionBtn());\n this.initAddAnswerButton();\n this.renderForm(self.correctResponses);\n }\n\n MathEntryInteractionStateResponse.prototype.initAddAnswerButton = function initAddAnswerButton() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $addAnswerBtn = $responseForm.find($('.add-answer-option'));\n\n $addAnswerBtn.on('click', function () {\n var newCorrectAnswer;\n\n if (self.inGapMode() === true) {\n self.emptyGapFields();\n var gapExpression = interaction.prop('gapExpression');\n var gapCount = (gapExpression.match(/\\\\taoGap/g) || []).length;\n if (gapCount > 0) {\n newCorrectAnswer = [];\n for (var i = 0; i < gapCount; i++) {\n newCorrectAnswer.push(' ');\n }\n\n newCorrectAnswer = newCorrectAnswer.join(',');\n } else {\n newCorrectAnswer = '';\n }\n } else {\n newCorrectAnswer = '';\n self.toggleResponseMode(false);\n }\n\n self.correctResponses.push(newCorrectAnswer);\n self.renderForm(self.correctResponses);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.getExistingCorrectAnswerOptions = function getExistingCorrectAnswerOptions() {\n var self = this,\n interaction = self.widget.element;\n\n var mapEntries = interaction.getResponseDeclaration().getMapEntries();\n return _.keys(mapEntries) || [];\n }\n\n MathEntryInteractionStateResponse.prototype.initResponseChangeEventListener = function initResponseChangeEventListener() {\n var self = this,\n interaction = self.widget.element;\n\n interaction.onPci('responseChange', function (latex) {\n if (self.inGapMode(self) === false && self.activeEditId !== null) {\n self.correctResponses[self.activeEditId] = latex;\n } else if (self.inGapMode(self) === true && self.activeEditId !== null) {\n var response = interaction.getResponse();\n if (response !== null) {\n self.correctResponses[self.activeEditId] = response.base.string;\n }\n }\n });\n }\n\n MathEntryInteractionStateResponse.prototype.removeResponseChangeEventListener = function removeResponseChangeEventListener() {\n var self = this,\n interaction = self.widget.element;\n\n interaction.offPci('responseChange');\n }\n\n MathEntryInteractionStateResponse.prototype.initEditingOptions = function initEditingOptions() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $entryConfig = $responseForm.find('.entry-config'),\n $editButtons = $entryConfig.find('.answer-edit');\n\n $editButtons.click(function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n self.toggleResponseMode(true);\n var selectedEditId = parseInt($(e.target).closest('div').attr('data-index'));\n\n if (self.activeEditId !== selectedEditId) {\n\n if (self.inGapMode() === true) {\n self.activeEditId = selectedEditId;\n var response = self.getGapResponseObject(self.correctResponses[self.activeEditId]);\n interaction.triggerPci('latexGapInput', [response]);\n } else {\n self.activeEditId = selectedEditId;\n interaction.triggerPci('latexInput', [self.correctResponses[self.activeEditId]]);\n }\n } else {\n self.emptyGapFields();\n }\n });\n }\n\n // forming gap response object to be further processed by the latexGapInput event\n MathEntryInteractionStateResponse.prototype.getGapResponseObject = function getGapResponseObject(response) {\n return {\n base: {\n string: response.split(',')\n }\n }\n }\n\n // removing all saved map entries\n MathEntryInteractionStateResponse.prototype.clearMapEntries = function clearMapEntries() {\n var self = this,\n interaction = self.widget.element,\n response = interaction.getResponseDeclaration(),\n mapEntries = response.getMapEntries();\n\n _.keys(mapEntries).forEach(function (mapKey) {\n response.removeMapEntry(mapKey, true);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.initDeletingOptions = function initDeletingOptions() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $entryConfig = $responseForm.find('.entry-config'),\n $deleteButtons = $entryConfig.find('.answer-delete');\n\n $deleteButtons.click(function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var id = parseInt($(e.target).closest('div').attr('data-index'));\n\n if (self.inGapMode() === true) {\n self.activeEditId = id;\n self.emptyGapFields();\n } else {\n self.activeEditId = null;\n self.toggleResponseMode(false);\n }\n\n self.correctResponses.splice(id, 1);\n self.renderForm(self.correctResponses);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.renderForm = function renderForm(correctAnswerOptions) {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n this.removeEditDeleteListeners();\n $responseForm.find('.mathEntryInteraction').remove();\n $responseForm.append(answerFormTpl({correctAnswerEntries: correctAnswerOptions}));\n this.initDeletingOptions();\n this.initEditingOptions();\n }\n\n /**\n * remove all event listeners to avoid any potential memory leaks\n */\n MathEntryInteractionStateResponse.prototype.removeEditDeleteListeners = function removeEditDeleteListeners() {\n var self = this,\n $entryConfig = self.widget.$responseForm.find('.entry-config');\n\n $entryConfig.find('.answer-edit').off('click');\n $entryConfig.find('.answer-delete').off('click');\n }\n\n MathEntryInteractionStateResponse.prototype.removeAddButtonListener = function removeAddButtonListener() {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n $responseForm.find($('.add-answer-option')).off('click');\n }\n\n MathEntryInteractionStateResponse.prototype.destroyForm = function destroyForm() {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n $responseForm.find('.mathEntryInteraction').remove();\n }\n\n MathEntryInteractionStateResponse.prototype.saveAnswers = function saveAnswers() {\n var self = this,\n interaction = self.widget.element,\n responseDeclaration = interaction.getResponseDeclaration();\n\n this.clearMapEntries();\n\n if (this.inGapMode() === true) {\n self.correctResponses = self.correctResponses.filter(function (response) {\n return response.split(',').indexOf('') === -1;\n });\n }\n\n self.correctResponses.forEach(function (response) {\n responseDeclaration.setMapEntry(response, CORRECT_ANSWER_VALUE, false);\n });\n }\n\n /**\n * if in gap mode: will empty all the gap fields\n */\n MathEntryInteractionStateResponse.prototype.emptyGapFields = function emptyGapFields() {\n var self = this,\n interaction = self.widget.element;\n\n if (this.inGapMode() === true) {\n self.activeEditId = null;\n\n interaction.prop('gapExpression', self.gapTemplate);\n this.toggleResponseMode(false);\n }\n }\n\n MathEntryInteractionStateResponse.prototype.toggleResponseMode = function toggleResponseMode(value) {\n var self = this,\n interaction = self.widget.element;\n\n if (interaction.prop('inResponseState') !== value) {\n interaction.prop('inResponseState', value);\n interaction.triggerPci('configChange', [interaction.getProperties()]);\n }\n }\n\n MathEntryInteractionStateResponse.prototype.inGapMode = function inGapMode() {\n var self = this,\n interaction = self.widget.element;\n\n return interaction.prop('useGapExpression');\n }\n\n return MathEntryInteractionStateResponse;\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/states/states',[\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/states',\n 'mathEntryInteraction/creator/widget/states/Question',\n 'mathEntryInteraction/creator/widget/states/Correct',\n 'mathEntryInteraction/creator/widget/states/Map'\n], function(factory, states){\n 'use strict';\n\n return factory.createBundle(states, arguments);\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/Widget',[\n 'taoQtiItem/qtiCreator/widgets/interactions/customInteraction/Widget',\n 'mathEntryInteraction/creator/widget/states/states'\n], function(Widget, states){\n 'use strict';\n\n var MathEntryInteractionWidget = Widget.clone();\n\n MathEntryInteractionWidget.initCreator = function initCreator() {\n var $interaction;\n\n this.registerStates(states);\n\n Widget.initCreator.call(this);\n\n $interaction = this.$container.find('.mathEntryInteraction');\n if ($interaction.length) {\n $interaction.addClass('tao-qti-creator-context');\n }\n };\n\n return MathEntryInteractionWidget;\n});\n","\ndefine('tpl!mathEntryInteraction/creator/tpl/markup', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, functionType=\"function\";\n\n\n buffer += \"
\";\n return buffer;\n });\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016-2021 (original work) Open Assessment Technologies SA;\n *\n * @author Christophe Noël \n *\n */\n\ndefine('mathEntryInteraction/imsPciCreator',[\n 'lodash',\n 'mathEntryInteraction/creator/widget/Widget',\n 'tpl!mathEntryInteraction/creator/tpl/markup'\n], function (_, Widget, markupTpl) {\n 'use strict';\n\n var _typeIdentifier = 'mathEntryInteraction';\n\n var mathEntryInteractionCreator = {\n /**\n * (required) Get the typeIdentifier of the custom interaction\n *\n * @returns {String}\n */\n getTypeIdentifier: function getTypeIdentifier() {\n return _typeIdentifier;\n },\n /**\n * (required) Get the widget prototype\n * Used in the renderer\n *\n * @returns {Object} Widget\n */\n getWidget: function getWidget() {\n return Widget;\n },\n /**\n * (optional) Get the default properties values of the pci.\n * Used on new pci instance creation\n *\n * @returns {Object}\n */\n getDefaultProperties: function getDefaultProperties() {\n return {\n authorizeWhiteSpace: 'false',\n useGapExpression: 'false',\n inResponseState: 'false',\n gapExpression: '',\n gapStyle: '',\n focusOnDenominator: false,\n\n tool_frac: 'true',\n tool_sqrt: 'true',\n tool_exp: 'true',\n tool_log: 'true',\n tool_ln: 'true',\n tool_e: 'true',\n tool_infinity: 'true',\n tool_lbrack: 'true',\n tool_rbrack: 'true',\n tool_pi: 'true',\n tool_cos: 'true',\n tool_sin: 'true',\n tool_lte: 'true',\n tool_gte: 'true',\n tool_times: 'true',\n tool_divide: 'true',\n tool_plusminus: 'true',\n tool_angle: 'true',\n tool_minus: 'true',\n tool_plus: 'true',\n tool_equal: 'true',\n tool_lower: 'true',\n tool_greater: 'true',\n tool_subscript: 'true',\n tool_lbrace: 'true',\n tool_rbrace: 'true',\n tool_lparen: 'true',\n tool_rparen: 'true',\n tool_integral: 'true',\n tool_timesdot: 'true',\n tool_triangle: 'true',\n tool_similar: 'true',\n tool_paral: 'true',\n tool_perp: 'true',\n tool_inmem: 'true',\n tool_ninmem: 'true',\n tool_union: 'true',\n tool_intersec: 'true',\n allowNewLine: 'false',\n enableAutoWrap: 'false'\n };\n },\n /**\n * (optional) Callback to execute on the\n * Used on new pci instance creation\n *\n * @returns {Object}\n */\n afterCreate: function afterCreate(pci) {\n //do some stuff\n },\n /**\n * (required) Gives the qti pci xml template\n *\n * @returns {function} handlebar template\n */\n getMarkupTemplate: function getMarkupTemplate() {\n return markupTpl;\n },\n /**\n * (optional) Allows passing additional data to xml template\n *\n * @returns {function} handlebar template\n */\n getMarkupData: function getMarkupData(pci, defaultData) {\n defaultData.prompt = pci.data('prompt');\n return defaultData;\n }\n };\n\n //since we assume we are in a tao context, there is no use to expose the a global object for lib registration\n //all libs should be declared here\n return mathEntryInteractionCreator;\n});\n\n","define(['mathEntryInteraction/imsPciCreator'],function(IMSPCI){return IMSPCI});\n"]}
\ No newline at end of file
+{
+ "version": 3,
+ "sources": [
+ "../build/config-wrap-start-default.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/propertiesForm!tpl",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/addGapBtn!tpl",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/helper/mathInPrompt.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Question.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Correct.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/answerForm!tpl",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/addAnswerOption!tpl",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/Map.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/states/states.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/widget/Widget.js",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/creator/tpl/markup!tpl",
+ "../../../qtiItemPci/views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.js",
+ "../build/config-wrap-end-default.js"
+ ],
+ "names": [],
+ "mappings": "AAAA;AACA,ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1IA;AACA",
+ "file": "imsPciCreator.min.js",
+ "sourcesContent": [
+ "\n",
+ "\ndefine('tpl!mathEntryInteraction/creator/tpl/propertiesForm', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType=\"function\", self=this;\n\nfunction program1(depth0,data) {\n \n \n return \"checked=\\\"checked\\\"\";\n }\n\nfunction program3(depth0,data) {\n \n \n return \"style=\\\"display:none\\\"\";\n }\n\n buffer += \"
\\n \\n \\n
\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\\\"_\\\") and contain only Letters, underscores, hyphens (\\\"-\\\"), period (\\\".\\\", a.k.a. full-stop), Digits, CombiningChars and Extenders.\", options) : helperMissing.call(depth0, \"__\", \"The identifier of the choice. This identifier must not be used by any other response or item variable. An identifier is a string of characters that must start with a Letter or an underscore (\\\"_\\\") and contain only Letters, underscores, hyphens (\\\"-\\\"), period (\\\".\\\", a.k.a. full-stop), Digits, CombiningChars and Extenders.\", options)))\n + \"
\";\n return buffer;\n });\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2022 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/helper/mathInPrompt',['core/moduleLoader'], function (moduleLoader) {\n 'use strict';\n\n let MathJax;\n let loaded = false;\n\n /***\n * lazy-load MathJax dependency\n * @returns {Promise}\n */\n function load() {\n if (loaded) {\n return Promise.resolve();\n }\n return moduleLoader([], () => true)\n .add({ module: 'mathJax', category: 'mathEntryInteraction' })\n .load()\n .then(loadedModule => {\n loaded = true;\n MathJax = loadedModule && loadedModule.length ? loadedModule[0] : void 0;\n\n /**\n * Do not wait between rendering each individual math element\n * http://docs.mathjax.org/en/latest/api/hub.html\n * @see https://github.com/oat-sa/tao-item-runner-qti-fe/blob/master/src/qtiCommonRenderer/renderers/Math.js\n */\n if (MathJax && MathJax.Hub) {\n MathJax.Hub.processSectionDelay = 0;\n }\n });\n }\n\n const mathInPrompt = {\n /**\n * On dom element containing `` MathML markup,\n * run MathJax renderer (\"typeset\" it)\n * @param {Object} $element\n * @returns {Promise}\n */\n postRender: function postRender($element) {\n if ($element.find('math').length === 0) {\n return Promise.resolve();\n }\n return load().then(() => {\n if (MathJax && MathJax.Hub && typeof MathJax.Hub.Queue === 'function') {\n /**\n * MathJax needs to be exported globally to integrate with tools like TTS, it's weird...\n * @see https://github.com/oat-sa/tao-item-runner-qti-fe/blob/master/src/qtiCommonRenderer/renderers/Math.js\n */\n if (!window.MathJax) {\n window.MathJax = MathJax;\n }\n if ($element.length) {\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, $element[0]]);\n }\n }\n });\n }\n };\n\n return mathInPrompt;\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016-2017 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/states/Question',[\n 'jquery',\n 'i18n',\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/interactions/states/Question',\n 'taoQtiItem/qtiCreator/widgets/helpers/formElement',\n 'taoQtiItem/qtiCreator/editor/simpleContentEditableElement',\n 'taoQtiItem/qtiCreator/editor/containerEditor',\n 'tpl!mathEntryInteraction/creator/tpl/propertiesForm',\n 'tpl!mathEntryInteraction/creator/tpl/addGapBtn',\n 'mathEntryInteraction/creator/helper/mathInPrompt'\n], function($, __, stateFactory, Question, formElement, simpleEditor, containerEditor, formTpl, addGapBtnTpl, mathInPrompt){\n 'use strict';\n\n var $addGapBtn = $(addGapBtnTpl());\n\n var MathEntryInteractionStateQuestion = stateFactory.extend(Question, function create(){\n var $container = this.widget.$container,\n $prompt = $container.find('.prompt'),\n interaction = this.widget.element;\n\n containerEditor.create($prompt, {\n change : function(text){\n interaction.data('prompt', text);\n interaction.updateMarkup();\n\n if (!$prompt.is('[data-html-editable-container=\"true\"]')) {\n mathInPrompt.postRender($prompt);\n }\n },\n markup : interaction.markup,\n markupSelector : '.prompt',\n related : interaction,\n areaBroker: this.widget.getAreaBroker()\n });\n\n if (toBoolean(interaction.prop('useGapExpression'), false)) {\n this.createAddGapBtn();\n }\n\n this.addMathFieldListener();\n\n }, function exit(){\n var $container = this.widget.$container,\n $prompt = $container.find('.prompt');\n\n simpleEditor.destroy($container);\n containerEditor.destroy($prompt);\n\n this.removeAddGapBtn();\n });\n\n function toBoolean(value, defaultValue) {\n if (typeof(value) === \"undefined\") {\n return defaultValue;\n } else {\n return (value === true || value === \"true\");\n }\n }\n /**\n * Callback for configuration change\n * @param {Object} interaction - the current interaction\n * @param {String} value - new value of the changed property\n * @param {String} name - changed property\n */\n function configChangeCallBack(interaction, value, name) {\n interaction.prop(name, value);\n interaction.triggerPci('configChange', [interaction.getProperties()]);\n }\n\n MathEntryInteractionStateQuestion.prototype.initForm = function initForm(){\n\n var self = this,\n _widget = this.widget,\n $form = _widget.$form,\n interaction = _widget.element,\n response = interaction.getResponseDeclaration(),\n $gapStyleBox,\n $gapStyleSelector;\n\n //render the form using the form template\n $form.html(formTpl({\n serial : response.serial,\n identifier : interaction.attr('responseIdentifier'),\n\n authorizeWhiteSpace: toBoolean(interaction.prop('authorizeWhiteSpace'), false),\n useGapExpression: toBoolean(interaction.prop('useGapExpression'), false),\n focusOnDenominator: toBoolean(interaction.prop('focusOnDenominator'), false),\n\n tool_frac: toBoolean(interaction.prop('tool_frac'), true),\n tool_sqrt: toBoolean(interaction.prop('tool_sqrt'), true),\n tool_exp: toBoolean(interaction.prop('tool_exp'), true),\n tool_log: toBoolean(interaction.prop('tool_log'), true),\n tool_ln: toBoolean(interaction.prop('tool_ln'), true),\n tool_e: toBoolean(interaction.prop('tool_e'), true),\n tool_infinity: toBoolean(interaction.prop('tool_infinity'),true),\n squarebkts: toBoolean(interaction.prop('tool_rbrack'), true) && toBoolean(interaction.prop('tool_lbrack'), true),\n tool_pi: toBoolean(interaction.prop('tool_pi'), true),\n tool_cos: toBoolean(interaction.prop('tool_cos'), true),\n tool_sin: toBoolean(interaction.prop('tool_sin'), true),\n tool_lte: toBoolean(interaction.prop('tool_lte'), true),\n tool_gte: toBoolean(interaction.prop('tool_gte'), true),\n tool_times: toBoolean(interaction.prop('tool_times'), true),\n tool_divide: toBoolean(interaction.prop('tool_divide'), true),\n tool_plusminus: toBoolean(interaction.prop('tool_plusminus'),true),\n roundbkts: toBoolean(interaction.prop('tool_rparen'), true) && toBoolean(interaction.prop('tool_lparen'), true),\n curlybkts: toBoolean(interaction.prop('tool_rbrace'), true) && toBoolean(interaction.prop('tool_lbrace'), true),\n tool_angle: toBoolean(interaction.prop('tool_angle'), true),\n tool_minus: toBoolean(interaction.prop('tool_minus'), true),\n tool_plus: toBoolean(interaction.prop('tool_plus'), true),\n tool_equal: toBoolean(interaction.prop('tool_equal'), true),\n tool_lower: toBoolean(interaction.prop('tool_lower'), true),\n tool_greater: toBoolean(interaction.prop('tool_greater'), true),\n tool_subscript: toBoolean(interaction.prop('tool_subscript'),true),\n tool_integral: toBoolean(interaction.prop('tool_integral'),true),\n tool_timesdot: toBoolean(interaction.prop('tool_timesdot'),true),\n tool_triangle: toBoolean(interaction.prop('tool_triangle'),true),\n tool_similar: toBoolean(interaction.prop('tool_similar'), true),\n tool_paral: toBoolean(interaction.prop('tool_paral'), true),\n tool_perp: toBoolean(interaction.prop('tool_perp'), true),\n tool_inmem: toBoolean(interaction.prop('tool_inmem'), true),\n tool_ninmem: toBoolean(interaction.prop('tool_ninmem'), true),\n tool_union: toBoolean(interaction.prop('tool_union'), true),\n tool_intersec: toBoolean(interaction.prop('tool_intersec'),true),\n allowNewLine: toBoolean(interaction.prop('allowNewLine'), false),\n enableAutoWrap: toBoolean(interaction.prop('enableAutoWrap'), false)\n }));\n\n //init form javascript\n formElement.initWidget($form);\n\n //init data change callbacks\n formElement.setChangeCallbacks($form, interaction, {\n identifier: function(i, value){\n response.id(value);\n interaction.attr('responseIdentifier', value);\n },\n useGapExpression: function gapChangeCallback(i, value) {\n if (toBoolean(value, false)) {\n self.createAddGapBtn();\n $gapStyleBox.show();\n } else {\n i.prop('gapExpression', '');\n self.removeAddGapBtn();\n $gapStyleBox.hide();\n }\n\n response.attr('cardinality', 'single');\n configChangeCallBack(i, value, 'useGapExpression');\n },\n gapStyle: function gapStyleChangeCallback(i, newStyle) {\n\n i.prop('gapStyle', newStyle);\n\n configChangeCallBack(i, newStyle, 'gapStyle');\n },\n authorizeWhiteSpace: configChangeCallBack,\n focusOnDenominator: configChangeCallBack,\n\n tool_frac: configChangeCallBack,\n tool_sqrt: configChangeCallBack,\n tool_exp: configChangeCallBack,\n tool_log: configChangeCallBack,\n tool_ln: configChangeCallBack,\n tool_e: configChangeCallBack,\n tool_infinity: configChangeCallBack,\n tool_pi: configChangeCallBack,\n tool_cos: configChangeCallBack,\n tool_sin: configChangeCallBack,\n tool_lte: configChangeCallBack,\n tool_gte: configChangeCallBack,\n tool_times: configChangeCallBack,\n tool_divide: configChangeCallBack,\n tool_plusminus: configChangeCallBack,\n tool_angle: configChangeCallBack,\n tool_minus: configChangeCallBack,\n tool_plus: configChangeCallBack,\n tool_equal: configChangeCallBack,\n tool_lower: configChangeCallBack,\n tool_greater: configChangeCallBack,\n tool_subscript: configChangeCallBack,\n tool_integral: configChangeCallBack,\n tool_timesdot: configChangeCallBack,\n tool_triangle: configChangeCallBack,\n tool_similar: configChangeCallBack,\n tool_paral: configChangeCallBack,\n tool_perp: configChangeCallBack,\n tool_inmem: configChangeCallBack,\n tool_ninmem: configChangeCallBack,\n tool_union: configChangeCallBack,\n tool_intersec: configChangeCallBack,\n\n squarebkts: function squarebktsChangeCallBack(i, value) {\n i.prop('tool_lbrack', value);\n i.prop('tool_rbrack', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n roundbkts: function roundbktsChangeCallBack(i, value) {\n i.prop('tool_lparen', value);\n i.prop('tool_rparen', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n curlybkts: function curlybktsChangeCallBack(i, value) {\n i.prop('tool_lbrace', value);\n i.prop('tool_rbrace', value);\n i.triggerPci('configChange', [i.getProperties()]);\n },\n\n allowNewLine: configChangeCallBack,\n enableAutoWrap: configChangeCallBack\n });\n\n\n $gapStyleBox = $form.find('.mathgap-style-box');\n $gapStyleSelector = $gapStyleBox.find('[data-mathgap-style]');\n\n $gapStyleSelector.select2({\n width: '100%',\n minimumResultsForSearch: Infinity\n })\n .val(interaction.prop('gapStyle'))\n .trigger('change');\n };\n\n /**\n * Change callback for editable math field\n */\n\n MathEntryInteractionStateQuestion.prototype.addMathFieldListener = function addMathFieldListener() {\n var _widget = this.widget,\n interaction = _widget.element;\n\n interaction.onPci('responseChange', function(latex) {\n if (toBoolean(interaction.prop('useGapExpression'), false)) {\n interaction.prop('gapExpression', latex);\n } else {\n interaction.prop('gapExpression', '');\n }\n });\n };\n\n /**\n * Display the \"Add Gap\" button\n */\n MathEntryInteractionStateQuestion.prototype.createAddGapBtn = function createAddGapBtn() {\n var _widget = this.widget,\n $container = _widget.$container,\n $toolbar = $container.find('.toolbar'),\n interaction =_widget.element;\n\n if ($toolbar.length) {\n $toolbar.after($addGapBtn);\n $addGapBtn.on('click', function() {\n interaction.getResponseDeclaration().removeMapEntries();\n interaction.triggerPci('addGap');\n });\n }\n };\n\n /**\n * Remove the \"Add Gap\" button from the DOM\n */\n MathEntryInteractionStateQuestion.prototype.removeAddGapBtn = function removeAddGapBtn() {\n $addGapBtn.off('click');\n $addGapBtn.remove();\n };\n\n return MathEntryInteractionStateQuestion;\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2021 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/widget/states/Correct',[\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/states/Correct'\n], function (stateFactory, Correct) {\n 'use strict';\n\n var InteractionStateCorrect = stateFactory.create(\n Correct,\n function init() {\n this.widget.element.getResponseDeclaration().setTemplate('MAP_RESPONSE');\n this.widget.changeState('map');\n },\n function exit() {\n }\n );\n\n return InteractionStateCorrect;\n});\n\n",
+ "\ndefine('tpl!mathEntryInteraction/creator/tpl/answerForm', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, functionType=\"function\", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;\n\nfunction program1(depth0,data) {\n \n var buffer = \"\", stack1, helper, options;\n buffer += \"\\n
\";\n return buffer;\n });\n});\n\n",
+ "\ndefine('tpl!mathEntryInteraction/creator/tpl/addAnswerOption', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;\n\n\n buffer += \"\";\n return buffer;\n });\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2021 (original work) Open Assessment Technologies SA;\n */\ndefine('mathEntryInteraction/creator/widget/states/Map',[\n 'handlebars',\n 'i18n',\n 'lodash',\n 'jquery',\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/states/Map',\n 'taoQtiItem/qtiCreator/widgets/helpers/formElement',\n 'tpl!mathEntryInteraction/creator/tpl/answerForm',\n 'tpl!mathEntryInteraction/creator/tpl/addAnswerOption',\n], function (\n hb,\n __,\n _,\n $,\n stateFactory,\n Map,\n formElement,\n answerFormTpl,\n addAnswerOptionBtn\n) {\n 'use strict';\n var CORRECT_ANSWER_VALUE = 1;\n hb.registerHelper('increaseIndex', function (value, options) {\n return parseInt(value) + 1;\n });\n\n var MathEntryInteractionStateResponse = stateFactory.create(\n Map,\n function init() {\n this.initGlobalVariables();\n this.initForm();\n },\n function exit() {\n this.emptyGapFields();\n this.toggleResponseMode(false);\n this.saveAnswers();\n this.removeResponseChangeEventListener();\n this.removeEditDeleteListeners();\n this.removeAddButtonListener();\n this.destroyForm();\n }\n );\n\n\n MathEntryInteractionStateResponse.prototype.initGlobalVariables = function initGlobalVariables() {\n var self = this,\n interaction = self.widget.element;\n self.activeEditId = null;\n self.correctResponses = [];\n\n if (this.inGapMode(self) === true) {\n interaction = self.widget.element;\n self.gapTemplate = interaction.prop('gapExpression');\n }\n }\n\n MathEntryInteractionStateResponse.prototype.initForm = function initForm() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm;\n\n this.initResponseChangeEventListener();\n self.correctResponses = this.getExistingCorrectAnswerOptions();\n $responseForm.html(addAnswerOptionBtn());\n this.initAddAnswerButton();\n this.renderForm(self.correctResponses);\n }\n\n MathEntryInteractionStateResponse.prototype.initAddAnswerButton = function initAddAnswerButton() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $addAnswerBtn = $responseForm.find($('.add-answer-option'));\n\n $addAnswerBtn.on('click', function () {\n var newCorrectAnswer;\n\n if (self.inGapMode() === true) {\n self.emptyGapFields();\n var gapExpression = interaction.prop('gapExpression');\n var gapCount = (gapExpression.match(/\\\\taoGap/g) || []).length;\n if (gapCount > 0) {\n newCorrectAnswer = [];\n for (var i = 0; i < gapCount; i++) {\n newCorrectAnswer.push(' ');\n }\n\n newCorrectAnswer = newCorrectAnswer.join(',');\n } else {\n newCorrectAnswer = '';\n }\n } else {\n newCorrectAnswer = '';\n self.toggleResponseMode(false);\n }\n\n self.correctResponses.push(newCorrectAnswer);\n self.renderForm(self.correctResponses);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.getExistingCorrectAnswerOptions = function getExistingCorrectAnswerOptions() {\n var self = this,\n interaction = self.widget.element;\n\n var mapEntries = interaction.getResponseDeclaration().getMapEntries();\n return _.keys(mapEntries) || [];\n }\n\n MathEntryInteractionStateResponse.prototype.initResponseChangeEventListener = function initResponseChangeEventListener() {\n var self = this,\n interaction = self.widget.element;\n\n interaction.onPci('responseChange', function (latex) {\n if (self.inGapMode(self) === false && self.activeEditId !== null) {\n self.correctResponses[self.activeEditId] = latex;\n } else if (self.inGapMode(self) === true && self.activeEditId !== null) {\n var response = interaction.getResponse();\n if (response !== null) {\n self.correctResponses[self.activeEditId] = response.base.string;\n }\n }\n });\n }\n\n MathEntryInteractionStateResponse.prototype.removeResponseChangeEventListener = function removeResponseChangeEventListener() {\n var self = this,\n interaction = self.widget.element;\n\n interaction.offPci('responseChange');\n }\n\n MathEntryInteractionStateResponse.prototype.initEditingOptions = function initEditingOptions() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $entryConfig = $responseForm.find('.entry-config'),\n $editButtons = $entryConfig.find('.answer-edit');\n\n $editButtons.click(function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n self.toggleResponseMode(true);\n var selectedEditId = parseInt($(e.target).closest('div').attr('data-index'));\n\n if (self.activeEditId !== selectedEditId) {\n\n if (self.inGapMode() === true) {\n self.activeEditId = selectedEditId;\n var response = self.getGapResponseObject(self.correctResponses[self.activeEditId]);\n interaction.triggerPci('latexGapInput', [response]);\n } else {\n self.activeEditId = selectedEditId;\n interaction.triggerPci('latexInput', [self.correctResponses[self.activeEditId]]);\n }\n } else {\n self.emptyGapFields();\n }\n });\n }\n\n // forming gap response object to be further processed by the latexGapInput event\n MathEntryInteractionStateResponse.prototype.getGapResponseObject = function getGapResponseObject(response) {\n return {\n base: {\n string: response.split(',')\n }\n }\n }\n\n // removing all saved map entries\n MathEntryInteractionStateResponse.prototype.clearMapEntries = function clearMapEntries() {\n var self = this,\n interaction = self.widget.element,\n response = interaction.getResponseDeclaration(),\n mapEntries = response.getMapEntries();\n\n _.keys(mapEntries).forEach(function (mapKey) {\n response.removeMapEntry(mapKey, true);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.initDeletingOptions = function initDeletingOptions() {\n var self = this,\n interaction = self.widget.element,\n $responseForm = self.widget.$responseForm,\n $entryConfig = $responseForm.find('.entry-config'),\n $deleteButtons = $entryConfig.find('.answer-delete');\n\n $deleteButtons.click(function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var id = parseInt($(e.target).closest('div').attr('data-index'));\n\n if (self.inGapMode() === true) {\n self.activeEditId = id;\n self.emptyGapFields();\n } else {\n self.activeEditId = null;\n self.toggleResponseMode(false);\n }\n\n self.correctResponses.splice(id, 1);\n self.renderForm(self.correctResponses);\n });\n }\n\n MathEntryInteractionStateResponse.prototype.renderForm = function renderForm(correctAnswerOptions) {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n this.removeEditDeleteListeners();\n $responseForm.find('.mathEntryInteraction').remove();\n $responseForm.append(answerFormTpl({correctAnswerEntries: correctAnswerOptions}));\n this.initDeletingOptions();\n this.initEditingOptions();\n }\n\n /**\n * remove all event listeners to avoid any potential memory leaks\n */\n MathEntryInteractionStateResponse.prototype.removeEditDeleteListeners = function removeEditDeleteListeners() {\n var self = this,\n $entryConfig = self.widget.$responseForm.find('.entry-config');\n\n $entryConfig.find('.answer-edit').off('click');\n $entryConfig.find('.answer-delete').off('click');\n }\n\n MathEntryInteractionStateResponse.prototype.removeAddButtonListener = function removeAddButtonListener() {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n $responseForm.find($('.add-answer-option')).off('click');\n }\n\n MathEntryInteractionStateResponse.prototype.destroyForm = function destroyForm() {\n var self = this,\n $responseForm = self.widget.$responseForm;\n\n $responseForm.find('.mathEntryInteraction').remove();\n }\n\n MathEntryInteractionStateResponse.prototype.saveAnswers = function saveAnswers() {\n var self = this,\n interaction = self.widget.element,\n responseDeclaration = interaction.getResponseDeclaration();\n\n this.clearMapEntries();\n\n if (this.inGapMode() === true) {\n self.correctResponses = self.correctResponses.filter(function (response) {\n return response.split(',').indexOf('') === -1;\n });\n }\n\n self.correctResponses.forEach(function (response) {\n responseDeclaration.setMapEntry(response, CORRECT_ANSWER_VALUE, false);\n });\n }\n\n /**\n * if in gap mode: will empty all the gap fields\n */\n MathEntryInteractionStateResponse.prototype.emptyGapFields = function emptyGapFields() {\n var self = this,\n interaction = self.widget.element;\n\n if (this.inGapMode() === true) {\n self.activeEditId = null;\n\n interaction.prop('gapExpression', self.gapTemplate);\n this.toggleResponseMode(false);\n }\n }\n\n MathEntryInteractionStateResponse.prototype.toggleResponseMode = function toggleResponseMode(value) {\n var self = this,\n interaction = self.widget.element;\n\n if (interaction.prop('inResponseState') !== value) {\n interaction.prop('inResponseState', value);\n interaction.triggerPci('configChange', [interaction.getProperties()]);\n }\n }\n\n MathEntryInteractionStateResponse.prototype.inGapMode = function inGapMode() {\n var interaction = this.widget.element;\n var useGapExpression = interaction.prop('useGapExpression');\n return useGapExpression && useGapExpression !== 'false' || false;\n }\n\n return MathEntryInteractionStateResponse;\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/states/states',[\n 'taoQtiItem/qtiCreator/widgets/states/factory',\n 'taoQtiItem/qtiCreator/widgets/interactions/customInteraction/states/states',\n 'mathEntryInteraction/creator/widget/states/Question',\n 'mathEntryInteraction/creator/widget/states/Correct',\n 'mathEntryInteraction/creator/widget/states/Map'\n], function(factory, states){\n 'use strict';\n\n return factory.createBundle(states, arguments);\n});\n\n",
+ "/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2016 (original work) Open Assessment Technologies SA;\n */\n\ndefine('mathEntryInteraction/creator/widget/Widget',[\n 'taoQtiItem/qtiCreator/widgets/interactions/customInteraction/Widget',\n 'mathEntryInteraction/creator/widget/states/states'\n], function(Widget, states){\n 'use strict';\n\n var MathEntryInteractionWidget = Widget.clone();\n\n MathEntryInteractionWidget.initCreator = function initCreator() {\n var $interaction;\n\n this.registerStates(states);\n\n Widget.initCreator.call(this);\n\n $interaction = this.$container.find('.mathEntryInteraction');\n if ($interaction.length) {\n $interaction.addClass('tao-qti-creator-context');\n }\n };\n\n return MathEntryInteractionWidget;\n});\n",
+ "\ndefine('tpl!mathEntryInteraction/creator/tpl/markup', ['handlebars'], function(hb){ \nreturn hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, functionType=\"function\";\n\n\n buffer += \"