#315 Adding UI handling and corresponding expected elements for html files for decoration. Inlucdes minor refactor
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user