Commit b3008f66 by Joe Blaylock

Updating error text for overlong inputs

Updating error text for overlong inputs from "Text is too long." to
"Response text is too large. Please reduce the size of your response and
try to submit again."
parent ead5b179
......@@ -204,7 +204,7 @@ describe("OpenAssessment.Server", function() {
}
);
expect(receivedErrorCode).toEqual("submit");
expect(receivedErrorMsg).toEqual("Text input too large.");
expect(receivedErrorMsg).toEqual("Response text is too large. Please reduce the size of your response and try to submit again.");
});
it("informs the caller of an server error when sending a submission", function() {
......@@ -231,7 +231,7 @@ describe("OpenAssessment.Server", function() {
server.save(test_string).fail(
function(errorMsg) { receivedErrorMsg = errorMsg; }
);
expect(receivedErrorMsg).toEqual("Text input too large.");
expect(receivedErrorMsg).toEqual("Response text is too large. Please reduce the size of your response and try to submit again.");
});
it("informs the caller of an AJAX error when sending a submission", function() {
......@@ -303,7 +303,7 @@ describe("OpenAssessment.Server", function() {
receivedErrorMsg = errorMsg;
}
);
expect(receivedErrorMsg).toEqual("Text input too large.");
expect(receivedErrorMsg).toEqual("Response text is too large. Please reduce the size of your response and try to submit again.");
});
it("informs the caller of a server error when sending a peer assessment", function() {
......@@ -364,7 +364,7 @@ describe("OpenAssessment.Server", function() {
receivedErrorMsg = errorMsg;
}
);
expect(receivedErrorMsg).toEqual("Text input too large.");
expect(receivedErrorMsg).toEqual("Response text is too large. Please reduce the size of your response and try to submit again.");
});
it("informs the caller of an AJAX error when sending feedback on submission", function() {
......
......@@ -121,7 +121,7 @@ OpenAssessment.Server.prototype = {
var url = this.url('submit');
if (submission.length > this.get_max_input_size()) {
return $.Deferred(function(defer) {
defer.rejectWith(this, ["submit", "Text input too large."]);
defer.rejectWith(this, ["submit", "Response text is too large. Please reduce the size of your response and try to submit again."]);
}).promise();
}
return $.Deferred(function(defer) {
......@@ -161,7 +161,7 @@ OpenAssessment.Server.prototype = {
var url = this.url('save_submission');
if (submission.length > this.get_max_input_size()) {
return $.Deferred(function(defer) {
defer.rejectWith(this, ["Text input too large."]);
defer.rejectWith(this, ["Response text is too large. Please reduce the size of your response and try to submit again."]);
}).promise();
}
return $.Deferred(function(defer) {
......@@ -201,7 +201,7 @@ OpenAssessment.Server.prototype = {
var url = this.url('submit_feedback');
if (text.length > this.get_max_input_size()) {
return $.Deferred(function(defer) {
defer.rejectWith(this, ["Text input too large."]);
defer.rejectWith(this, ["Response text is too large. Please reduce the size of your response and try to submit again."]);
}).promise();
}
var payload = JSON.stringify({
......@@ -245,7 +245,7 @@ OpenAssessment.Server.prototype = {
var url = this.url('peer_assess');
if (feedback.length > this.get_max_input_size()) {
return $.Deferred(function(defer) {
defer.rejectWith(this, ["Text input too large."]);
defer.rejectWith(this, ["Response text is too large. Please reduce the size of your response and try to submit again."]);
}).promise();
}
var payload = JSON.stringify({
......
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