jsxgraph / moodle-filter_jsxgraph

moodle plug-in for JSXGraph
https://jsxgraph.org
1 stars 6 forks source link

Text renders with double quotes around it #41

Closed idleup closed 6 months ago

idleup commented 7 months ago

Board.create('text', [1, -1 'MyText'])

Will render with the word "MyText" on the chart with double quotes around it. Is that a setting? a bug? The samples on JSXGraph do not do this, only when Graphs are created in Moodle (specifically in questions)

andreas-web commented 7 months ago

Dear Matt,

this issue seems to be related to https://groups.google.com/u/3/g/jsxgraph/c/WfCxCXcyam8. We are searching for a solution. At the moment it is not entirely clear whether the error lies with JSXGraph itself or with the filter.

Best regards, Andreas

alfredwassermann commented 7 months ago

A quick work around is to use the attribute parse:false :

board.create('text', [1, -1, 'MyText'], {parse:false});

It is still not clear how moodle interferes with JSXGraph.

alfredwassermann commented 6 months ago

Finally, the root of the problem with quotation marks could be identified: Moodle seems to manipulate the method String.at() and does not support negative values for the parameter (as does the original method). This is fixed now, a new version will be published soon.