#315 Adding UI handling and corresponding expected elements for html files for decoration. Inlucdes minor refactor

This commit is contained in:
Jason White
2017-01-25 11:18:24 -05:00
committed by Nanne Baars
parent dd76cb258c
commit ac16342c17
11 changed files with 361 additions and 345 deletions

View File

@ -114,13 +114,24 @@ define(['jquery',
this.renderFeedback(data.feedback);
this.renderOutput(data.output || "");
if (data.lessonCompleted) {
this.curForm.reset();
this.trigger('lesson:complete');
if (data.assignmentCompleted) {
this.markAssignmentComplete();
this.trigger('assignment:complete');
} else {
this.markAssignmentIncomplete();
}
return false;
},
markAssignmentComplete: function () {
this.curForm.reset();
$(this.curForm).siblings('.assignment-success').find('i').removeClass('hidden');
},
markAssignmentIncomplete: function () {
$(this.curForm).siblings('.assignment-success').find('i').addClass('hidden');
},
onErrorResponse: function (a,b,c) {
console.error(a);
console.error(b);