Skip to content

Commit fa47cbb

Browse files
committed
add some alt text and some form labels
fixes CNVS-6457 fixes CNVS-6458 fixes CNVS-6461 fixes CNVS-6463 fixes CNVS-6484 fixes CNVS-6492 test plan: - the 'show saved what-if scores' and 'revert to original grade' buttons on the student grades page should be read by a screen reader correctly - when a student has a submission without a grade, an icon shows up in the score column of the students grade page. these should have alt text - icons under the Comment field in speedgrader should have alt text - the Comment field in speedgrader should have an associated label - after clicking on the additional comments icon in a rubric, the text area that pops up in a dialog should have a label - the delete comment link in the speedgrader sidebar should be read correctly by a screenreader Change-Id: I8e8d61942f05a107bfcfc2cc05682ae64a831ed2 Reviewed-on: https://gerrit.instructure.com/22281 Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Amber Taniuchi <amber@instructure.com> Reviewed-by: Cameron Sutter <csutter@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
1 parent c36b855 commit fa47cbb

6 files changed

Lines changed: 47 additions & 28 deletions

File tree

app/stylesheets/speed_grader.sass

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,10 @@
199199
text-align: right
200200
.delete_comment_link
201201
float: right
202-
.ui-icon
203-
opacity: 0.2
202+
color: #666
203+
opacity: 0.5
204204
&:hover, &:focus
205-
background-color: none
206-
.ui-icon
207-
opacity: 1
205+
opacity: 1
208206

209207
h2, .h2
210208
background: #E3E3E3 url('/images/h2_bg.png') repeat-x scroll 0% 36%

app/views/gradebooks/_submission_score.html.erb

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
<% else %>
55
<% grade = nil; score = nil
66
@submission_score_lookup ||= {
7-
'online_url' => 'link.png',
8-
'online_text_entry' => 'text_entry.png',
9-
'discussion_topic' => 'text_entry.png',
10-
'online_upload' => 'file.png',
11-
'online_quiz' => 'quiz.png'
7+
'online_url' => {
8+
:path => 'link.png',
9+
:alt => t('icons.online_url_submission', 'Online Url Submission') },
10+
'online_text_entry' => {
11+
:path => 'text_entry.png',
12+
:alt => t('icons.text_entry_submission', 'Text Entry Submission') },
13+
'online_upload' => {
14+
:path => 'file.png',
15+
:alt => t('icons.file_upload_submission', 'File Upload Submission') },
16+
'discussion_topic' => {
17+
:path => 'text_entry.png',
18+
:alt => t('icons.discussion_submission', 'Discussion Submission') },
19+
'online_quiz' => {
20+
:path => 'quiz.png',
21+
:alt => t('icons.quiz_submission', 'Quiz Submission') }
1222
}
1323
if submission
1424
grade = student_score ? submission.published_grade : submission.grade
@@ -28,7 +38,8 @@
2838
<%= grade.to_f.round(2) %>
2939
<% end %>
3040
<% elsif submission && submission.submission_type %>
31-
<%= @submission_score_lookup[submission.submission_type] ? image_tag(@submission_score_lookup[submission.submission_type], :class => "submission_icon") : ' - ' %>
41+
<% sub_score = @submission_score_lookup[submission.submission_type] %>
42+
<%= sub_score ? image_tag(sub_score[:path], :class => "submission_icon", :alt => sub_score[:alt]) : ' - ' %>
3243
<% else %>
3344
-
3445
<% end %>

