#271 Reset lesson does not work anymore

This commit is contained in:
Nanne Baars
2016-11-15 10:26:09 +01:00
parent 5babe19f2b
commit 2728158f14
6 changed files with 17 additions and 27 deletions

View File

@ -187,22 +187,11 @@ define(['jquery',
this.restartLesson = function() {
var self=this;
var fragment = "attack/" + self.scr + "/" + self.menu;
console.log("Navigating to " + fragment);
// Avoiding the trigger event - handle - navigate loop by
// loading the lesson explicitly (after executing the restart
// servlet).
goatRouter.navigate(fragment);
// Resetting the user's lesson state (assuming a single browser
// and session per user).
$.ajax({
url:'service/restartlesson.mvc',
method:'GET'
}).done(function(text) {
console.log("Received a response from the restart servlet: '" + text + "'");
// Explicitly loading the lesson instead of triggering an
// event in goatRouter.navigate().
self.loadLesson(self.scr,self.menu);
}).done(function(lessonLink) {
self.loadLesson(self.name);
});
};