 React = require 'react'
+BS = require 'react-bootstrap'
+
 _ = require 'underscore'
 
+QuestionFormatType = require './question-format-type'
 Answer = require './answer'
 {QuestionActions, QuestionStore} = require '../stores/question'
 {AnswerActions, AnswerStore} = require '../stores/answer'

  displayName: 'Question'

  getInitialState: -> {}

  changeAnswer: (answerId) ->
    curAnswer = QuestionStore.getCorrectAnswer(@props.id)
    QuestionActions.setCorrectAnswer(@props.id, answerId, curAnswer?.id)
    @props.sync()

  updateStimulus: (event) ->
    QuestionActions.updateStimulus(@props.id, event.target?.value)
    @props.sync()

  updateStem: (event) ->
    QuestionActions.updateStem(@props.id, event.target?.value)
    @props.sync()

  updateSolution: (event) ->
    QuestionActions.updateSolution(@props.id, event.target?.value)
    @props.sync()

  addAnswer: ->
    QuestionActions.addNewAnswer(@props.id)
    @props.sync()

  removeAnswer:(answerId) ->
    QuestionActions.removeAnswer(@props.id, answerId)
    @props.sync()

  moveAnswer: (answerId, direction) ->
    QuestionActions.moveAnswer(@props.id, answerId, direction)
    @props.sync()

  multipleChoiceClicked: (event) -> QuestionActions.toggleMultipleChoiceFormat(@props.id)
  freeResponseClicked: (event) -> QuestionActions.toggleFreeResponseFormat(@props.id)


  render: ->
    { id, removeQuestion, moveQuestion, canMoveLeft, canMoveRight } = @props

    answers = []

    for answer, index in QuestionStore.getAnswers(id)
