<commit_before>var React = require('react')
var django = require('django')
var FlipMove = require('react-flip-move')
var ChoiceForm = require('./ChoiceForm')
var ErrorList = require('../../contrib/static/js/ErrorList')

let QuestionForm = React.createClass({
  /*
  |--------------------------------------------------------------------------
  | Choice state related handlers
  |--------------------------------------------------------------------------
  */

  handleUpdateChoiceLabel: function (index, label) {
    this.props.updateChoiceLabel(this.props.index, index, label)
  },
  handleDeleteChoice: function (index) {
    this.props.deleteChoice(this.props.index, index)
  },

  handleAppendChoice: function () {
    this.props.appendChoice(this.props.index)
  },

  /*
  |--------------------------------------------------------------------------
  | Question state related handlers
  |--------------------------------------------------------------------------
  */

  handleDelete: function () {
    this.props.deleteQuestion(this.props.index)
  },

  handleMoveUp: function () {
    this.props.moveQuestionUp(this.props.index)
  },

  handleMoveDown: function () {
    this.props.moveQuestionDown(this.props.index)
  },

  handleLabelChange: function (e) {
    var index = this.props.index
    var label = e.target.value
    this.props.updateQuestionLabel(index, label)
  },

  render: function () {
    return (
      <section>
        <div className="commenting">
          <div className="commenting__content">
            <div className="form-group">
              <label
                htmlFor={'id_questions-' + this.props.key + '-name'}>
                {django.gettext('Question:')}
              </label>
              <input
                id={'id_questions-' + this.props.key + '-name'}
                name={'questions-' + this.props.key + '-name'}
                type="text"
                defaultValue={this.props.question.label}
                onChange={this.handleLabelChange} />
              <ErrorList errors={this.props.errors} />
            </div>

            <div className="form-group">
              <FlipMove easing="cubic-bezier(0.25, 0.5, 0.75, 1)">
                {
                  this.props.question.choices.map((choice, index) => {
                    var key = choice.id || choice.key
                    var errors = this.props.errors && this.props.errors.choices
                      ? this.props.errors.choices[index] : {}<commit_msg>use textarea for question<commit_after>var React = require('react')
var django = require('django')
var FlipMove = require('react-flip-move')
var ChoiceForm = require('./ChoiceForm')
var ErrorList = require('../../contrib/static/js/ErrorList')

let QuestionForm = React.createClass({
  /*
  |--------------------------------------------------------------------------
  | Choice state related handlers
  |--------------------------------------------------------------------------
  */

  handleUpdateChoiceLabel: function (index, label) {
    this.props.updateChoiceLabel(this.props.index, index, label)
  },
  handleDeleteChoice: function (index) {
    this.props.deleteChoice(this.props.index, index)
  },

  handleAppendChoice: function () {
    this.props.appendChoice(this.props.index)
  },

  /*
  |--------------------------------------------------------------------------
  | Question state related handlers
  |--------------------------------------------------------------------------
  */

  handleDelete: function () {
    this.props.deleteQuestion(this.props.index)
  },

  handleMoveUp: function () {
    this.props.moveQuestionUp(this.props.index)
  },

  handleMoveDown: function () {
    this.props.moveQuestionDown(this.props.index)
  },

  handleLabelChange: function (e) {
    var index = this.props.index
    var label = e.target.value
    this.props.updateQuestionLabel(index, label)
  },

  render: function () {
    return (
      <section>
        <div className="commenting">
          <div className="commenting__content">
            <div className="form-group">
              <label
                htmlFor={'id_questions-' + this.props.key + '-name'}>
                {django.gettext('Question:')}
              </label>
              <textarea
                id={'id_questions-' + this.props.key + '-name'}
                name={'questions-' + this.props.key + '-name'}
                defaultValue={this.props.question.label}
                onChange={this.handleLabelChange} />
              <ErrorList errors={this.props.errors} />
            </div>

            <div className="form-group">
              <FlipMove easing="cubic-bezier(0.25, 0.5, 0.75, 1)">
                {
                  this.props.question.choices.map((choice, index) => {
                    var key = choice.id || choice.key
                    var errors = this.props.errors && this.props.errors.choices
                      ? this.props.errors.choices[index] : {}
{'fraction_non_alphanumeric': 0.24269889224572003, 'fraction_numerical': 0.0036253776435045317, 'mean_word_length': 1.5272264631043257, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '3848513', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1246, 'n_words': 218}