<commit_before>/* Project specific Javascript goes here. */
function countdown() {
  var seconds = 30;
  var counter = $("#counter")[0];

  function tick() {
    seconds--;
    counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
    if(seconds > 0) {
      setTimeout(tick, 1000);
      if(seconds == 10) {
        $("#counter").css("color", "red");
        $("#counter").css("font-size", "32px");
      }
    } else {
      var submit = $("#submit")[0];
      $("#submit").removeAttr("disabled");
      submit.click();
    }
  }
  if(counter) {
    tick();
  }
}
countdown();

$("#slider").slider({
  min: 0,
  max: 1,
  step: 0.01,
  slide: function(event, ui) {
    $('#correlation')[0].innerHTML = ui.value;
  },
  change: function(event, ui) {
    $('#slider > .ui-slider-handle').show();
    $("#submit").removeAttr("disabled");
    $('#guess').val(ui.value);
  }
});

$('#slider > .ui-slider-handle').hide();

<commit_msg>Added a delay before clicking the submit button<commit_after>/* Project specific Javascript goes here. */
function countdown() {
  var seconds = 30;
  var counter = $("#counter")[0];

  function tick() {
    seconds--;
    counter.innerHTML = "0:" + (seconds < 10 ? "0" : "") + String(seconds);
    if(seconds > 0) {
      setTimeout(tick, 1000);
      if(seconds == 10) {
        $("#counter").css("color", "red");
        $("#counter").css("font-size", "32px");
      }
    } else {
      var submit = $("#submit")[0];
      $("#submit").removeAttr("disabled");
      setTimeout(submit_answer, 500);
    }
  }
  if(counter) {
    tick();
  }
}
countdown();

$("#slider").slider({
  min: 0,
  max: 1,
  step: 0.01,
  slide: function(event, ui) {
    $('#correlation')[0].innerHTML = ui.value;
  },
  change: function(event, ui) {
    $('#slider > .ui-slider-handle').show();
    $("#submit").removeAttr("disabled");
    $('#guess').val(ui.value);
  }
});

$('#slider > .ui-slider-handle').hide();

function submit_answer(){
  var btn = $("#submit")[0];
  btn.click()
}
{'fraction_non_alphanumeric': 0.23538156590683845, 'fraction_numerical': 0.024777006937561942, 'mean_word_length': 2.9744094488188977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6922280', 'n_tokens_mistral': 703, 'n_tokens_neox': 680, 'n_words': 140}