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

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

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

          alert 'Students with overdue trainings notified!'
          res data
      .fail (obj, status) ->
        logErrorMessage(obj, 'Couldn\'t notify students! ')
        rej obj

  submitWizard: (course_id, wizard_id, data) ->
