 
 
 # for now, just create an instance and load it...
-mock_backend = true 
-$(document).ready(() -> new StaffGrading(mock_backend))
+mock_backend = true
+ajax_url = $('.staff-grading').data('ajax_url')
+backend = new StaffGradingBackend(ajax_url, mock_backend)
+
+$(document).ready(() -> new StaffGrading(backend))

state_no_data = "no_data"
state_error = "error"

class StaffGrading
  constructor: (mock_backend) ->
    @el = $('.staff-grading')
    @ajax_url = @el.data('ajax_url')

    @error_container = $('.error-container')
    @submission_container = $('.submission-container')

    @button.click @clicked
    @state = state_no_data

    @get_next_submission()


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


  ajax_callback: (response) =>
