     @update()
 
   no_more: () ->
-    @submission_container.html(submission)
-    @rubric_container.html(rubric)
+    @submission_container.html('')
+    @rubric_container.html('')
     @state = state_no_data
     @update()
 

    @button.click @clicked
    @state = state_no_data

    @mock_backend = mock_backend
    if @mock_backend
      @mock_cnt = 0

    @get_next_submission()

  mock: (cmd, data) ->
    # Return a mock response to cmd and data
    @mock_cnt++
    if cmd == 'get_next'
      response =
        'success': true
        'submission': 'submission! ' + @mock_cnt
        'rubric': 'A rubric!' + @mock_cnt
    else if cmd == 'save_grade'
      response =
        'success': true
        'submission': 'another submission! ' + @mock_cnt
        'rubric': 'A rubric!' + @mock_cnt
    else
      response =
        'success': false
        'error': 'Unknown command ' + cmd
    return response


  set_button_text: (text) ->
    @button.prop('value', text)

  _post: (cmd, data, callback) ->
    if @mock_backend
      callback(@mock(cmd, data))
    else
      # TODO: replace with postWithPrefix when that's loaded
      $.post(@ajax_url + cmd, data, callback)


  ajax_callback: (response) =>

        @error(response.error)
  
  get_next_submission: () ->
    @backend.post('get_next', {}, @ajax_callback)

  submit_and_get_next: () ->
    data = {eval: '123'}
    @backend.post('save_grade', data, @ajax_callback)

  error: (msg) ->
    @error_container.html(msg)
