     if @task_number>1
       @show_combined_rubric_current()
       @show_results_current()
-
-  # locally scoped jquery.
-  $: (selector) ->
-    $(selector, @el)
 
   show_results_current: () =>
     data = {'task_number' : @task_number-1}

      @errors_area.html(@out_of_sync_message)

  gentle_alert: (msg) =>
    if @el.find('.open-ended-alert').length
      @el.find('.open-ended-alert').remove()
    alert_elem = "<div class='open-ended-alert'>" + msg + "</div>"
    @el.find('.open-ended-action').after(alert_elem)
    @el.find('.open-ended-alert').css(opacity: 0).animate(opacity: 1, 700)

  queueing: =>
    if @child_state=="assessing" and @child_type=="openended"

    return true

class @CombinedOpenEnded
  constructor: (el) ->
    @el=el
    @$el = $(el)
    @reinitialize(el)
    $(window).keydown @keydown_handler
    $(window).keyup @keyup_handler

  # locally scoped jquery.
  $: (selector) ->
    $(selector, @el)

  reinitialize: (element) ->
    @wrapper=@$('section.xmodule_CombinedOpenEndedModule')
    @coe = @$('section.combined-open-ended')

    #Get data from combinedopenended
    @allow_reset = @coe.data('allow_reset')
    @id = @coe.data('id')
    @ajax_url = @coe.data('ajax-url')
    @state = @coe.data('state')
    @task_count = @coe.data('task-count')
    @task_number = @coe.data('task-number')
    @accept_file_upload = @coe.data('accept-file-upload')
    @location = @coe.data('location')
    @child_state = @coe.data('state')
    @child_type = @coe.data('child-type')

    # set up handlers for click tracking
    Rubric.initialize(@location)
    @is_ctrl = false

    #Setup reset
    @reset_button = @$('.reset-button')
    @reset_button.click @reset

    #Setup next problem
    @next_problem_button = @$('.next-step-button')
    @next_problem_button.click @next_problem

    @status_container = @$('.status-elements')

    #setup show results
    @show_results_button=@$('.show-results-button')
    @show_results_button.click @show_results

