<commit_before><!-- Defines how the Question modal will look -->
<div class="modal fade" id="question_display_Modal" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <!-- Close button -->
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <!-- Displays the question at the top of the modal. Javascript finds the "modal-title" class and populates it with the question contents. -->
        <h4 class="modal-title"></h4>
      </div>
      <div class="modal-body center">

        <!-- Creates the text box for the user to input their answer. The submit button is only able to be clicked once the user has some content in the text box. -->
        <form accept-charset="UTF-8"
              action="/questions/question['id']/answers"
              class="new_answer"
              data-remote="true"
              id="new_answer"
              method="post">
          <div style="display:none">
            <input name="utf8" type="hidden" value="✓" />
          </div>
          <textarea class="form-control answer-text" name="answer[text]" placeholder="Type your answer here"></textarea>
          <div class="center btn-div">
            <input class="btn btn-theme btn-lg submit-answer"
                   name="commit"
                   type="submit"
                   value="Submit answer" />
          </div>
        </form>

        <!-- Displays the correct answer to the question once the user submits their answer -->
        <div class="prettyform answers">
          <div class="container">
            <div class="box center" style="display: block;">
              <h3>Answer:</h3>
              <h5 class="first-answer"></h5>
            </div>
          </div>
        </div>

        <!-- Allows the user to note whether or not they got the question right. Creates two buttons, of which the user presses one (yes/no).-->
        <div class="response">
          <br>
          <h4 class="center"><b>Did you know the answer?</b></h4>
          <div class="center row">
            <div class="col-xs-4">
              <a id="respond-yes" class="btn-feedback btn-success"
                 data-feedback-active="<%= @feedback_active %>"
                 data-feedback-string="yes">
                <i class="fa fa-check"></i>
              </a>
            </div>
            <div class="col-xs-4">
              <a id="respond-maybe" class="btn-feedback btn-maybe "
                data-feedback-active="<%= @feedback_active %>"
                data-feedback-string="maybe">
                <i class="fa fa-question"></i>
              </a>
            </div>
            <div class="col-xs-4">
              <a id="respond-no" class="btn-feedback btn-pink"
                data-feedback-active="<%= @feedback_active %>"
                data-feedback-string="no">
                <i class="fa fa-times"></i>
              </a>
            </div>
          </div>
        </div>
        <br>

        <!-- Alert box appears after the user answers whether or not they got the question right  -->
        <div class="alert feedback-alert center">
          <div class="feedback-alert-text"> </div>
          &nbsp;
          <a class="close-alert grow"><i class="fa fa-times-circle"></i></a>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  $(document).ready(function(){
    // Creates the javascript for the Question modal that allows it to be populated with the data received upon clicking the modal link
    $('#question_display_Modal').on('show.bs.modal', function (event) {
      var $question_link = $(event.relatedTarget); // element that triggered the modal. $question_link is populated with the data from the click
      initQuestionDisplayModal($(this), $question_link);
    })

    $('#question_display_Modal').on('shown.bs.modal', function (event) {
      $('textarea').focus();
    })
  });
</script><commit_msg>future-proofed answer box by adding id for textarea<commit_after><!-- Defines how the Question modal will look -->
<div class="modal fade" id="question_display_Modal" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <!-- Close button -->
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <!-- Displays the question at the top of the modal. Javascript finds the "modal-title" class and populates it with the question contents. -->
        <h4 class="modal-title"></h4>
      </div>
      <div class="modal-body center">

        <!-- Creates the text box for the user to input their answer. The submit button is only able to be clicked once the user has some content in the text box. -->
        <form accept-charset="UTF-8"
              action="/questions/question['id']/answers"
              class="new_answer"
              data-remote="true"
              id="new_answer"
              method="post">
          <div style="display:none">
            <input name="utf8" type="hidden" value="✓" />
          </div>
          <textarea id="answer-box" class="form-control answer-text" name="answer[text]" placeholder="Type your answer here"></textarea>
          <div class="center btn-div">
            <input class="btn btn-theme btn-lg submit-answer"
                   name="commit"
                   type="submit"
                   value="Submit answer" />
          </div>
        </form>

        <!-- Displays the correct answer to the question once the user submits their answer -->
        <div class="prettyform answers">
          <div class="container">
            <div class="box center" style="display: block;">
              <h3>Answer:</h3>
              <h5 class="first-answer"></h5>
            </div>
          </div>
        </div>

        <!-- Allows the user to note whether or not they got the question right. Creates two buttons, of which the user presses one (yes/no).-->
        <div class="response">
          <br>
          <h4 class="center"><b>Did you know the answer?</b></h4>
          <div class="center row">
            <div class="col-xs-4">
              <a id="respond-yes" class="btn-feedback btn-success"
                 data-feedback-active="<%= @feedback_active %>"
                 data-feedback-string="yes">
                <i class="fa fa-check"></i>
              </a>
            </div>
            <div class="col-xs-4">
              <a id="respond-maybe" class="btn-feedback btn-maybe "
                data-feedback-active="<%= @feedback_active %>"
                data-feedback-string="maybe">
                <i class="fa fa-question"></i>
              </a>
            </div>
            <div class="col-xs-4">
              <a id="respond-no" class="btn-feedback btn-pink"
                data-feedback-active="<%= @feedback_active %>"
                data-feedback-string="no">
                <i class="fa fa-times"></i>
              </a>
            </div>
          </div>
        </div>
        <br>

        <!-- Alert box appears after the user answers whether or not they got the question right  -->
        <div class="alert feedback-alert center">
          <div class="feedback-alert-text"> </div>
          &nbsp;
          <a class="close-alert grow"><i class="fa fa-times-circle"></i></a>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  $(document).ready(function(){
    // Creates the javascript for the Question modal that allows it to be populated with the data received upon clicking the modal link
    $('#question_display_Modal').on('show.bs.modal', function (event) {
      var $question_link = $(event.relatedTarget); // element that triggered the modal. $question_link is populated with the data from the click
      initQuestionDisplayModal($(this), $question_link);
    })

    $('#question_display_Modal').on('shown.bs.modal', function (event) {
      $('#answer-box').focus();
    })
  });
</script>
{'fraction_non_alphanumeric': 0.14978461538461538, 'fraction_numerical': 0.0032, 'mean_word_length': 1.9963126843657817, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 0, '>': 171, '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': '6869307', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2164, 'n_words': 635}