<commit_before>import React from 'react'
import { reduxForm, Field } from 'redux-form'
import { Form, Input, Button } from 'semantic-ui-react'
import { checkAnswer } from '../../actions'

let Answer = ({ handleSubmit }) => {

  const renderInput = ({ input, placeholder }) => (
    <Input {...input} placeholder={placeholder} />
  )

  return (
    <Form onSubmit={handleSubmit}>
      <Field name='answer' component={renderInput} placeholder='Enter Answer' />
      <Button color='grey' type='submit' style={{marginLeft: 10, verticalAlign: 'top'}}>Submit</Button>
    </Form>
  )
}

Answer = reduxForm({
  form: 'answerForm',
  onSubmit: (values, dispatch, { problem, concept }) => {
    dispatch(checkAnswer(values, problem, concept))
  }
})(Answer)

export default Answer
<commit_msg>Updates answer form to remain in focus when entering text. #27<commit_after>import React from 'react'
import { reduxForm, Field } from 'redux-form'
import { Input, Button } from 'semantic-ui-react'
import { checkAnswer } from '../../actions'

const renderInput = ({ input, placeholder }) => (
  <Input type='text' {...input} placeholder={placeholder} />
)

let Answer = ({ handleSubmit }) => (
  <form onSubmit={handleSubmit}>
    <Field name='answer' component={renderInput} placeholder='Enter Answer' />
    <Button color='grey' type='submit' style={{marginLeft: 10, verticalAlign: 'top'}}>Submit</Button>
  </form>
)

Answer = reduxForm({
  form: 'answerForm',
  onSubmit: (values, dispatch, { problem, concept }) => {
    dispatch(checkAnswer(values, problem, concept))
  }
})(Answer)

export default Answer

{'fraction_non_alphanumeric': 0.1651031894934334, 'fraction_numerical': 0.00375234521575985, 'mean_word_length': 4.442176870748299, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '906623', 'n_tokens_mistral': 489, 'n_tokens_neox': 473, 'n_words': 131}