#315 Adding UI handling and corresponding expected elements for html files for decoration. Inlucdes minor refactor
This commit is contained in:
@ -64,8 +64,8 @@ define(['jquery',
|
||||
this.listenTo(this.lessonContent,'content:loaded',this.onContentLoaded);
|
||||
this.userAndInfoView = new UserAndInfoView();
|
||||
this.menuButtonView = new MenuButtonView();
|
||||
this.listenTo(this.lessonContentView, 'lesson:complete', this.updateMenu);
|
||||
this.listenTo(this.lessonContentView, 'lesson:complete', this.updateLessonOverview);
|
||||
this.listenTo(this.lessonContentView, 'assignment:complete', this.updateMenu);
|
||||
this.listenTo(this.lessonContentView, 'assignment:complete', this.updateLessonOverview);
|
||||
};
|
||||
|
||||
this.loadLesson = function(name,pageNum) {
|
||||
|
@ -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);
|
||||
|
@ -16,7 +16,7 @@ define(['jquery',
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
if (this.model.get("lessonCompleted")) {
|
||||
if (this.model.get("assignmentCompleted")) {
|
||||
this.$el.html(this.model.get('successMessage'));
|
||||
} else {
|
||||
this.$el.html("");
|
||||
|
Reference in New Issue
Block a user