<commit_before>React = require 'react'
_ = require 'underscore'
BS = require 'react-bootstrap'
classnames = require 'classnames'

{VocabularyActions, VocabularyStore} = require 'stores/vocabulary'
Distractors = require 'components/vocabulary/distractors'
Tags = require 'components/vocabulary/tags'

Vocabulary = React.createClass
  propTypes:
    id:   React.PropTypes.string.isRequired

  setTerm: (ev) -> VocabularyActions.change(@props.id, term: ev.target.value)
  setDescription: (ev) -> VocabularyActions.change(@props.id, description: ev.target.value)

  update: -> @forceUpdate()

  componentWillMount: ->
    VocabularyStore.addChangeListener(@update)

  componentWillUnmount: ->
    VocabularyStore.removeChangeListener(@update)

  render: ->
    vt = VocabularyStore.get(@props.id)

    <div className='vocabulary-editor'>

      <BS.Row>
        <BS.Col sm=6>

          <BS.Input type="text" label="Term" onChange={@setTerm} value={vt.term} />

          <BS.Input type="textarea" label="Description"
            onChange={@setDescription} value={vt.description} />

        </BS.Col>
        <BS.Col sm=6>
          <Distractors termId={@props.id} />
        </BS.Col>
      </BS.Row>

      <BS.Row>
        <BS.Col sm=12>
          <h4>Tags</h4>
        </BS.Col>
      </BS.Row>
      <Tags vocabularyId={@props.id} />
    </div>


module.exports = Vocabulary<commit_msg>Update labels<commit_after>React = require 'react'
_ = require 'underscore'
BS = require 'react-bootstrap'
classnames = require 'classnames'

{VocabularyActions, VocabularyStore} = require 'stores/vocabulary'
Distractors = require 'components/vocabulary/distractors'
Tags = require 'components/vocabulary/tags'

Vocabulary = React.createClass
  propTypes:
    id:   React.PropTypes.string.isRequired

  setTerm: (ev) -> VocabularyActions.change(@props.id, term: ev.target.value)
  setDescription: (ev) -> VocabularyActions.change(@props.id, description: ev.target.value)

  update: -> @forceUpdate()

  componentWillMount: ->
    VocabularyStore.addChangeListener(@update)

  componentWillUnmount: ->
    VocabularyStore.removeChangeListener(@update)

  render: ->
    vt = VocabularyStore.get(@props.id)

    <div className='vocabulary-editor'>

      <BS.Row>
        <BS.Col sm=6>

          <BS.Input type="text" label="Key Term" onChange={@setTerm} value={vt.term} />

          <BS.Input type="textarea" label="Key Term Definition"
            onChange={@setDescription} value={vt.description} />

        </BS.Col>
        <BS.Col sm=6>
          <Distractors termId={@props.id} />
        </BS.Col>
      </BS.Row>

      <BS.Row>
        <BS.Col sm=12>
          <h4>Tags</h4>
        </BS.Col>
      </BS.Row>
      <Tags vocabularyId={@props.id} />
    </div>


module.exports = Vocabulary
{'fraction_non_alphanumeric': 0.14562410329985653, 'fraction_numerical': 0.00430416068866571, 'mean_word_length': 3.0715328467153284, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5262136', 'n_tokens_mistral': 935, 'n_tokens_neox': 908, 'n_words': 159}