Master.Controller = function() {}

Master.Controller.prototype = {
  init: function(){
    $(document).on('getData', function(event, data) {
      this.db = data
      this.bindListeners(this.db)
    }.bind(this)
    )
  },
  bindListeners: function(data) {
    this.masterData = data
    var self = this;
    $('.levels').on('click', function(e) {
      var id = $(this).attr('id')
      var level = data[id]
      $(document).trigger('changeLevel', level)
    });
    $(document).on('success', function(event, localData) {
      this.localData = localData()
      this.switchLevel(this.localData, this.masterData);
    }.bind(this));
  },
  switchLevel: function(localData, masterData) {
    var lesson = masterData["Lesson" + (localData.ID + 1)]
    $(document).trigger('changeLevel', lesson)
  }
}






@@ -559,20 +559,73 @@
 )%0A      
-this
+var self = this%0A      setTimeout(function()%7B%0A        self
 .switchL
@@ -629,20 +629,20 @@
 chLevel(
-this
+self
 .localDa
@@ -645,20 +645,20 @@
 alData, 
-this
+self
 .masterD
@@ -663,16 +663,32 @@
 rData);%0A
+      %7D, 5000)%0A%0A
     %7D.bi
@@ -703,16 +703,17 @@
 );%0A  %7D,%0A
+%0A
   switch
@@ -868,10 +868,4 @@
  %7D%0A%7D
-%0A%0A%0A%0A%0A%0A

Set Interval of 5 secs before moving onto next level