Commit 7063f2f3 by Will Daly

Merge pull request #140 from edx/will/update-save-error-dom

Put save status in an h3 tag to preserve styling
parents 20c90070 78325414
...@@ -281,17 +281,27 @@ OpenAssessment.BaseUI.prototype = { ...@@ -281,17 +281,27 @@ OpenAssessment.BaseUI.prototype = {
// Retrieve the student's response from the DOM // Retrieve the student's response from the DOM
var submission = $('#submission__answer__value', this.element).val(); var submission = $('#submission__answer__value', this.element).val();
var ui = this; var ui = this;
$('#response__save_status', this.element).html('Saving...'); this.setSaveStatus('Saving...');
this.toggleActionError('save', null); this.toggleActionError('save', null);
this.server.save(submission).done(function() { this.server.save(submission).done(function() {
$('#response__save_status', this.element).html("Saved but not submitted"); ui.setSaveStatus("Saved but not submitted");
}).fail(function(errMsg) { }).fail(function(errMsg) {
$("#response__save_status", ui.element).html('Error'); ui.setSaveStatus('Error');
ui.toggleActionError('save', errMsg); ui.toggleActionError('save', errMsg);
}); });
}, },
/** /**
Display a save status message.
Args:
msg (str): The message to display.
**/
setSaveStatus: function(msg) {
$('#response__save_status h3', this.element).html(msg);
},
/**
Send a submission to the server and update the UI. Send a submission to the server and update the UI.
**/ **/
submit: function() { submit: function() {
......
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