-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alt text to histograms on stats page. #2624
base: develop
Are you sure you want to change the base?
Conversation
I should note, it would be nice if someone who has actual Jitar set data can test this out. I only have normal set data that I transformed into a jitar set. It just felt like the bars on the problems page were backwards, maybe this won't be the case with real jitar data (not quite sure how jitar adjusted grade after review works). But the graphs I saw all seemed mirrored, so I removed the reverse. This way the adjusted data looks the same in my test case on both the set and problem stats page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the comment in #2598 (originally in an email from @glarose) is misguided. The alt
attribute is not valid for svg
tags. In fact, the only thing that the alt
attribute is valid for is an img
tag. Furthermore, screen readers will not read an alt
attribute on anything other than an img
tag. So at this point, this pull request doesn't fix anything, and adds invalid html. Another way to do this will need to be found.
The aria-label
, aria-labelledby
, and aria-describedby
attributes do work. However, aria-labelledby
is already set for the svg to be the svg title (which is read by screen readers). So the aria-label
attribute also can't be used. You could add a visually hidden span and use the aria-describedby
attribute. Then both the content of the element pointed to by the aria-labelledby
attribute and the content of the element pointed to by the aria-describedby
attribute are read.
You may also need to add tabindex="0"
to the svg
. In my testing (with Gnome Orca) in Firefox, the aria-describedby
and aria-labelledby
attributes were not read in browse mode at all, but if the svg is in the tab order, it could be focused and then the attributes are read. However, in Google Chrome, it does work in browse mode without the tabindex
attribute. So I am not sure on this. It could be an issue with the Gnome Orca screen reader, or it could be a Firefox issue.
This is an article I've followed in the past for accessible svg patterns.
It might be useful. Of course some testing results with screenreaders might
be outdated.
https://www.smashingmagazine.com/2021/05/accessible-svg-patterns-comparison/
…On Mon, Nov 18, 2024, 4:19 AM Glenn Rice ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Unfortunately, the comment in #2598
<https://urldefense.com/v3/__https://github.com/openwebwork/webwork2/issues/2598__;!!Ka_JY85zDv0FFw!heMONijr4_sHPX56n1O3LeL01c4pQrU8Z0zjYsgVFC37GJvjNkn_5r5VaCKNvtoK1ehqfVlIXSzCp02fAQlTF5epQY8$>
(originally in an email from @glarose
<https://urldefense.com/v3/__https://github.com/glarose__;!!Ka_JY85zDv0FFw!heMONijr4_sHPX56n1O3LeL01c4pQrU8Z0zjYsgVFC37GJvjNkn_5r5VaCKNvtoK1ehqfVlIXSzCp02fAQlTOppLi6Q$>)
is misguided. The alt attribute is not valid for svg tags. In fact, the
only thing that the alt attribute is valid for is an img tag.
Furthermore, screen readers will not read an alt attribute on anything
other than an img tag. So at this point, this pull request doesn't fix
anything, and adds invalid html. Another way to do this will need to be
found.
The aria-label, aria-labelledby, and aria-describedby attributes do work.
However, aria-labelledby is already set for the svg to be the svg title
(which is read by screen readers). So the aria-label attribute also can't
be used. You could add a visually hidden span and use the aria-describedby
attribute. Then both the content of the element pointed to by the
aria-labelledby attribute and the content of the element pointed to by
the aria-describedby attribute are read.
You may also need to add tabindex="0" to the svg. In my testing (with
Gnome Orca) in Firefox, the aria-describedby and aria-labelledby
attributes were not read in browse mode at all, but if the svg is in the
tab order, it could be focused and then the attributes are read. However,
in Google Chrome, it does work in browse mode without the tabindex
attribute. So I am not sure on this. It could be an issue with the Gnome
Orca screen reader, or it could be a Firefox issue.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/openwebwork/webwork2/pull/2624*pullrequestreview-2442463100__;Iw!!Ka_JY85zDv0FFw!heMONijr4_sHPX56n1O3LeL01c4pQrU8Z0zjYsgVFC37GJvjNkn_5r5VaCKNvtoK1ehqfVlIXSzCp02fAQlT8dnsJSM$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABEDOABRRUIHKLBCNOM37VD2BHLMDAVCNFSM6AAAAABR6MEO5CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINBSGQ3DGMJQGA__;!!Ka_JY85zDv0FFw!heMONijr4_sHPX56n1O3LeL01c4pQrU8Z0zjYsgVFC37GJvjNkn_5r5VaCKNvtoK1ehqfVlIXSzCp02fAQlT2qUTxXw$>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Note that this is an inline The warning about the results with screen readers being outdated may apply though, and some cases may have been fixed (or broken?). |
b954ce6
to
ed34db7
Compare
I moved the alt tag text into a |
6a12607
to
2112faf
Compare
This works for me with Google Chrome and Gnome Orca. I still haven't been able to get anything read for the SVG images in Firefox other than by adding I note that currently the SVG title is not a |
Changing the |
2112faf
to
42ea656
Compare
I added |
Yeah, it would mean that. I think the current setup for the title should be fine. |
I am not sure on the |
42ea656
to
d527c67
Compare
Okay, reverted the |
Would remove the |
This adds a long-text `<desc>` tag the histogram images on the stats which fixes the issue mentioned in openwebwork#2598. In addition this fixes some issues I found with the stats page. * Links on the problem bars weren't working so forced them to be a string, along with wrapping the jitar status bar inside the anchor tag to the corresponding problem. * JitarSets - The adjusted status bars were reversed and didn't need to be and the adjusted scores were multiplet by 100 and didn't need to be.
d527c67
to
d630574
Compare
This adds alt text to the histogram images on the stats page which fixes the issue mentioned in #2598.
In addition this fixes some issues I found with the stats page.
Should the additional fixes be made into a hot fix, as these are present in 2.19 too?