Skip to content

Commit

Permalink
SAK-43847 - gradebook, accessibility: Set Score for Empty Cells inval…
Browse files Browse the repository at this point in the history
…id score error message prevents other actions (sakaiproject#8319)

Rename to enableInputs, remove code for dontDisableInputs that doesn't seem to be called.
  • Loading branch information
jonespm authored Jun 29, 2020
1 parent 2109524 commit c5dbde5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
// InvalidGradeException
error(getString("grade.notifications.invalid"));
target.addChildren(form, FeedbackPanel.class);
target.appendJavaScript("new GradebookUpdateUngraded($(\"#" + getParent().getMarkupId() + "\", /* dontDisableInputs = */ true));");
target.appendJavaScript("new GradebookUpdateUngraded($(\"#" + getParent().getMarkupId() + "\"), /* enableInputs = */ true);");
}
} catch (final NumberFormatException e) {
// InvalidGradeException
error(getString("grade.notifications.invalid"));
target.addChildren(form, FeedbackPanel.class);
target.appendJavaScript("new GradebookUpdateUngraded($(\"#" + getParent().getMarkupId() + "\"));");
target.appendJavaScript("new GradebookUpdateUngraded($(\"#" + getParent().getMarkupId() + "\"), /* enableInputs = */ true);");
}
}
};
Expand Down
12 changes: 7 additions & 5 deletions gradebookng/tool/src/webapp/scripts/gradebook-update-ungraded.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
/**************************************************************************************
* A GradebookUpdateUngraded to encapsulate all the update ungraded form behaviours
*/
function GradebookUpdateUngraded($content, dontDisableInputs) {
function GradebookUpdateUngraded($content, enableInputs) {

this.$content = $content;
this.dontDisableInputs = dontDisableInputs;
this.setupConfirmation();

// Attempt to re-enable any disabled inputs
if (enableInputs) {
this.$content.find(":input").prop("disabled", false);
}
};

GradebookUpdateUngraded.prototype.setupConfirmation = function(){
Expand Down Expand Up @@ -59,9 +63,7 @@ GradebookUpdateUngraded.prototype.setupConfirmation = function(){

function performRealSubmit() {
self.$content.find(".gb-update-ungraded-real-submit").trigger("click");
if (!self.dontDisableInputs) {
self.$content.find(":input").prop("disabled", true);
}
self.$content.find(":input").prop("disabled", true);
};


Expand Down

0 comments on commit c5dbde5

Please sign in to comment.