           )
       else
         @remove(index)            
-]  +]  

      @$scope = $scope
      @tiers = []
      @badges = {}
      # @availableBadges = angular.copy($scope.courseBadges)
      # @selectedBadge = ""
      @id = if attrs.id then attrs.id else null
      @fullCreditTier = null
      @addTiers(attrs["tiers"]) if attrs["tiers"] #add tiers if passed on init
      # @loadMetricBadges(attrs["metric_badges"]) if attrs["metric_badges"] #add badges if passed on init
      @name = if attrs.name then attrs.name else ""
      @rubricId = if attrs.rubric_id then attrs.rubric_id else @$scope.rubricId
      if @id


      # alert(@selectedTier.id)
      # would this always have an id?
    alert: ()->
      alert("snakes!")    
    addTier: (attrs={})->
      newTier = new TierPrototype(@, attrs, @$scope)
      @tiers.push newTier
      if @rubricGradeTierId and @rubricGradeTierId == newTier.id
        @selectedTier = newTier

    addTiers: (tiers)->
      angular.forEach(tiers, (tier,index)=>
