     return if @closed
     (@sessionHasExpired() and @userClassifyCount() > 2) or (@userClassifyCount() is 2)
 
-  showIfNeeded: -> 
+  showIfNeeded: ->
     @prompt() if @promptShouldBeDisplayed()
 
   promptOrUpdateCurrentGoal: ->

    if @completedSuccessfully() then @feedback() else @decrimentGoal()
    @increaseSessionExpiration()

  populatePromptContent: ->
    @content.html HEADER + SPLIT[@splitGroup].message + SPLIT[@splitGroup].input + SUBMIT_BUTTON
    @listenForSliderChange() if !!~SPLIT[@splitGroup].input.indexOf("user-goal-slider")
    @listenForSubmit()

  listenForSubmit: ->
    @el.find("button[name='user-goal-submit']").on 'click', => @setUserGoal()

  listenForSliderChange: ->
    goalSlider = @el.find("#user-goal-slider")

    defaultValue = 25
    goalSlider.val(defaultValue)
    @el.find("#slider-val").text(defaultValue + " Classifications")
    @goal = defaultValue

    goalSlider.on 'input', (e) =>
      @goal = goalSlider.val()
      @el.find("#slider-val").text(@goal + " Classifications")

  setUserGoal: ->
    @goal or= @el.find("#user-goal-form input[type='radio']:checked").val()

    @content.html("<h1 class='user-goal-set'>Goal set for #{@goal} Classification#{if +@goal is 1 then '' else 's'}</h1>")

    User?.current?.setPreference "goal_set", "true"
    User?.current?.setPreference "goal", @goal

  IMAGE_FILES = [26, 27, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 61]

  @sampleArray: (arr) -> arr[Math.floor(Math.random() * arr.length)]

  @randomKelpImage: -> @sampleArray(IMAGE_FILES)

  Input =
    min: 1
    max: 50
    slider:
     "<p id='slider-val'></p>
      <form id='user-goal-form'>
        <input type='range' id='user-goal-slider' min='1' max='50' step='1'>
      </form>"

  Feedback =
    message: "<h1 class='user-goal-feedback-message'>Classification Goal Achieved!<br>Thank you for your efforts!</h1>"
