we have serious problem with more complex jsxgraph code snippets in ILIAS pages. one symptom is that when ILIAS tries to copy a page with complex jsxgraph content in it, an error is thrown and the page is rendered inaccessible (errors are thrown continually afterwards on accessing the page).
the only way to access the page again is editing the respective content field in the db in orderto clear out the "plugged property" elements in it.
we have not been able to isolate yet, which expressions cause the problem. one thing might be expressions that contain brackets like "{" or "[" in combination with other things.
One example code that caused problems is:
var brd;
JXG.Options.text.useMathJax = true;
brd = JXG.JSXGraph.initBoard('jsxgraphbox5b545f160ef6b', {
boundingbox: [-8, 8, 8, -8],
axis:true,
showNavigation:false,
showCopyright:false
}),
a = brd.create('slider',[[1,-3],[5,-3],[-2,1,2]], {name:'a',snapwidth:0.1}),
x1 = brd.create('slider',[[1,-4],[5,-4],[-10,-1,10]], {name:'x_1',snapwidth:0.5}),
x2= brd.create('slider',[[1,-5],[5,-5],[-10,0,10]], {name:'x_2',snapwidth:0.5}),
x3 = brd.create('slider',[[1,-6],[5,-6],[-10,1,10]], {name:'x_3',snapwidth:0.5}),
p = brd.create('functiongraph',[function(x){
return a.Value()(x-x1.Value())(x-x2.Value())*(x-x3.Value());
}]);
var button1 = brd.create('button', [1, -7, 'reset', function() {
a.setValue(1);
x1.setValue(-1);
x2.setValue(0);
x3.setValue(1);
}]);
button1.setProperty({fixed:true});
var txt2 = brd.create('text',[-7.5,7.2,
function(){return'Polynom in Nullstellenform'}],{fontsize:14});
var txt3 = brd.create('text',[-7.5,6.2,
function(){return'\\(p(x)=a(x-x_1)(x-x_2)(x-x_3)\\)'}],{fontsize:12});
var txt1 = brd.create('text',[-7.5,5.2,
function() {
if (x1.Value() 0 & x2.Value() < 0 && x3.Value() < 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x'+x1.Value()+')(x'+x2.Value()+')(x'+x3.Value()+')\\)';
} else if (x1.Value() 0 & x2.Value() < 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x'+x1.Value()+')(x'+x2.Value()+')(x+'+x3.Value()+')\\)';
} else if (x1.Value() 0 & x3.Value() < 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x'+x1.Value()+')(x+'+x2.Value()+')(x'+x3.Value()+')\\)';
} else if (x2.Value() 0 & x3.Value() < 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x+'+x1.Value()+')(x'+x2.Value()+')(x'+x3.Value()+')\\)';
} else if (x1.Value() 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x'+x1.Value()+')(x+'+x2.Value()+')(x+'+x3.Value()+')\\)';
} else if (x2.Value() 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x+'+x1.Value()+')(x'+x2.Value()+')(x+'+x3.Value()+')\\)';
} else if (x3.Value() 0) {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x+'+x1.Value()+')(x+'+x2.Value()+')(x'+x3.Value()+')\\)';
} else {
return '\\(p(x) ='+a.Value().toFixed(1)+'(x+'+x1.Value()+')(x+'+x2.Value()+')(x+'+x3.Value()+')\\)';
}
}], {fontSize:14});
we have serious problem with more complex jsxgraph code snippets in ILIAS pages. one symptom is that when ILIAS tries to copy a page with complex jsxgraph content in it, an error is thrown and the page is rendered inaccessible (errors are thrown continually afterwards on accessing the page).
the only way to access the page again is editing the respective content field in the db in orderto clear out the "plugged property" elements in it.
we have not been able to isolate yet, which expressions cause the problem. one thing might be expressions that contain brackets like "{" or "[" in combination with other things.
One example code that caused problems is:
var brd;
JXG.Options.text.useMathJax = true;
brd = JXG.JSXGraph.initBoard('jsxgraphbox5b545f160ef6b', {
boundingbox: [-8, 8, 8, -8],
axis:true,
showNavigation:false,
showCopyright:false
}),
a = brd.create('slider',[[1,-3],[5,-3],[-2,1,2]], {name:'a',snapwidth:0.1}),
x1 = brd.create('slider',[[1,-4],[5,-4],[-10,-1,10]], {name:'x_1',snapwidth:0.5}),
x2= brd.create('slider',[[1,-5],[5,-5],[-10,0,10]], {name:'x_2',snapwidth:0.5}),
x3 = brd.create('slider',[[1,-6],[5,-6],[-10,1,10]], {name:'x_3',snapwidth:0.5}),
p = brd.create('functiongraph',[function(x){
return a.Value()(x-x1.Value())(x-x2.Value())*(x-x3.Value());
}]);