<commit_before>'use strict';

//Luay created listener for next button
var nextButton = document.getElementById('next-form');
nextButton.addEventListener('click', nextButtonListener, false);
var resourcesButton = document.getElementById('thank-you');
resourcesButton.addEventListener('click', resourcesButtonListener, false);

//Luay created the Final Thank you note
function thankYou() {
  var thanks = document.getElementById('thank-you');
  var pEl = document.createElement('p');
  pEl.textContent = 'Thank you for completing our little training exercise. If you would like more information, please click this button to take you to our resources page. ';
  thanks.appendChild(pEl);
  var button = document.createElement('button');
  button.setAttribute('type', 'click');
  button.textContent = 'Resources!';
  thanks.appendChild(button);
  console.log('thank you note is running');
}

// LUAY re-write the scenario one we click on the Next button
function nextButtonListener (event) {
  event.preventDefault();
  event.stopPropagation();
  if (i === (scenariosArray.length - 1)) {
    thankYou();
    localStorage.removeItem('globalIndex');
  } else {
    i++;
    localStorage.globalIndex = JSON.stringify(i);
    document.getElementById('input-0').checked = false;
    document.getElementById('input-1').checked = false;
    document.getElementById('input-2').checked = false;
    document.getElementById('input-3').checked = false;<commit_msg>added removal of scenario content when thank you message triggered<commit_after>'use strict';

//Luay created listener for next button
var nextButton = document.getElementById('next-form');
nextButton.addEventListener('click', nextButtonListener, false);
var resourcesButton = document.getElementById('thank-you');
resourcesButton.addEventListener('click', resourcesButtonListener, false);

//Luay created the Final Thank you note, Brandon added removal of scenario content
function thankYou() {
  var quizBlock = document.getElementById('quiz-block');
  quizBlock.parentElement.removeChild(quizBlock);
  var thanks = document.getElementById('thank-you');
  var pEl = document.createElement('p');
  pEl.textContent = 'Thank you for completing our little training exercise. If you would like more information, please click this button to take you to our resources page. ';
  thanks.appendChild(pEl);
  var button = document.createElement('button');
  button.setAttribute('type', 'click');
  button.textContent = 'Resources!';
  thanks.appendChild(button);
  console.log('thank you note is running');
}

// LUAY re-write the scenario one we click on the Next button
function nextButtonListener (event) {
  event.preventDefault();
  event.stopPropagation();
  if (i === (scenariosArray.length - 1)) {
    thankYou();
    localStorage.removeItem('globalIndex');
  } else {
    i++;
    localStorage.globalIndex = JSON.stringify(i);
    document.getElementById('input-0').checked = false;
    document.getElementById('input-1').checked = false;
    document.getElementById('input-2').checked = false;
    document.getElementById('input-3').checked = false;
{'fraction_non_alphanumeric': 0.12391093901258471, 'fraction_numerical': 0.003226847370119393, 'mean_word_length': 5.212424849699399, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3041323', 'n_tokens_mistral': 804, 'n_tokens_neox': 796, 'n_words': 236}