A note on math

The content in this blog is over six months old, and the comments are closed. For the most recent product updates and discussions, you're encouraged to explore newer posts from Instructure's Product Managers.

eschiebel
Instructure
Instructure
9
2675

Hello,

I am the engineer responsible for, depending on your experience, the enhancement of how math equations are displayed in canvas or the string of horrific errors that rendered math quizzes unreadable. If you're in the latter camp, I am truly sorry. This turned out to have complexities I did not envision. I owe you a beer or a coffee.

While investigating why math is sometimes garbled I stumbled on a surprising pattern for how users are creating equations in their content and wanted to say a couple things about how to make it better.

In a number of places an equation will be all in plain text except for one symbol, say , which was injected using the rich content editor's equation editor. This creates something like:

eschiebel_0-1618420215367.gif  2.35

When this is saved then viewed Canvas will have MathJax typeset the math, which in this case is just the ≤, leaving the rest of the equation untouched. This has a couple effects. First, the symbol is rendered in a different font than the surrounding text. Not a big deal, but not ideal. More importantly this does not provide the assistive support MathJax provides to your students who use a screen reader or a screen magnifier. It's also more effort than just creating the whole equation as a single entity. I suggest you use the equation editor to create the entire equation. This provides the best user experience.

If you prefer not to use the equation editor, then I suggest that you use the unicode character for the symbol you need. Google "unicode less than or equal to symbol"  and the top result should show the character you can copy and paste. Screen readers generally know what these characters are and will read then appropriately. (Unicode characters are characters just like 'a' or 'z', but can display fancy glyphs like emojis and mathematical symbols.)

Next, if you discover your equations are not displaying correctly, edit the content and look at the HTML (click the </> button in the bottom right corner of the Rich Content Editor). If you see anything that looks like it was generated by MathJax, HTML that looks like

 <span id="MathJax-Element-2-Frame" class="MathJax"...

or

<span class="MJX_Assistive_MathML" role="presentation">...

then something has gone wrong and MathJax generated output was saved as part of your content, which should never have happened. While this shouldn't happen again, you are looking at corrupt content that's already saved in our database. We have a tool that Canvas support can use to try and repair your content, but it only works some of the time. Your best bet is to recreate the content. I know that's not an ideal answer, but it will provide the best experience for your students and save you headaches in the future if you reuse the content later on.

I hope this has been helpful, and now that we have the bugs worked out (fingers crossed) you should be pleased to know that your students using assistive technology have better access to math equations in Canvas than before.

The content in this blog is over six months old, and the comments are closed. For the most recent product updates and discussions, you're encouraged to explore newer posts from Instructure's Product Managers.

9 Comments
kaw
Community Participant

Thank you for your detailed explanation.  We need a hover option to see if the Mathjax equation has rendered properly.  One has to preview the whole quiz to see if it works.  One has to take even an extra step if the question is developed in a quiz bank. 

See Rmarkdown of Rstudio as an example of how hovering on a latex equation works.

Kamal_H
Community Participant

Hello,

This may not be related to the updates you mentioned. However, I noticed equations are not showing properly for some questions. I used those quizzes in fall 20 and there were no issues.

Here is an example even after editing each problem in each quiz bank.

In the bank it shows properly as below.

Kamal_H_0-1619543520761.png

However, when I preview it shows as below.

Kamal_H_0-1619543670193.png

 

I am not sure what else to do. Final exams are in two weeks. Nothing I do fix these quizzes.

Thanks!

 

rhansen4
Community Member

Hi,

I'm at the same location as Kamal, from the previous comment. We do need to resolve this right away. How do we access the third party tool?

erinhmcmillan
Instructure Alumni
Instructure Alumni

HI, all,

You cannot access the tool directly—it is via Canvas Support. Please submit a support case if you have not yet already.

Thanks!

Erin

Kamal_H
Community Participant

I had to go to each quiz bank and update each problem to fix the issue. Currently, they are showing alright. 

I hope there will not be any surprise like this again. 

Thanks,

Kamal

Kamal_H
Community Participant

Unfortunately scientific notation did not show properly for one of my student this semester. 

I had to fix that test bank this morning.

Kamal_H_0-1619801294247.png

 

DeniceLingen
Community Novice

Thank you for this detailed information. It is helpful, as we've had several issues with equations in Canvas over the past few semesters. I'm glad to know some of the reasoning behind what happened, and some best practices to avoid this in the future.

Apologies if this isn't the forum to ask this question, but - do you know if the negative sign issue with google chrome is still a problem? Essentially, if the hardware acceleration mode isn't disabled, images (and equations) don't always render properly. 

jonespa1
Community Participant

There are many features that are missing in the equation editor that would be very useful.  For example, properly writing a piece-wise function.  Is there a specific place I can add items that are needed?

Kamal_H
Community Participant

If you know LaTex then you will be able to do piece-wise functions as seen below.

Kamal_H_0-1621091956068.png

I will write the code here for you to copy and use it. 

f\left(x\right)= \begin{cases}
1 & \text{if} \quad  \quad x \leq -1  \\
-2x-1 & \text{if} \quad-1 < x \leq  1 \\
-2 & \text{if}  \quad   \quad x > 1 \\
\end{cases}