You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix feedback previews when the display mode is "images".
Currently if the display mode is "images", then the student and correct
answer previews don't work. The images are never actually rendered,
thus the image files are never created, and so the `alt` value is shown
which is the original TeX for the answer. The reason for this is that
the image generator runs before the post content processor runs. So
equation images in the problem are rendered, but not those in the
feedback. That was done because of the hack of inserting the string
`MaRkEr` followed by the image number hash when the image is initially
inserted into the problem text, and then later replacing that with the
alignment styel when the image is rendered. That results in invalid HTML
which `Mojo::DOM` doesn't like.
To fix the issue the `MaRkEr` hack is reworked. Instead of that string,
a `data-marker` attribute is used whose value is the image number hash.
Since that is valid HTML, `Mojo::DOM` is fine with it and leaves it as
it is. So the image generator can now be run after the post content
processor runs, and that renders the images in feedback as well.
Care is needed for the images in feedback when the `data-marker` is
replaced. Since the rendered `img` tag is inside the `data-bs-content`
attribute of the feedback button, it is HTML encoded. So instead of
double quotes, the HTML double quote escape character (") is used.
0 commit comments