       @hasTitle = ko.computed => @title()? and @title().trim() isnt ''
 
       @solution ?= ko.observable ''
-      @init = =>
-        config.taskInitialized @
 
   class ExercisePageViewModel
     constructor: (params) ->


    submit: (task) =>
      if task? #submit this task only

      else #submit everything
        config.saveExercise exercise.id, ko.mapping.toJS(@tasks), (status) ->
          console.log 'Submit: ' + status

    # called through afterRender event in template html
    init: () =>
      $(".popupinfo").popup()

  viewModel: ExercisePageViewModel
  template: config.html

      @exerciseNotFound = ko.observable(no)
      @isOld = ko.observable true

      @getExercise params.id, (exercise, status, error) =>
        if exercise?
          @exercise = exercise
          @number exercise.number
