moodleou / moodle-mod_ouwiki

Alternative wiki module for Moodle 2 (designed for use in teaching and learning)
36 stars 33 forks source link

Annotate issue with MathML ou LateX #47

Open flizotte opened 8 years ago

flizotte commented 8 years ago

I was reported this issue in Ouwiki (2014042800) running on Moodle 2.8.9.

Teachers want to annotate pages containing MathML generated by Wiris. But an annotation mark gets inserted in the MathML syntax:

«math Annotation markerxmlns=¨http://www.w3.org/1998/Math/MathML¨»«mfrac»«mrow»«mn»25«/mn»«mo»,«/mo»«mn»0«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«mo»§#160;«/mo»«/mrow»«mrow»«mn»25«/mn»«mo»,«/mo»«mn»0«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«/mrow»«/mfrac»«mo»§#215;«/mo»«mfrac»«mrow»«mn»0«/mn»«mo»,«/mo»«mn»10«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»o«/mi»«mi»l«/mi»«/mrow»«mrow»«mn»1000«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«/mrow»«/mfrac»«mo»§#215;«/mo»«/math»

This is because there is a space between math and xmlns.

I also tested with LaTeX and I get a span before and after: .

Is there any way the annotation form could display properly MathML and LaTeX?

jason-platts commented 8 years ago

I'm not sure how you would be able to get around this issue as in this case the mathml (or LaTeX) is inserted as text so could be annotated just like any other text.

Is there a problem with this as even if someone does add an annotation into the middle of the equation text then that doesn't actually break anything?

flizotte commented 8 years ago

Thanks a lot for your quick reply.

The mathml (displayed by the Wiris filter) generates an error message when the filter is on.So one cannot really break it by inserting an annotation.

image

But if I temporarily turn the filter off, I can then add an annotation within the mathml tag and then it breaks. But this is not likely to happen.

image

With LateX, it is different. The equation show up, but it is surronded by two tags. image

jason-platts commented 8 years ago

I'm afraid I don't have a solution for this.

We use both mathml and latex without problems - but we have our own filter that converts these to images, so you can never annotate within them.

One point confuses me with your screen grab of latex - this is showing the annotation span html, but within the annotation page interface - is this a copy and paste of the html of a wiki page?

flizotte commented 8 years ago

For LaTeX, step by step... All in wysiswig. Edit mode image

View mode image

Annotate mode image

jason-platts commented 8 years ago

It looks like the WIRIS filter doesn't strip any other content it doesn't want/understand, it looks like our in-house maths filter does and so we hadn't noticed this problem.

I'm struggling to think of a way around this, the annotation spans need to be added before the filter is run (this is due to positioning, they are recorded based on the source text). If there are spaces in the text the wiki code will add an annotation span regardless - I'm not sure how it would tell this particular text is an equation (other than guessing based on the contents). Sorry!