<commit_before>var React = require('react');

var Router = require('react-router');
var Navigation = Router.Navigation;
var Link = Router.Link;

var ViewActions = require('./../actions/ViewActions');
var SolutionStore = require('./../stores/SolutionStore');

var DetailView = React.createClass({
  mixins: [Navigation],

  getInitialState: function(){
    return {
      result: '',
      solved: false,
      solutions: [],
      question: this.props.questions[this.props.params.qNumber - 1]
    };
  },

  getSolutions: function(){
    this.state.solutions = SolutionStore.getSolutions();
  },

  componentDidMount: function(){
    var context = this;
    SolutionStore.addListener(this.getSolutions);
  },

  setRegex: function() {
    var value = React.findDOMNode(this.refs.solutionText).value;
    var solved = this.isSolved(value);

    if(solved){
      ViewActions.loadSolutions(this.state.question._id);
    }

    this.setState({
      result: value,
      solved: solved
    });<commit_msg>prepare for rebase<commit_after>var React = require('react');

var Router = require('react-router');
var Navigation = Router.Navigation;
var Link = Router.Link;

var ViewActions = require('./../actions/ViewActions');
var SolutionStore = require('./../stores/SolutionStore');

var DetailView = React.createClass({
  mixins: [Navigation],

  getInitialState: function(){
    return {
      result: '',
      solved: false,
      solutions: [],
      question: this.props.questions[this.props.params.qNumber - 1]
    };
  },

  getSolutions: function(){
    this.state.solutions = SolutionStore.getSolutions();
  },

  componentDidMount: function(){
    var context = this;
    SolutionStore.addListener(this.getSolutions);
  },

  setRegex: function() {
    var value = React.findDOMNode(this.refs.solutionText).value;
    var solved = this.isSolved(value);

    if(solved){

      // TODO: Post new solution to server


      // Retrieve solutions to current question
      ViewActions.loadSolutions(this.state.question._id);

    }

    this.setState({
      result: value,
      solved: solved
    });
{'fraction_non_alphanumeric': 0.14020912547528516, 'fraction_numerical': 0.0009505703422053232, 'mean_word_length': 3.295918367346939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6864034', 'n_tokens_mistral': 641, 'n_tokens_neox': 620, 'n_words': 129}