       # analyticsService.event 'Teacher View - Students Tab', 'Changed Student Tutorial'
       if student.isEnrolledIn(newId)
         fn = Project.tutorialEnrolment.delete
-        enrol = false
       else
         fn = Project.tutorialEnrolment.create
-        enrol = true
 
       fn(
         {

          project_id:             student.project_id
          tutorial_abbreviation:  tutorial.abbreviation,
        },
        (enrolment) ->
          alertService.add "success", "Tutorial enrolment updated for #{student.name}", 3000
          student.updateTutorialEnrolments(enrolment, enrol)
        (response) ->
          alertService.add "danger", "Failed to update tutorial enrolment. #{response?.data?.error}", 8000
      )

    student.isEnrolledIn = (tutorialId) ->
      _.find(student.tutorial_enrolments, (enrolment) -> enrolment.tutorial_id == tutorialId)?

    # Updat student enrolment within a unni
    student.updateUnitEnrolment = () ->
      newEnrollment = !student.enrolled
