From 49162fd0e1b13c29c64e05b23845edd4b603923c Mon Sep 17 00:00:00 2001 From: Andreas Walter Date: Fri, 14 Jun 2024 15:05:03 +0200 Subject: [PATCH] declare board ids --- libs/formulas_extension/JSXQuestion.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/formulas_extension/JSXQuestion.js b/libs/formulas_extension/JSXQuestion.js index f4d4069..aa2ba7c 100644 --- a/libs/formulas_extension/JSXQuestion.js +++ b/libs/formulas_extension/JSXQuestion.js @@ -258,6 +258,7 @@ var JSXQuestion = function(boardIDs, jsxGraphCode, allowInputEntry, decimalPreci for (i = 0; i < that.BOARDIDS.length; i++) { attr = attributes[i] || attributes[0]; // First attributes are default. + attr.id = attr.id ?? that.BOARDIDS[i] + '_board'; board = JXG.JSXGraph.initBoard(that.BOARDIDS[i], attr); that.boards.push(board); } @@ -288,6 +289,7 @@ var JSXQuestion = function(boardIDs, jsxGraphCode, allowInputEntry, decimalPreci JXG.JSXGraph.freeBoard(that.boards[index]); } + attributes.id = attributes.id ?? that.BOARDIDS[index] + '_board'; that.boards[index] = JXG.JSXGraph.initBoard(that.BOARDIDS[index], attributes); return that.boards[index]; }; @@ -473,4 +475,4 @@ if (!Element.prototype.closest) { } while (el !== null && el.nodeType === 1); return null; }; -} +} \ No newline at end of file