diff --git a/edx_sga/static/js/src/edx_sga.js b/edx_sga/static/js/src/edx_sga.js
index 38db877b..c99930a5 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) {
@@ -169,10 +177,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 %}
-