<commit_before>data = [
    {
        "question_number": "0",
        "question_value": "V2hhdCBpcyAxICsxPw==",
        "question_type": "text",
        "answer_value": "Mg==",
        "answer_type": "text",
        "story_value": "T25jZSB1cG9uIGEgdGltZS4uLg",
        "story_type": "text"
    },
    {
        "question_number": "1",
        "question_value": "V2hhdCBpcyAxICsxPw==", //always add '==' at the end
        "question_type": "text",
        "answer_value": "Mg==", //always add '==' at the end
        "answer_type": "text",
        "story_value": "<KEY>
        "story_type": "html"
    }
];

var questionIndex = data.length - 1;

// this function decides which data item to show
function render(){
    $('#question').text(atob(data[questionIndex]["question_value"]));
}

// this function checks if an answer is correct
function toggleFields(){
    var userAnswer = $('#answer-input').val();
    var comparisonAnswer = atob(data[questionIndex]["answer_value"]);
    if (userAnswer == comparisonAnswer) {
        $('#story').html(atob(data[questionIndex]["story_value"]));
        $('#story').show();
    }
    else {
        $('#story').hide();
    }
}

// this function sets up things so the page actually does things
$(document).ready(function () {

    render();

    toggleFields(); //call this first so we start out with the correct visibility depending on the selected form values
    //this will call our toggleFields function every time the answer changes
    $('#answer').change(function () {
        toggleFields();
    });
    
    
    
});<commit_msg>changed behavior for a wrong answer<commit_after>data = [
    {
        "question_number": "0",
        "question_value": "V2hhdCBpcyAxICsxPw==",
        "question_type": "text",
        "answer_value": "Mg==",
        "answer_type": "text",
        "story_value": "T25jZSB1cG9uIGEgdGltZS4uLg",
        "story_type": "text"
    },
    {
        "question_number": "1",
        "question_value": "V2hhdCBpcyAxICsxPw==", //always add '==' at the end
        "question_type": "text",
        "answer_value": "Mg==", //always add '==' at the end
        "answer_type": "text",
        "story_value": "<KEY>
        "story_type": "html"
    }
];

var questionIndex = data.length - 1;

// this function decides which data item to show
function render(){
    $('#question').text(atob(data[questionIndex]["question_value"]));
}

// this function checks if an answer is correct
function toggleFields(){
    var wrongAnswer = "<h2>Not quite there...</h2>";
    var userAnswer = $('#answer-input').val();
    var comparisonAnswer = atob(data[questionIndex]["answer_value"]);
    if (userAnswer == comparisonAnswer) {
        $('#story').html(atob(data[questionIndex]["story_value"]));
        $('#story').show();
    }
    else {
        $('#story').html(wrongAnswer);
    }
}

// this function sets up things so the page actually does things
$(document).ready(function () {

    render();

    toggleFields(); //call this first so we start out with the correct visibility depending on the selected form values
    //this will call our toggleFields function every time the answer changes
    $('#answer').change(function () {
        toggleFields();
    });
    
    
    
});
{'fraction_non_alphanumeric': 0.16152897657213316, 'fraction_numerical': 0.006781750924784217, 'mean_word_length': 2.938106796116505, 'pattern_counts': {'":': 28, '<': 7, '<?xml version=': 0, '>': 7, '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': '555476', 'n_tokens_mistral': 1011, 'n_tokens_neox': 986, 'n_words': 252}