     }
 
   $scope.submitGrade = ()->
+    self = this
     if confirm "Are you sure you want to submit the grade for this assignment?"
-      self = this
+      # alert(self.gradedRubricParams().tier_badges.length)
       $http.put("/assignments/#{$scope.assignmentId}/grade/submit_rubric", self.gradedRubricParams()).success(
         window.location = "/assignments/#{$scope.assignmentId}"
       )

      this.comments = ""

    this.addTiers(attrs["tiers"]) if attrs["tiers"] #add tiers if passed on init
    this.name = if attrs.name then attrs.name else ""
    this.rubricId = if attrs.rubric_id then attrs.rubric_id else $scope.rubricId
    this.max_points = if attrs.max_points then attrs.max_points else 0

@gradecraft.controller 'GradeRubricCtrl', ['$scope', 'Restangular', '$http', ($scope, Restangular, $http) -> 

  $scope.metrics = []
  $scope.courseBadges = {}
  $scope.rubricGrades = {} # index in hash with metric_id as key
  $scope.gsiGradeStatuses = ["In Progress", "Graded"]
