<commit_before>/** @jsx React.DOM */
var React = require("react");
var PropsMethodMixin = require("../../../mixins/PropsMethodMixin");
var uniqueId = require('lodash-node/modern/utilities/uniqueId');
var AnswerRadioInput = require('./answer_radio_input');

var AnswerMultipleChoiceQuestion = React.createClass({
  mixins: [PropsMethodMixin],
  propTypes: {
    value: React.PropTypes.string,
    choices: React.PropTypes.array.isRequired,
    onCompleted: React.PropTypes.func.isRequired
  },
  getInitialState: function() {
    return {
      id: uniqueId('multiple-choice-'),
      value: this.props.value
    };
  },
  handleChanged: function(value) {
    this.setState({value: value});
    this.callMethodOnProps('onCompleted', value);
  },
  renderChoices: function() {
    var name = this.state.id;
    var items = {};
    this.props.choices.map(function (choice, i) {
      var elem = new AnswerRadioInput({
        id: "choice-" + i,
        name: name,
        label: choice,
        value: choice,
        checked: this.state.value === choice,
        onChanged: this.handleChanged
      });
      items[id] = elem;
    }.bind(this));
    return items;
  },
  render: function() {
    var id = this.state.id;
    return <div className="form-group">
      <label className="survey-label" htmlFor={id}>{this.props.label}</label>
      <div className="survey-item-content">
          {this.renderChoices()}
      </div>
    </div>
  }
});

module.exports = AnswerMultipleChoiceQuestion;<commit_msg>Fixed style in multiple-choice answer<commit_after>/** @jsx React.DOM */
var React = require("react");
var PropsMethodMixin = require("../../../mixins/PropsMethodMixin");
var uniqueId = require('lodash-node/modern/utilities/uniqueId');
var AnswerRadioInput = require('./answer_radio_input');

var AnswerMultipleChoiceQuestion = React.createClass({
  mixins: [PropsMethodMixin],
  propTypes: {
    value: React.PropTypes.string,
    choices: React.PropTypes.array.isRequired,
    onCompleted: React.PropTypes.func.isRequired
  },
  getInitialState: function() {
    return {
      id: uniqueId('multiple-choice-'),
      value: this.props.value
    };
  },
  handleChanged: function(value) {
    this.setState({value: value});
    this.callMethodOnProps('onCompleted', value);
  },
  renderChoices: function() {
    var name = this.state.id;
    var items = {};
    this.props.choices.map(function (choice, i) {
      var elem = new AnswerRadioInput({
        id: "choice-" + i,
        name: name,
        label: choice,
        value: choice,
        checked: this.state.value === choice,
        onChanged: this.handleChanged
      });
      items[id] = elem;
    }.bind(this));
    return items;
  },
  render: function() {
    var id = this.state.id;
    return <div className="form-group">
      <label className="survey-item-label" htmlFor={id}>{this.props.label}</label>
      <div className="survey-item-content">
          {this.renderChoices()}
      </div>
    </div>
  }
});

module.exports = AnswerMultipleChoiceQuestion;
{'fraction_non_alphanumeric': 0.15202369200394866, 'fraction_numerical': 0.0, 'mean_word_length': 3.1025641025641026, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3834376', 'n_tokens_mistral': 939, 'n_tokens_neox': 931, 'n_words': 185}