Skip to content

Commit

Permalink
Merge pull request #2442 from oat-sa/fix/ADF-1579/fix-transform-in-lo…
Browse files Browse the repository at this point in the history
…dash

fix: transform method after lodash update
  • Loading branch information
taopkorczak authored Feb 2, 2024
2 parents 4707d6c + 4bd7be3 commit 049f879
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions views/js/controller/creator/encoders/dom2qti.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -171,8 +171,9 @@ define([
acc[attrName] = value.nodeValue;
}
}
}))
});
return acc;
}, {})
);
if (elt.childNodes.length > 0) {
object.content = self.decode(elt.childNodes);
}
Expand Down

0 comments on commit 049f879

Please sign in to comment.