       .then (exercise) =>
         @exercise exercise
         @loadSolution()
-      .catch (e) -> 
+      .catch (e) ->
         console.error(e)
         alert 'Could not load this solution.'
     else if @params.solutionId

    @loadExercise = => #load the exercise and pdf for the current solution
      if !@solution()
        @pages []
        return

      getExercise = api.get.exercise @solution().exercise
        .then (exercise) => @exercise exercise

      Q.all([getExercise, @loadPdf()]).then => @initPages

    @initPages = =>
      result = @solution().result

    @loadSolution = => #load the solution and pdf for the current exercise
      if !@exercise()
        @pages []
        return Q.reject()

      getSolution = api.get.nextSolution @exercise().id
        .then (solution) => @solution solution
