       # 'metadata.finished_at': (new Date).toISOString()
     # @props.onComplete?()
 
-  # makeAnnotation: (taskKey) ->
-  #   console.log 'makeAnnotation()'
-  #   # taskDescription = @state.workflow.tasks[taskKey]
-  #   annotation = tasks[@state.currentTask.tool].getDefaultAnnotation()
-  #   annotation.tool = @state.currentTask.tool
-
-  #   console.log 'ADDING ANNOTATION: ', annotation
-
-  #   classification  = @props.classification 
-  #   classification.annotations.push annotation
-
-  #   @setState classification: classification, =>
-  #     console.log 'CLASSIFICATION UPDATED: ', @props.classification
-  #   @nextTask()
-
-  # finishClassification: ->
-  #   @makeAnnotation()
-  #   console.log 'CLASSIFICATION DONE!'
-
-  # # this is called when user clicks on radio button
-  # onTaskComponentChange: (value) ->
-  #   # console.log 'onTaskComponentChange() ', value
-
-  #   classification = @props.classification
-  #   annotations = classification.annotations
-  #   currentAnnotation = if annotations.length is 0 then {} else annotations[annotations.length-1]
-
-  #   currentAnnotation.value = value
-
-  #   console.log 'currentAnnotation ********: ', currentAnnotation
-  #   # @makeAnnotation()
-
-  #   # annotations = @props.classification.annotations
-  #   # console.log 'CUCLKJDHKSLDJ: ', @state
-  #   # annotations[annotations.length-1].value = value
-
-  #   # @setState classification: classification, => console.log 'UPDATED CLASSIFICATOIN ', @props.classification
-
-    
-
-
-
 window.React = React

  getInitialState: ->
    subjects:       null
    currentSubject: null
    # classification: null # move to props
    workflow:       @props.workflow
    currentTask:    @props.workflow.tasks[@props.workflow.first_task]

    # # @state.classification.annotations ?= []
    # if @state.classification.annotations.length is 0
    #   console.log 'making first annotation'
    #   @makeAnnotation @state.workflow.first_task

  getDefaultProps: ->
    classification: resource.type('classifications').create

      metadata: {}

  componentWillMount: ->
    @addAnnotationForTask @props.workflow.first_task

  render: ->
    return null unless @state.currentSubject? and @state.currentTask?
    TaskComponent = tasks[@state.currentTask.tool]
    onFirstAnnotation = @props.classification.annotations.length is 0

    annotations = @props.classification.annotations
    currentAnnotation = if annotations.length is 0 then {} else annotations[annotations.length-1]

    waitingForAnswer = false # for now 

