Remove aria labels from radio buttons. #1224
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was requested by @glarose and the accessibility experts at the University of Michigan. Having aria labels on these radio buttons that also have labels causes issues with screen readers. It results in the aria label being read and not the actual label.
It seems to me that this is correct in any case. An input should not have both a label and an aria label. Those clearly conflict.
Also improve the aria labels for the answers inside the radio buttons for a
RadioMultiAnswer
. For this theparserRadioMultiAnswer.pl
macro has its own generate_aria_label method for now as thegenerate_aria_label
method inPGbasicmacros.pl
does not work well for theparserRadioMultiAnswer.pl
macro.In addition add some missing
maketext
calls on aria labels, and take advantage thatmaketext
substitutions now work in PG.We need to find a better way to create aria labels in general. The
generate_aria_label
method inPGbasicmacros.pl
is neither versatile nor extensible. Attempting to construct meaningful labels from PG's answer name was never a good idea to begin with. By the way, since the aria label is currently constructed from the answer name, this is yet another reason to strongly discourage (actually flat out forbid) problem authors from using hard coded made up answer names in problems instead of callingNEW_ANS_NAME
to obtain one.