app/views/gradebooks/grade_summary.html.erb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
<% end %>
2828
<% if @presenter.editable? %>
2929
<div class="show_guess_grades" style="display: none; margin-bottom: 10px; font-size: 0.8em;">
30-
<button type="button" class="btn button-sidebar-wide show_guess_grades_link"><%= image_tag "grading_icon.png" %> <%= t('buttons.show_what_if', "Show Saved \"What-If\" Scores") %></button>
30+
<button type="button" class="btn button-sidebar-wide show_guess_grades_link"><%= image_tag "grading_icon.png", :alt => "" %> <%= t('buttons.show_what_if', "Show Saved \"What-If\" Scores") %></button>
3131
</div>
3232
<div class="revert_all_scores" style="font-size: 0.8em; padding-left: 10px; display: none;">
3333
<%= t(:not_official, "*NOTE*: This is NOT your official score.") %><br/>
34-
<a href="#" class="btn revert_all_scores_link"><%= image_tag "back.png" %> <%= t('links.revert_score', "Revert to Actual Score") %></a>
34+
<a href="#" class="btn revert_all_scores_link"><%= image_tag "back.png", :alt => "" %> <%= t('links.revert_score', "Revert to Actual Score") %></a>
3535
</div>
3636
<% end %>
3737
<div class="show_all_details" style="font-size: 0.8em; margin-top: 10px;">
@@ -205,7 +205,7 @@
205205
<span class="tooltip_wrap right">
206206
<span class="tooltip_text"><%= t(:see_rubric_results, "See rubric results") %></span>
207207
</span>
208-
<%= image_tag "rubric.png" %>
208+
<%= image_tag "rubric.png", :alt => t('icons.rubric_results', 'See rubric results') %>
209209
</a>
210210
<% if @presenter.turnitin_enabled? %>
211211
<%
@@ -222,7 +222,7 @@
222222
end
223223
%>
224224
<a class="tooltip" title="<%= t('titles.turnitin_score', "Turnitin similarity score -- more information") %>" href="<%= url %>" style="<%= 'visibility: hidden;' if !turnitin %>" target="_blank">
225-
<%= turnitin ? image_tag("turnitin_#{turnitin && turnitin[:state]}_score.png") : image_tag("blank.png", :alt => '') %>
225+
<%= turnitin ? image_tag("turnitin_#{turnitin && turnitin[:state]}_score.png", :alt => t('icons.turnitin_results', 'See Turnitin results')) : image_tag("blank.png", :alt => '') %>
226226
<span class="tooltip_wrap right">
227227
<span class="tooltip_text"><%= t(:see_turnitin_results, "See Turnitin results") %></span>
228228
</span>
@@ -305,7 +305,7 @@
305305
<div style="text-align: right; font-size: 0.8em; margin-right: 10px; clear: both;">
306306
<% comment.attachments.each do |attachment| %>
307307
<div>
308-
<a href="<%= context_url(@context, :context_assignment_submission_url, submission.assignment_id, submission.user_id, :download => attachment.id, :comment_id => comment.id) %>"><%= image_tag "file.png", :style => "height: 12px;" %><%= t('links.download', "Download %{attachment}", :attachment => attachment.display_name) %></a>
308+
<a href="<%= context_url(@context, :context_assignment_submission_url, submission.assignment_id, submission.user_id, :download => attachment.id, :comment_id => comment.id) %>"><%= image_tag "file.png", :style => "height: 12px;", :alt => "" %><%= t('links.download', "Download %{attachment}", :attachment => attachment.display_name) %></a>
309309
</div>
310310
<% end %>
311311
</div>
@@ -331,12 +331,12 @@
331331
<% end %>
332332
</table>
333333
<% if @presenter.has_muted_assignments? %>
334-
<small><%= image_tag "sound_mute.png" %><%= t(:student_mute_legend, "Your instructor is working on grades. While your instructor is working on grades, grade and comment information is unavailable.") %></small>
334+
<small><%= image_tag "sound_mute.png", :alt => "" %><%= t(:student_mute_legend, "Your instructor is working on grades. While your instructor is working on grades, grade and comment information is unavailable.") %></small>
335335
<% end %>
336336
<div id="total_groups_weight" style="display: none;"><%= @presenter.total_weight %></div>
337337
<%= render :partial => "shared/rubric_criterion_dialog" %>
338338
<input type="text" style="width: 40px; display: none;" id="grade_entry"/>
339-
<a href="#" id="revert_score_template" class="revert_score_link" title="<%= t('titles.revert_score', "Revert to original score") %>"><%= image_tag "back.png" %></a>
339+
<a href="#" id="revert_score_template" class="revert_score_link" title="<%= t('titles.revert_score', "Revert to original score") %>"><%= image_tag "back.png", :alt => "" %></a>
340340
<a href="<%= context_url(@context, :context_assignment_submission_url, "{{ assignment_id }}", @presenter.student_id) %>" class="update_submission_url" style="display: none;">&nbsp;</a>
341341
<% if @context.grading_standard_enabled? %>
342342
<% js_block do %>

