diff --git a/edx_sga/static/js/src/edx_sga.js b/edx_sga/static/js/src/edx_sga.js index c0200d38..ed4e1b1c 100644 --- a/edx_sga/static/js/src/edx_sga.js +++ b/edx_sga/static/js/src/edx_sga.js @@ -48,13 +48,19 @@ function StaffGradedAssignmentXBlock(runtime, element) { return; } } + var uploadElement = $(content).find(".upload"); + uploadElement.attr("role", "progressbar"); + uploadElement.attr("aria-valuemax", "100"); + uploadElement.attr("aria-valuemin", "0"); data.submit(); }); }, progressall: function(e, data) { var percent = parseInt(data.loaded / data.total * 100, 10); - $(content).find('.upload').text( - 'Uploading... ' + percent + '%'); + var uploadElement = $(content).find(".upload"); + uploadElement.text("Uploading... " + percent + "%"); + uploadElement.attr("aria-valuenow" , percent); + uploadElement.attr("aria-valuetext" , "Uploading... " + percent + "%"); }, fail: function(e, data) { /** @@ -100,8 +106,10 @@ function StaffGradedAssignmentXBlock(runtime, element) { } } }); - updateChangeEvent(fileUpload); + if (!_.isUndefined(state.error)) { + $(content).find('p.error').focus(); + } } function renderStaffGrading(data) { @@ -198,10 +206,13 @@ function StaffGradedAssignmentXBlock(runtime, element) { event.preventDefault(); if (isNaN(score)) { form.find('.error').html('
Grade must be a number.'); + form.find('.error').focus(); } else if (score !== parseInt(score)) { form.find('.error').html('
Grade must be an integer.'); + form.find('.error').focus(); } else if (score < 0) { form.find('.error').html('
Grade must be positive.'); + form.find('.error').focus(); } else if (score > max_score) { form.find('.error').html('
Maximum score is ' + max_score); } else { diff --git a/edx_sga/templates/staff_graded_assignment/edit.html b/edx_sga/templates/staff_graded_assignment/edit.html index 4ef3d34a..876b6908 100644 --- a/edx_sga/templates/staff_graded_assignment/edit.html +++ b/edx_sga/templates/staff_graded_assignment/edit.html @@ -1,22 +1,23 @@ {% load i18n %} -
- +
diff --git a/edx_sga/templates/staff_graded_assignment/show.html b/edx_sga/templates/staff_graded_assignment/show.html index b9e96974..bc547d47 100644 --- a/edx_sga/templates/staff_graded_assignment/show.html +++ b/edx_sga/templates/staff_graded_assignment/show.html @@ -1,14 +1,15 @@ {% load i18n %}
+ data-staff="{{ is_course_staff }}" role="article" aria-describedby="title"> @@ -93,7 +94,7 @@ <% if (assignment.may_grade) { %> - + <% if (assignment.needs_approval) { %> {% trans "Approve grade" %} <% } else { %> @@ -103,7 +104,7 @@ <% } %> -
+ @@ -114,14 +115,14 @@ -