Skip to content

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Oct 6, 2025

The format_matrix_HTML method uses span tags to format the html output for matrices. This is a problem when that is used to format the output for an ans_array answer because the answer inputs inside now are wrapped in div tags (so that the feedback button works in a valid html way). So this just switches to using divs instead. This doesn't change the result at all since the containg array layout div already has display:inline-block set.

There is one minor tweak to the style. I added text-align:center; to the cells. This just looks better in about all of the cases that I have observed. Note that this is also consistent with when these objects are displayed in math mode via MathJax or as an image with the image display mode.

Note that method is used ans_array matrix, vector, and point answer rules, as well as the "Entered" feedback preview of the student answer for those answers. It also affects the "textual" correct answer, but that actually isn't used for anything anymore.

The `format_matrix_HTML` method uses `span` tags to format the html
output for matrices. This is a problem when that is used to format the
output for an `ans_array` answer because the answer inputs inside now
are wrapped in `div` tags (so that the feedback button works in a valid
html way).  So this just switches to using `div`s instead.  This doesn't
change the result at all since the containg array layout div already has
`display:inline-block` set.

There is one minor tweak to the style.  I added `text-align:center;` to
the cells.  This just looks better in about all of the cases that I have
observed. Note that this is also consistent with when these objects are
displayed in math mode via MathJax or as an image with the image display
mode.

Note that method is used ans_array matrix, vector, and point answer
rules, as well as the "Entered" feedback preview of the student answer
for those answers. It also affects the "textual" correct answer, but
that actually isn't used for anything anymore.
@dpvc
Copy link
Member

dpvc commented Oct 6, 2025

Everything gets explicit display CSS settings now (that wasn't the case when this was originally written), so I don't see any problem with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants