<commit_before>class AnswerButton extends React.Component {
    onClick() {
        fetch(`http://localhost:8080/api/question/${this.props.label}`, {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            }
        })
    }
    render() {
        return <button type="button" onClick={this.onClick.bind(this)}>{this.props.label}</button>
    }
}

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {question: '',
                      alternative1: '',
                      alternative2: '',
                      alternative3: '',
                      correctAlternative: ''
                      }
    }
    componentDidMount() {
        fetch('http://localhost:8080/api/question/', {credentials: "same-origin"})
            .then(result => result.json())
            .then(response => this.setState({question: response.question,
                                             alternative1: response.alternative1,
                                             alternative2: response.alternative2,
                                             alternative3: response.alternative3,
                                             correctAlternative: response.correctAlternative
                                             }));
    }
    render() {
        return (
        <div>
            <h1>Gakusei</h1>
            <h2>{this.state.question}</h2>
            <AnswerButton label = {this.state.alternative1}/>
            <AnswerButton label = {this.state.alternative2}/>
            <AnswerButton label = {this.state.alternative3}/>
            <AnswerButton label = {this.state.correctAlternative}/>
        </div>
        );<commit_msg>Removed call to localhost<commit_after>class AnswerButton extends React.Component {
    onClick() {
        fetch(`/api/question/${this.props.label}`, {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            }
        })
    }
    render() {
        return <button type="button" onClick={this.onClick.bind(this)}>{this.props.label}</button>
    }
}

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {question: '',
                      alternative1: '',
                      alternative2: '',
                      alternative3: '',
                      correctAlternative: ''
                      }
    }
    componentDidMount() {
        fetch('/api/question/', {credentials: "same-origin"})
            .then(result => result.json())
            .then(response => this.setState({question: response.question,
                                             alternative1: response.alternative1,
                                             alternative2: response.alternative2,
                                             alternative3: response.alternative3,
                                             correctAlternative: response.correctAlternative
                                             }));
    }
    render() {
        return (
        <div>
            <h1>Gakusei</h1>
            <h2>{this.state.question}</h2>
            <AnswerButton label = {this.state.alternative1}/>
            <AnswerButton label = {this.state.alternative2}/>
            <AnswerButton label = {this.state.alternative3}/>
            <AnswerButton label = {this.state.correctAlternative}/>
        </div>
        );
{'fraction_non_alphanumeric': 0.12008978675645342, 'fraction_numerical': 0.01122334455667789, 'mean_word_length': 1.3392388451443569, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7541071', 'n_tokens_mistral': 855, 'n_tokens_neox': 829, 'n_words': 133}