Commit f4661727 by Stephen Sanchez

Merge pull request #481 from edx/sanchez/better-image-submission-errors

Fixing error toggling for server-side errors.
parents 359d0c39 ccbc7ea4
......@@ -451,7 +451,6 @@ OpenAssessment.ResponseView.prototype = {
var view = this;
var fileUpload = $("#file__upload");
fileUpload.addClass("is--disabled");
var errorMsg = null;
// Call getUploadUrl to get the one-time upload URL for this file. Once
// completed, execute a sequential AJAX call to upload to the returned
......@@ -468,18 +467,17 @@ OpenAssessment.ResponseView.prototype = {
contentType: view.imageType,
success: function(data, textStatus, jqXHR) {
view.imageUrl();
this.baseView.toggleActionError('upload', null);
},
error: function(jqXHR, textStatus, errorThrown) {
errorMsg = textStatus;
view.baseView.toggleActionError('upload', textStatus);
fileUpload.removeClass("is--disabled");
}
});
}).fail(function(errMsg) {
errorMsg = errMsg;
});
if (errorMsg != null) {
view.baseView.toggleActionError('upload', errorMsg);
view.baseView.toggleActionError('upload', errMsg);
fileUpload.removeClass("is--disabled");
}
});
},
/**
......
......@@ -725,6 +725,7 @@
"due": null,
"submission_start": null,
"submission_due": null,
"allow_file_upload": null,
"criteria": [
{
"order_num": 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment