make points input more accessible

Added an aria-label to the points input.
Changed translation stuff in the ERB to be a bit less crazy and
more inline with the I18N wiki (with usage of `:wrapper`) while still
maintaining the output as a single traslation block.

fixes CNVS-6456

test plan:
 - go to assignment creation page
 - add a rubric
 - verify that "Points" is read via VoiceOver when the criterion points field is
   focused
 - verify that there is no text following the points input field

 - go to SpeedGrader™ with an assignment that has a rubric
 - verify that "Points" is read via VoiceOver for the criterion points
   field
 - verify that there is a label like "/5pts" following the input field

Change-Id: If3e36bbc18db14f26906c85347a15497513a7c6a
Reviewed-on: https://gerrit.instructure.com/23903
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
This commit is contained in:
Matthew Irish 2013-08-29 11:15:57 -06:00
parent ca01e54aee
commit ddda935387
1 changed files with 7 additions and 6 deletions

View File

@ -84,12 +84,13 @@
<td class="nobr points_form">
<div class="editing" style="white-space: normal">
<span style="white-space: nowrap; font-size: 0.8em">
<% rating_points = %{<input type="text" value="#{ assessing ? (assessment_rating.points rescue "") : (criterion.points rescue 5) }" class="criterion_points span1 no-margin-bottom" />}.html_safe %>
<% if assessing && criterion && criterion.points %>
<%= t :points_out_of, "%{points} / %{total} pts", :points => rating_points, :total => criterion.points %>
<% else %>
<%= t :points, "%{points} pts", :points => rating_points %>
<% end %>
<% rating_points = assessing ? (assessment_rating.points rescue "") : (criterion.points rescue 5) %>
<% points_wrapper = "<input type='text' aria-label='\\1' value='#{rating_points}' class='criterion_points span1 no-margin-bottom' />" %>
<% if assessing && criterion && criterion.points %>
<%= t :points_out_of, "*Points* / %{total} pts", :total => criterion.points, :wrapper => points_wrapper %>
<% else %>
<%= t :points_abbreviation, "*Points* pts", :wrapper => points_wrapper %>
<% end %>
</span><br />
</div>
<div class="displaying">