diff --git a/edx_sga/static/js/src/edx_sga.js b/edx_sga/static/js/src/edx_sga.js
index fd01a5ff..c99930a5 100644
--- a/edx_sga/static/js/src/edx_sga.js
+++ b/edx_sga/static/js/src/edx_sga.js
@@ -106,8 +106,10 @@ function StaffGradedAssignmentXBlock(runtime, element) {
}
}
});
-
updateChangeEvent(fileUpload);
+ if (!_.isUndefined(state.error)) {
+ $(content).find('p.error').focus();
+ }
}
function renderStaffGrading(data) {
@@ -175,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/show.html b/edx_sga/templates/staff_graded_assignment/show.html
index cedb78df..524dd4d7 100644
--- a/edx_sga/templates/staff_graded_assignment/show.html
+++ b/edx_sga/templates/staff_graded_assignment/show.html
@@ -29,18 +29,18 @@
<% if (upload_allowed) { %>
<% if (uploaded) { %> - {% trans "Upload a different file" %} + {% trans "Upload a different file" %} <% } else { %> - {% trans "Upload your assignment" %} + {% trans "Upload your assignment" %} <% } %> -
<%= error %>
+<%= error %>
<% } %> @@ -165,7 +165,7 @@