From c3dddb6b597e35170885de2ccac4dc2f029d5903 Mon Sep 17 00:00:00 2001 From: Andrey Shaveko Date: Thu, 12 Oct 2023 16:10:53 +0200 Subject: [PATCH] fix: change _.invoke calls to forEach --- .../interactions/GraphicAssociateInteraction.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction.js b/src/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction.js index 78e1b254..bef773f3 100644 --- a/src/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction.js +++ b/src/qtiCommonRenderer/renderers/interactions/GraphicAssociateInteraction.js @@ -108,7 +108,9 @@ const _createPath = function _createPath(interaction, srcElement, destElement, o interaction._vsets.push(vset); //to identify the element of the set outside the context - _.invoke(vset, 'data', 'assoc-path', true); + vset.forEach(el => { + el.data('assoc-path', true); + }); //enable to select the path by clicking the invisible layer layer.click(function selectLigne() { @@ -145,7 +147,7 @@ const _createPath = function _createPath(interaction, srcElement, destElement, o //remove set handler function removeSet() { - _.invoke(vset, 'remove'); + vset.forEach(vset.remove()); interaction._vsets = _.without(interaction._vsets, vset); if (typeof onRemove === 'function') { onRemove(); @@ -424,7 +426,6 @@ const setResponse = function (interaction, response) { */ const resetResponse = function resetResponse(interaction) { const toRemove = []; - //reset response and state bound to shapes _.forEach(interaction.getChoices(), function (choice) { const element = interaction.paper.getById(choice.serial); @@ -445,7 +446,7 @@ const resetResponse = function resetResponse(interaction) { } }); } - _.invoke(toRemove, 'remove'); + toRemove.forEach(el => el.remove()); }; /**