app/views/gradebooks/speed_grader.html.erb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@
173173
<div id="discussion">
174174
<div id="comments">
175175
<div class="comment" id="comment_blank" style="display: none;">
176-
<a href="javascript:void 0;" class="delete_comment_link"><span class="ui-icon ui-icon-close"></span></a>
176+
<a href="javascript:void 0;" class="delete_comment_link icon-x">
177+
<span class="screenreader-only"><%= t('icons.delete_comment', 'Delete comment') %></span>
178+
</a>
177179
<img src="#" class="avatar" alt="" style="display: none;"/>
178180
<span class="comment"></span>
179181
<a href="#" class="play_comment_link media-comment" style="display:none;"><%= t('links.click_to_view', "click here to view") %></a>
@@ -191,8 +193,8 @@
191193

192194
<% unless @context.completed? || @context_enrollment.try(:completed?) %>
193195
<form id="add_a_comment">
194-
<label><%= t('labels.add_comment', "Add a Comment") %></label>
195-
<textarea></textarea>
196+
<label for="speedgrader_comment_textarea"><%= t('labels.add_comment', "Add a Comment") %></label>
197+
<textarea id="speedgrader_comment_textarea"></textarea>
196198
<div>
197199
<div id="media_media_recording" style="display: none;">
198200
<div class="media_recording"></div>
@@ -218,7 +220,7 @@
218220
<span class="tooltip_wrap">
219221
<span class="tooltip_text"><%= t('tooltips.file_attachment', "File Attachment") %></span>
220222
</span>
221-
<span class="icon"><%= image_tag "file_multiple.png" %></span>
223+
<span class="icon"><%= image_tag "file_multiple.png", :alt => t('icons.file_attachment', 'File Attachment') %></span>
222224
</a>
223225
</li>
224226
<% if feature_enabled?(:kaltura) %>
@@ -227,15 +229,15 @@
227229
<span class="tooltip_wrap">
228230
<span class="tooltip_text"><%= t('tooltips.media_comment', "Media Comment") %></span>
229231
</span>
230-
<span class="icon"><%= image_tag "webcam.png" %></span>
232+
<span class="icon"><%= image_tag "webcam.png", :alt => t('icons.media_comment', 'Media Comment') %></span>
231233
</a>
232234
</li>
233235
<li style="display:none">
234236
<a class="speech_recognition_link tooltip" href="#">
235237
<span class="tooltip_wrap">
236238
<span class="tooltip_text"><%= t('tooltips.speech_recognition', "Speech Recognition") %></span>
237239
</span>
238-
<span class="icon"><%= image_tag "microphone_pencil.png" %></span>
240+
<span class="icon"><%= image_tag "microphone_pencil.png", :alt => t('icons.speech_recognition', 'Speech Recognition') %></span>
239241
</a>
240242
</li>
241243
<% end %>

app/views/shared/_rubric_criterion.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
</div>
9595
<div class="criterion_comments">
9696
<% if !rubric || !rubric.free_form_criterion_comments %>
97-
<a href="#" class="no-hover criterion_comments" title="<%= t 'links.additional_comments', "Additional Comments" %>"><%= image_tag "rubric_comment.png" %></a>
97+
<a href="#" class="no-hover criterion_comments" title="<%= t 'links.additional_comments', "Additional Comments" %>">
98+
<%= image_tag "rubric_comment.png", :alt => t('icons.additional_comments', 'Additional Comments') %>
99+
</a>
98100
<div class="custom_rating" style="display: none;"><%= assessment_rating ? assessment_rating[:comments] : '' %></div>
99101
<% end %>
100102
</div>

app/views/shared/_rubric_criterion_dialog.html.erb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@
1717
<div class="criterion_description" style="border-bottom: 1px solid #ccc; padding: 5px 0; font-size: 1.2em; font-weight: bold; margin-bottom: 5px;">
1818
</div>
1919
<div class="editing">
20-
<%= before_label :additional_comments, "Additional Comments" %>
21-
<textarea class="criterion_comments" name="criterion_comments" style="width: 370px;"></textarea>
20+
<label for="criterion_comments_textarea">
21+
<%= before_label :additional_comments, "Additional Comments" %>
22+
</label>
23+
<textarea
24+
id="criterion_comments_textarea"
25+
class="criterion_comments"
26+
name="criterion_comments"
27+
style="width: 370px;"></textarea>
2228
<div class="button-container">
2329
<button type="button" class="btn save_button"><%= t 'buttons.update_comments', "Update Comments" %></button>
2430
<button type="button" class="btn btn button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
@@ -29,4 +35,4 @@
2935
<div class="criterion_comments" style="margin-top: 10px;">
3036
</div>
3137
</div>
32-
</div>
38+
</div>

0 commit comments

Comments
 (0)