|
1 | 1 | {% load i18n %} |
2 | 2 |
|
3 | 3 | <div class="sga-block" data-state="{{ student_state }}" data-max-size="{{ max_file_size }}" |
4 | | - data-staff="{{ is_course_staff }}"> |
| 4 | + data-staff="{{ is_course_staff }}" role="article" aria-describedby="title"> |
5 | 5 | <script type="text/template" id="sga-tmpl"> |
6 | 6 | <% if (display_name) { %> |
7 | | - <b><%= display_name %></b> |
| 7 | + <b id="title"><%= display_name %></b> |
8 | 8 | <% } %> |
9 | 9 | <% if (uploaded) { %> |
10 | | - <p><b>File uploaded</b> |
11 | | - <a href="<%= downloadUrl %>"><%= uploaded.filename %></a></p> |
| 10 | + <br/> |
| 11 | + <label for="file_uploaded"><b>File uploaded</b></label> |
| 12 | + <a href="<%= downloadUrl %>" role="link" id="file_uploaded"><%= uploaded.filename %></a> |
12 | 13 | <% } else { %> |
13 | | - <p>No file has been uploaded.</p> |
| 14 | + <p tabindex="0">No file has been uploaded.</p> |
14 | 15 | <% } %> |
15 | 16 | <% if (graded) { %> |
16 | | - <p>Your score is <%= graded.score %> / <%= max_score %><br/> |
| 17 | + <p><span tabindex="0">Your score is <%= graded.score %> / <%= max_score %></span><br/> |
17 | 18 | <% if (graded.comment) { %> |
18 | | - <b>Instructor comment</b> <%= graded.comment %> |
| 19 | + <b tabindex="0">Instructor comment</b> <%= graded.comment %> |
19 | 20 | <% } %> |
20 | 21 | <% if (annotated) { %><br/> |
21 | | - <b>Annotated file from instructor</b> |
22 | | - <a href="<%= annotatedUrl %>"><%= annotated.filename %></a> |
| 22 | + <b id="annotated_file">Annotated file from instructor</b> |
| 23 | + <a href="<%= annotatedUrl %>" role="link" aria-describedby="annotated_file"><%= annotated.filename %></a> |
23 | 24 | <% } %> |
24 | 25 | </p> |
25 | 26 | <% } else if (uploaded) { %> |
26 | | - {% trans "This assignment has not yet been graded." %} |
| 27 | + <p tabindex="0">{% trans "This assignment has not yet been graded." %}</p> |
27 | 28 | <% } %> |
28 | 29 | <% if (upload_allowed) { %> |
29 | 30 | <p> |
30 | 31 | <% if (uploaded) { %> |
31 | | - {% trans "Upload a different file" %} |
| 32 | + <span id="upload_lable">{% trans "Upload a different file" %}</span> |
32 | 33 | <% } else { %> |
33 | | - {% trans "Upload your assignment" %} |
| 34 | + <span id="upload_lable">{% trans "Upload your assignment" %}</span> |
34 | 35 | <% } %> |
35 | | - <div class="upload"> |
| 36 | + <div class="upload" aria-describedby="upload_lable" aria-live="polite"> |
36 | 37 | <input class="fileupload" type="file" name="assignment"/> |
37 | | - <button>Select a file</button> |
| 38 | + <button role="button">Select a file</button> |
38 | 39 | </div> |
39 | 40 | </p> |
40 | 41 | <% } %> |
41 | 42 | <% if (error) { %> |
42 | | - <p class="error"><%= error %></p> |
| 43 | + <p class="error" tabindex="0"><%= error %></p> |
43 | 44 | <% } %> |
44 | 45 | </script> |
45 | 46 |
|
|
48 | 49 |
|
49 | 50 | {% if is_course_staff %} |
50 | 51 | <script type="text/template" id="sga-grading-tmpl"> |
51 | | - <table class="gridtable"> |
52 | | - <tr> |
53 | | - <th>Username</th> |
54 | | - <th>Name</th> |
55 | | - <th>Filename</th> |
56 | | - <th>Uploaded</th> |
57 | | - <th>Grade</th> |
58 | | - <th>Instructor's comments</th> |
59 | | - <th>Annotated</th> |
| 52 | + <table class="gridtable" role="grid"> |
| 53 | + <tr role="row"> |
| 54 | + <th role="columnheader">Username</th> |
| 55 | + <th role="columnheader">Name</th> |
| 56 | + <th role="columnheader">Filename</th> |
| 57 | + <th role="columnheader">Uploaded</th> |
| 58 | + <th role="columnheader">Grade</th> |
| 59 | + <th role="columnheader">Instructor's comments</th> |
| 60 | + <th role="columnheader">Annotated</th> |
60 | 61 | </tr> |
61 | 62 | <% for (var i = 0; i < assignments.length; i++) { %> |
62 | 63 | <% var assignment = assignments[i]; %> |
63 | | - <tr id="row-<%= assignment.module_id %>"> |
64 | | - <td><%= assignment.username %></td> |
65 | | - <td><%= assignment.fullname %></td> |
66 | | - <td> |
| 64 | + <tr id="row-<%= assignment.module_id %>" role="row"> |
| 65 | + <td role="gridcell" tabindex="0"><%= assignment.username %></td> |
| 66 | + <td role="gridcell" tabindex="0"><%= assignment.fullname %></td> |
| 67 | + <td role="gridcell" tabindex="0"> |
67 | 68 | <% if (assignment.filename) { %> |
68 | 69 | <a href="<%= downloadUrl %>?student_id=<%= assignment.student_id %>"> |
69 | 70 | <%= assignment.filename %> |
70 | 71 | </a> |
71 | 72 | <% } %> |
72 | 73 | </td> |
73 | | - <td><%= assignment.timestamp %></td> |
74 | | - <td> |
| 74 | + <td role="gridcell" tabindex="0"><%= assignment.timestamp %></td> |
| 75 | + <td role="gridcell" tabindex="0"> |
75 | 76 | <% if (assignment.score !== null) { %> |
76 | 77 | <%= assignment.score %> / |
77 | 78 | <%= max_score %> |
|
80 | 81 | <% } %> |
81 | 82 | <% } %> |
82 | 83 | </td> |
83 | | - <td><%= assignment.comment %></td> |
84 | | - <td> |
| 84 | + <td role="gridcell" tabindex="0"><%= assignment.comment %></td> |
| 85 | + <td role="gridcell" tabindex="0"> |
85 | 86 | <% if (assignment.annotated) { %> |
86 | 87 | <a href="<%= annotatedUrl %>?module_id=<%= assignment.module_id %>"> |
87 | 88 | <%= assignment.annotated %> |
|
90 | 91 | </td> |
91 | 92 | <td> |
92 | 93 | <% if (assignment.may_grade) { %> |
93 | | - <a class="enter-grade-button button" href="#{{ id }}-enter-grade"> |
| 94 | + <a class="enter-grade-button button" href="#{{ id }}-enter-grade" role="button"> |
94 | 95 | <% if (assignment.needs_approval) { %> |
95 | 96 | {% trans "Approve grade" %} |
96 | 97 | <% } else { %> |
|
100 | 101 | <% } %> |
101 | 102 | </td> |
102 | 103 | <td> |
103 | | - <div class="upload"> |
| 104 | + <div class="upload" aria-live="polite"> |
104 | 105 | <input class="fileupload" type="file" name="annotated"/> |
105 | | - <button>Upload annotated file</button> |
| 106 | + <button role="button">Upload annotated file</button> |
106 | 107 | </div> |
107 | 108 | </td> |
108 | 109 | </tr> |
109 | 110 | <% } %> |
110 | 111 | </table> |
111 | 112 | </script> |
112 | 113 |
|
113 | | - <div aria-hidden="true" class="wrap-instructor-info"> |
114 | | - <a class="instructor-info-action" id="grade-submissions-button" |
| 114 | + <div class="wrap-instructor-info"> |
| 115 | + <a class="instructor-info-action" id="grade-submissions-button" role="link" tabindex="0" aria-expanded="true" |
115 | 116 | href="#{{ id }}-grade">{% trans "Grade Submissions" %}</a> |
116 | | - <a class="instructor-info-action" id="staff-debug-info-button" |
| 117 | + <a class="instructor-info-action" id="staff-debug-info-button" role="link" tabindex="0" aria-expanded="true" |
117 | 118 | href="#{{ id }}-debug">{% trans "Staff Debug Info" %}</a> |
118 | 119 | </div> |
119 | 120 |
|
120 | | - <section aria-hidden="true" class="modal staff-modal" id="{{ id }}-grade" style="height: 75%"> |
| 121 | + <section class="modal staff-modal" id="{{ id }}-grade" style="height: 75%"> |
121 | 122 | <div class="inner-wrapper" style="color: black; overflow: auto;"> |
122 | 123 | <header><h2><span class="display_name">{{ display_name }}</span> - {% trans "Staff Graded Assignment" %}</h2></header> |
123 | 124 | <br/> |
|
127 | 128 | </div> |
128 | 129 | </section> |
129 | 130 |
|
130 | | - <section aria-hidden="true" class="modal staff-modal" |
| 131 | + <section class="modal staff-modal" |
131 | 132 | style="height: 80%" id="{{ id }}-debug"> |
132 | 133 | <div class="inner-wrapper" style="color: black"> |
133 | | - <header><h2>{% trans "Staff Debug" %}</h2></header> |
| 134 | + <header role="banner"><h2 role="heading">{% trans "Staff Debug" %}</h2></header> |
134 | 135 | <br/> |
135 | | - <div class="staff_info" style="display: block; white-space: normal"> |
136 | | - is_released = {{ is_released }}<br/> |
137 | | - location = {{ location }}<br/> |
| 136 | + <div class="staff_info" style="display: block; white-space: normal" aria-readonly="true"> |
| 137 | + <span tabindex="0">is_released = {{ is_released }}</span> <br/> |
| 138 | + <span tabindex="0">location = {{ location }}</span><br/> |
138 | 139 | <br/> |
139 | | - <table summary="${_('Module Fields')}"> |
140 | | - <tr><th>{% trans "Module Fields" %}</th></tr> |
| 140 | + <table summary="${_('Module Fields')}" role="grid"> |
| 141 | + <tr role="row"><th role="columnheader" tabindex="0">{% trans "Module Fields" %}</th></tr> |
141 | 142 | {% for name, field in fields %} |
142 | | - <tr> |
143 | | - <td>{{name}}</td> |
144 | | - <td> |
145 | | - <pre style="display:inline-block; margin: 0;">{{field}}</pre> |
| 143 | + <tr role="row"> |
| 144 | + <td role="gridcell" tabindex="0">{{name}}</td> |
| 145 | + <td role="gridcell"> |
| 146 | + <pre style="display:inline-block; margin: 0;" tabindex="0">{{field}}</pre> |
146 | 147 | </td> |
147 | 148 | </tr> |
148 | 149 | {% endfor %} |
149 | 150 | </table><br/> |
150 | | - category = {{category}} |
| 151 | + <span tabindex="0">category = {{category}}</span> |
151 | 152 | </div> |
152 | 153 | </div> |
153 | 154 | </section> |
154 | 155 |
|
155 | | - <section aria-hidden="true" class="modal grade-modal" id="{{ id }}-enter-grade"> |
| 156 | + <section class="modal grade-modal" id="{{ id }}-enter-grade"> |
156 | 157 | <div class="inner-wrapper" style="color: black"> |
157 | 158 | <header><h2> |
158 | 159 | {% trans "Enter Grade" %} |
|
0 commit comments