From 31673b1f971ffbbc9a4e0bd0a3073f8fdb5743b4 Mon Sep 17 00:00:00 2001 From: Amir Qayyum Khan Date: Thu, 30 Jul 2015 16:42:37 +0500 Subject: [PATCH] Fix type and added some aria fields --- edx_sga/static/js/src/edx_sga.js | 7 ++++++- edx_sga/templates/staff_graded_assignment/show.html | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) 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" %} <% } %> -

+

<% } %> <% if (error) { %> -

<%= error %>

+ <% } %> @@ -165,7 +165,7 @@
Grade for
Grade: -
+
Comment: