diff --git a/views/js/controller/creator/encoders/dom2qti.js b/views/js/controller/creator/encoders/dom2qti.js index bc2de9c50..6db580bad 100644 --- a/views/js/controller/creator/encoders/dom2qti.js +++ b/views/js/controller/creator/encoders/dom2qti.js @@ -156,13 +156,13 @@ define([ nodeName = normalizeNodeName(elt.nodeName); object = _.merge(qtiElementHelper.create(nodeName, { - 'id': '', - 'class': '', - 'xmlBase': '', - 'lang': '', - 'label': '' - }), { - ...(_.transform(elt.attributes, function (acc, value) { + 'id': '', + 'class': '', + 'xmlBase': '', + 'lang': '', + 'label': '' + }), + _.transform(elt.attributes, function (acc, value) { const attrName = normalizeNodeName(value.nodeName); if (attrName) { if (typedAttributes[nodeName] && typedAttributes[nodeName][attrName]) { @@ -171,8 +171,9 @@ define([ acc[attrName] = value.nodeValue; } } - })) - }); + return acc; + }, {}) + ); if (elt.childNodes.length > 0) { object.content = self.decode(elt.childNodes); }