 
   componentDidMount: ->
     annotationValues = @props.annotation.value
-    if annotationValues.length
-      for answer, i in annotationValues
-        @handleOptionsKeys(i, answer.value)
-    else
+    unless annotationValues.length
       @props.annotation.value = @props.task.selects.map -> {value: null, option: false}
 
     if @props.autoFocus is true

  handleFocus: ->
    @menus[0].focus()

  handleOptionsKeys: (i, value) ->
    {id, condition} = @props.task.selects[i]
    optionsKeys = @state.optionsKeys

    if i is 0 or i is '0'
      optionsKeys[id] = value
    else if value is null
      optionsKeys[id] = null
    else
      optionsKeys[id] = "#{optionsKeys[condition]};#{value}"
    @setState optionsKeys: optionsKeys

  getOptions: (i, optionsKey) ->
    select = @props.task.selects[i]
    optionsKey ?= if not select.condition? then '*' else @state.optionsKeys[select.condition]
    options = select.options[optionsKey]
    if options then options else []

  getDisabledAttribute: (i) ->
    {selects} = @props.task
    select = selects[i]
    condition = selects.filter (filterSelect) => filterSelect.id is select.condition
    conditionIndex = selects.indexOf(condition[0])
    optionsKeys = @state.optionsKeys

    if select.condition? and not @props.annotation.value[conditionIndex]
      return true
    if select.condition? and select.allowCreate is false and not select.options[optionsKeys[select.condition]]?.length
      return true
    false


    <GenericTask question={@props.task.instruction} help={@props.task.help} required={@props.task.required}>
      <div>
        {selects.map (select, i) =>
          options = []
          options.push option for option in @getOptions(i, optionsKeys)
          disabled = @getDisabledAttribute(i)
          selectedOption = if @state.selectedOptions[i]?.value then @state.selectedOptions[i] else null
          optionsKeys.push selectedOption.value if selectedOption?.value
