<commit_before>$('#content').on('click','.question',function(){
	var qid = this.getAttribute('id');
	var q = getQuestionWithID(QUESTIONS,qid);
	var qElement = this;
    var questionValue = parseInt(q.value);
    
    $('#question').html('<h2>' + q.topic + ' for ' + q.value + '</h2><div id="question-inner">' + q.text + q.options + '</div>' + '<form class="pure-form"><input type="text" id="question-response" autocomplete="off">\n<button id="question-submit" class="pure-button pure-button-primary" qid="' + qid + '">OK</button><div id="answer">Correct response: ' + q.answer + '</div></form>');
    $('#fade').show();
    $('#question-outer').show();
    $('#question-response').focus();
    
    var outnode = document.getElementById("question");
    AMprocessNode(outnode);
    
    $('#question-response').keypress(function(e){
        if (e.which == 13 ) {
            // Enter key = keycode 13
            $('#question-submit').click()
            return false;
        }
    });
    
    $('#question-submit').click(function(e) {
    	// Exit if disabled
        if ($(this).hasClass('pure-button-disabled') == false) {
            var response = document.getElementById('question-response').value;
            if (response.toLowerCase() == q.answer.toLowerCase()) {
                $('#question').animate({backgroundColor: '#4CD964'}, 200);
                TEAMS[currentTeam].score = parseInt(TEAMS[currentTeam].score) + questionValue;
            } else {
                $('#question').animate({backgroundColor: '#FF2D55'}, 200);
                $('#answer').css('display', 'inline-block');
            }
        
            $(this).addClass('pure-button-disabled');
            $('#question-response').attr('disabled', 'disabled');
        
            $('#question').click(function(e) {
                $(qElement).removeClass('question');
                $(qElement).addClass('question-disabled');
                $(qElement).off();
                $(this).off();
    
                currentTeam++;
                if (currentTeam >= TEAMS.length) {
                    currentTeam = 0;
                }
                showTeams();
                $('#fade').fadeOut('fast');
                $('#question-outer').fadeOut('fast', function() {
                    $('#question').css('background-color', 'white');
                })
            });
        }
        return false;
    });
});

$('#level-select').change(function(){
    var valueSelected = this.value;
    if (valueSelected == '1') {
        valueSelected = null;
    }
    window.location.href = updateQueryString('level', valueSelected);
});

$('#teams-edit').on('touchstart click',function(){
    showTeams(true);
    return false;
});

$('#teams').on('click','#team-add',function(){
	var Team = {};
    Team.name = '<NAME>';
    Team.color = 25;
    Team.score = '0';
    TEAMS.push(Team);
    
	showTeams(true);
	
    return false;
});
    
$('#teams').on('click','#team-done',function(){
	TEAMS = [];
	var nodes = document.querySelectorAll('#teams input[type="text"]');
    for (var i = 0; i < nodes.length; i++) {
    	var Team = {};
    	Team.name = nodes[i].value;
    	Team.color = nodes[i].previousSibling.previousSibling.selectedIndex;
    	Team.score = nodes[i].nextSibling.nextSibling.textContent;
    	TEAMS.push(Team);
    }
    if (currentTeam >= TEAMS.length) {
        currentTeam = 0;
    }
    showTeams();
    return false;
});

$('#teams').on('click','button.team-remove',function(){
	$(this.parentNode).remove();
});<commit_msg>color picker fix<commit_after>$('#content').on('click','.question',function(){
	var qid = this.getAttribute('id');
	var q = getQuestionWithID(QUESTIONS,qid);
	var qElement = this;
    var questionValue = parseInt(q.value);
    
    $('#question').html('<h2>' + q.topic + ' for ' + q.value + '</h2><div id="question-inner">' + q.text + q.options + '</div>' + '<form class="pure-form"><input type="text" id="question-response" autocomplete="off">\n<button id="question-submit" class="pure-button pure-button-primary" qid="' + qid + '">OK</button><div id="answer">Correct response: ' + q.answer + '</div></form>');
    $('#fade').show();
    $('#question-outer').show();
    $('#question-response').focus();
    
    var outnode = document.getElementById("question");
    AMprocessNode(outnode);
    
    $('#question-response').keypress(function(e){
        if (e.which == 13 ) {
            // Enter key = keycode 13
            $('#question-submit').click()
            return false;
        }
    });
    
    $('#question-submit').click(function(e) {
    	// Exit if disabled
        if ($(this).hasClass('pure-button-disabled') == false) {
            var response = document.getElementById('question-response').value;
            if (response.toLowerCase() == q.answer.toLowerCase()) {
                $('#question').animate({backgroundColor: '#4CD964'}, 200);
                TEAMS[currentTeam].score = parseInt(TEAMS[currentTeam].score) + questionValue;
            } else {
                $('#question').animate({backgroundColor: '#FF2D55'}, 200);
                $('#answer').css('display', 'inline-block');
            }
        
            $(this).addClass('pure-button-disabled');
            $('#question-response').attr('disabled', 'disabled');
        
            $('#question').click(function(e) {
                $(qElement).removeClass('question');
                $(qElement).addClass('question-disabled');
                $(qElement).off();
                $(this).off();
    
                currentTeam++;
                if (currentTeam >= TEAMS.length) {
                    currentTeam = 0;
                }
                showTeams();
                $('#fade').fadeOut('fast');
                $('#question-outer').fadeOut('fast', function() {
                    $('#question').css('background-color', 'white');
                })
            });
        }
        return false;
    });
});

$('#level-select').change(function(){
    var valueSelected = this.value;
    if (valueSelected == '1') {
        valueSelected = null;
    }
    window.location.href = updateQueryString('level', valueSelected);
});

$('#teams-edit').on('touchstart click',function(){
    showTeams(true);
    return false;
});

$('#teams').on('click','#team-add',function(){
	var Team = {};
    Team.name = '<NAME>';
    Team.color = 25;
    Team.score = '0';
    TEAMS.push(Team);
    
	showTeams(true);
	
    return false;
});
    
$('#teams').on('click','#team-done',function(){
	TEAMS = [];
	var nodes = document.querySelectorAll('#teams input[type="text"]');
    for (var i = 0; i < nodes.length; i++) {
    	var Team = {};
    	Team.name = nodes[i].value;
    	Team.color = nodes[i].previousSibling.previousSibling.selectedIndex;
    	Team.score = nodes[i].nextSibling.nextSibling.textContent;
    	TEAMS.push(Team);
    }
    if (currentTeam >= TEAMS.length) {
        currentTeam = 0;
    }
    showTeams();
    return false;
});

$('#teams').on('click','button.team-remove',function(){
	$(this.parentNode).remove();
});

$('#teams').on('change', 'select', function(){
    var li = document.querySelectorAll('#teams li');
    for (var i = 0; i < li.length; i++) {
        TEAMS[i].color = li[i].childNodes[0].selectedIndex;
    }
    
    if ($(this.parentNode).hasClass('team-current')) {
        showTeams(true);
    }
});
{'fraction_non_alphanumeric': 0.20141055201410552, 'fraction_numerical': 0.007324020073240201, 'mean_word_length': 2.4490177736202057, 'pattern_counts': {'":': 0, '<': 30, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3336250', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2174, 'n_words': 349}