           alert 'Students with overdue trainings notified!'
           res data
       .fail (obj, status) ->
-        console.error 'Couldn\'t notify students! ' + getErrorMessage(obj)
+        logErrorMessage(obj, 'Couldn\'t notify students! ')
         rej obj
 
   submitWizard: (course_id, wizard_id, data) ->

{ capitalize } = require './strings'

logErrorMessage = (obj) ->
  # readyState 0 usually indicates that the user navigated away before ajax
  # requests resolved.
  return if obj.readyState == 0
  message = 'Error: '
  message += obj.responseJSON?.message || obj.statusText
  console.log message


          console.log 'Submitted the wizard answers!'
          res data
      .fail (obj, status) ->
        getErrorMessage(obj, 'Couldn\'t submit wizard answers! ')
        rej obj

  modify: (model, course_id, data, add) ->
