<commit_before><% if old_result %>
  <p>
    <a href='#' onclick='return false;' onmouseover='show_old_marks();' onmouseout='hide_old_marks();'>
      <%= t('marker.marks.show_old_marks') %>
    </a>
  </p>

  <div id='old_summary_criteria_pane'>

    <%= render partial: 'results/common/marks_summary_table',
               locals: { mark_criteria: mark_criteria,
                         marks_map: old_marks_map } %>

    <% if @old_result.get_negative_extra_points != 0 || @old_result.get_positive_extra_points != 0 ||
        @old_result.extra_marks.percentage.size != 0 %>
    <div class='summary_block'>
      <strong><%= t('marker.marks.old_subtotal') %></strong>
      <span><%= old_result.get_subtotal %> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
    </div>
    <% end %>
    <% if assignment.submission_rule.is_a? GracePeriodSubmissionRule and
        (@old_result.submission.grouping.grace_period_deductions.
            includes(membership: :user).group_by {|d| d.membership.user}).size > 0 %>
        <div class='submission_rule_pane'>
          <div class='submission_rule_label'>
            <strong><%= t('marker.marks.submission_rule') %>:</strong>
          </div>
          <div id="submission_rule_viewer">
            <%= render partial: assignment.submission_rule.grader_tab_partial,
                       locals: { grouping: result.submission.grouping } %>
          </div>
        </div>
    <% end %>

    <% if @old_result.get_positive_extra_points != 0 || @old_result.get_negative_extra_points != 0 %>
    <div class='extra_marks_pane'>
      <div class='bonus_deduction'>
        <strong><%= t('marker.marks.bonus_deductions') %></strong>
      </div>

      <%= render partial: 'results/student/extra_marks_table',
                 locals: { extra_marks_points: old_result.extra_marks.points,
                           result_id: old_result.id } %>

      <table>
        <tr>
          <td>
            <strong><%= t('marker.marks.bonus_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_bonus'>
            <%= @old_result.get_positive_extra_points %>
          </td>
        </tr>
        <tr>
          <td>
            <strong><%= t('marker.marks.deducted_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_deducted'>
            <%= @old_result.get_negative_extra_points %>
          </td>
        </tr>
      </table>
    </div>
    <% end %>
    <% if @old_result.extra_marks.percentage.size != 0 %>
    <div class='extra_percentage_pane'>
      <%= render partial: 'results/student/extra_percentage_table',
                 locals: { extra_marks_percentage: old_result.extra_marks.percentage,
                           result_id: old_result.id } %>
    </div>
    <div class='summary_block'>
      <strong><%= t('marker.marks.total_extra_percentages').html_safe %></strong>
      <span id='total_extra_percentage'><%= old_result.get_total_extra_percentage %></span><br>
      <strong><%= t('marker.marks.translated_to_points') %></strong>
      <span id='total_extra_percentage_as_points'><%= old_result.get_total_extra_percentage_as_points %></span><br>
    </div>
    <% end %>
  </div>
<% end %>

<div id='summary_criteria_pane'>
  <%= render partial: 'results/common/marks_summary_table',
             locals: { mark_criteria: mark_criteria,
                       marks_map: marks_map } %>

  <!-- Summary Criteria Pane -->

  <% unless @result.is_a_review? %>
    <% if @result.get_negative_extra_points != 0 || @result.get_positive_extra_points != 0 ||
        @result.extra_marks.percentage.size != 0 %>
    <div class='summary_block'>
        <strong><%= t('marker.marks.subtotal') %></strong>
        <span><%= result.get_subtotal %> / <%= assignment.max_mark %></span>
    </div>
    <% end %>
      <% if assignment.submission_rule.is_a? GracePeriodSubmissionRule and
          (result.submission.grouping.grace_period_deductions.
              includes(membership: :user).group_by {|d| d.membership.user}).size > 0 %>
      <div class='submission_rule_pane'>
        <div class='submission_rule_label'>
          <strong><%= t('marker.marks.submission_rule') %>:</strong>
        </div>
        <div id="submission_rule_viewer">
          <%= render partial: assignment.submission_rule.grader_tab_partial,
                     locals: { grouping: result.submission.grouping } %>
        </div>
      </div>
    <% end %>

    <% if @result.get_negative_extra_points != 0 || @result.get_positive_extra_points != 0 %>
    <div class='extra_marks_pane'>
      <div class='bonus_deduction'>
        <strong><%= t('marker.marks.bonus_deductions') %></strong>
      </div>

      <%= render partial: 'results/student/extra_marks_table',
                 locals: { extra_marks_points: extra_marks_points,
                           result_id: result.id } %>

      <table>
        <tr>
          <td>
            <strong><%= t('marker.marks.bonus_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_bonus'>
            <%= @result.get_positive_extra_points %>
          </td>
        </tr>
        <tr>
          <td>
            <strong><%= t('marker.marks.deducted_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_deducted'>
            <%= @result.get_negative_extra_points %>
          </td>
        </tr>
      </table>
    </div>
    <% end %>
    <% if extra_marks_percentage.size != 0 %>
    <div class='extra_percentage_pane'>
      <%= render partial: 'results/student/extra_percentage_table',
                 locals: { extra_marks_percentage: extra_marks_percentage,
                           result_id: result.id } %>
    </div>

    <div class='summary_block'>
      <strong><%= t('marker.marks.total_extra_percentages').html_safe %></strong>
      <span id='total_extra_percentage'><%= result.get_total_extra_percentage %></span><br>
      <strong><%= t('marker.marks.translated_to_points') %></strong>
      <span id='total_extra_percentage_as_points'><%= result.get_total_extra_percentage_as_points %></span><br>
    </div>
    <% end %>
  <% end %>
</div>

<% if old_result %>
  <div class='mark_total'>
    <span class='final_mark'>
      <span id='old_total_mark_div'><%= old_result.total_mark %> </span>
      <span> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
    </span>
    <span><%= t('marker.marks.previous_mark').html_safe %></span>
  </div>
<% end %>

<div class='mark_total'>
  <span class='final_mark'>
    <span id='current_total_mark_div'><%= result.total_mark %> </span>
    <span> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
  </span>
  <span><%= t('marker.marks.final_mark').html_safe %></span>
</div>

<script>
  hide_old_marks();
</script>
<commit_msg>fixed requests<commit_after><% if old_result %>
  <p>
    <a href='#' onclick='return false;' onmouseover='show_old_marks();' onmouseout='hide_old_marks();'>
      <%= t('marker.marks.show_old_marks') %>
    </a>
  </p>

  <div id='old_summary_criteria_pane'>

    <%= render partial: 'results/common/marks_summary_table',
               locals: { mark_criteria: mark_criteria,
                         marks_map: old_marks_map } %>

    <% if @old_result.get_negative_extra_points != 0 || @old_result.get_positive_extra_points != 0 ||
        @old_result.extra_marks.percentage.size != 0 %>
    <div class='summary_block'>
      <strong><%= t('marker.marks.old_subtotal') %></strong>
      <span><%= old_result.get_subtotal %> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
    </div>
    <% end %>
    <% if assignment.submission_rule.is_a? GracePeriodSubmissionRule &&
        (@old_result.submission.grouping.grace_period_deductions.any?).size > 0 %>
        <div class='submission_rule_pane'>
          <div class='submission_rule_label'>
            <strong><%= t('marker.marks.submission_rule') %>:</strong>
          </div>
          <div id='submission_rule_viewer'>
            <%= render partial: assignment.submission_rule.grader_tab_partial,
                       locals: { grouping: result.submission.grouping } %>
          </div>
        </div>
    <% end %>

    <% if @old_result.get_positive_extra_points != 0 || @old_result.get_negative_extra_points != 0 %>
    <div class='extra_marks_pane'>
      <div class='bonus_deduction'>
        <strong><%= t('marker.marks.bonus_deductions') %></strong>
      </div>

      <%= render partial: 'results/student/extra_marks_table',
                 locals: { extra_marks_points: old_result.extra_marks.points,
                           result_id: old_result.id } %>

      <table>
        <tr>
          <td>
            <strong><%= t('marker.marks.bonus_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_bonus'>
            <%= @old_result.get_positive_extra_points %>
          </td>
        </tr>
        <tr>
          <td>
            <strong><%= t('marker.marks.deducted_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_deducted'>
            <%= @old_result.get_negative_extra_points %>
          </td>
        </tr>
      </table>
    </div>
    <% end %>
    <% if @old_result.extra_marks.percentage.size != 0 %>
    <div class='extra_percentage_pane'>
      <%= render partial: 'results/student/extra_percentage_table',
                 locals: { extra_marks_percentage: old_result.extra_marks.percentage,
                           result_id: old_result.id } %>
    </div>
    <div class='summary_block'>
      <strong><%= t('marker.marks.total_extra_percentages').html_safe %></strong>
      <span id='total_extra_percentage'><%= old_result.get_total_extra_percentage %></span><br>
      <strong><%= t('marker.marks.translated_to_points') %></strong>
      <span id='total_extra_percentage_as_points'><%= old_result.get_total_extra_percentage_as_points %></span><br>
    </div>
    <% end %>
  </div>
<% end %>

<div id='summary_criteria_pane'>
  <%= render partial: 'results/common/marks_summary_table',
             locals: { mark_criteria: mark_criteria,
                       marks_map: marks_map } %>

  <!-- Summary Criteria Pane -->

  <% unless @result.is_a_review? %>
    <% if @result.get_negative_extra_points != 0 || @result.get_positive_extra_points != 0 ||
        @result.extra_marks.percentage.size != 0 %>
    <div class='summary_block'>
        <strong><%= t('marker.marks.subtotal') %></strong>
        <span><%= result.get_subtotal %> / <%= assignment.max_mark %></span>
    </div>
    <% end %>
      <% if assignment.submission_rule.is_a? GracePeriodSubmissionRule &&
          (result.submission.grouping.grace_period_deductions.any?).size > 0 %>
      <div class='submission_rule_pane'>
        <div class='submission_rule_label'>
          <strong><%= t('marker.marks.submission_rule') %>:</strong>
        </div>
        <div id='submission_rule_viewer'>
          <%= render partial: assignment.submission_rule.grader_tab_partial,
                     locals: { grouping: result.submission.grouping } %>
        </div>
      </div>
    <% end %>

    <% if @result.get_negative_extra_points != 0 || @result.get_positive_extra_points != 0 %>
    <div class='extra_marks_pane'>
      <div class='bonus_deduction'>
        <strong><%= t('marker.marks.bonus_deductions') %></strong>
      </div>

      <%= render partial: 'results/student/extra_marks_table',
                 locals: { extra_marks_points: extra_marks_points,
                           result_id: result.id } %>

      <table>
        <tr>
          <td>
            <strong><%= t('marker.marks.bonus_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_bonus'>
            <%= @result.get_positive_extra_points %>
          </td>
        </tr>
        <tr>
          <td>
            <strong><%= t('marker.marks.deducted_marks').html_safe %></strong>
          </td>
          <td id='extra_marks_deducted'>
            <%= @result.get_negative_extra_points %>
          </td>
        </tr>
      </table>
    </div>
    <% end %>
    <% if extra_marks_percentage.size != 0 %>
    <div class='extra_percentage_pane'>
      <%= render partial: 'results/student/extra_percentage_table',
                 locals: { extra_marks_percentage: extra_marks_percentage,
                           result_id: result.id } %>
    </div>

    <div class='summary_block'>
      <strong><%= t('marker.marks.total_extra_percentages').html_safe %></strong>
      <span id='total_extra_percentage'><%= result.get_total_extra_percentage %></span><br>
      <strong><%= t('marker.marks.translated_to_points') %></strong>
      <span id='total_extra_percentage_as_points'><%= result.get_total_extra_percentage_as_points %></span><br>
    </div>
    <% end %>
  <% end %>
</div>

<% if old_result %>
  <div class='mark_total'>
    <span class='final_mark'>
      <span id='old_total_mark_div'><%= old_result.total_mark %> </span>
      <span> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
    </span>
    <span><%= t('marker.marks.previous_mark').html_safe %></span>
  </div>
<% end %>

<div class='mark_total'>
  <span class='final_mark'>
    <span id='current_total_mark_div'><%= result.total_mark %> </span>
    <span> / <%= assignment.max_mark(@result.is_a_review? ? :peer : :ta) %></span>
  </span>
  <span><%= t('marker.marks.final_mark').html_safe %></span>
</div>

<script>
  hide_old_marks();
</script>

{'fraction_non_alphanumeric': 0.1662595306832482, 'fraction_numerical': 0.00207269227922126, 'mean_word_length': 2.6454398273070696, 'pattern_counts': {'":': 0, '<': 399, '<?xml version=': 0, '>': 403, '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': '1455646', 'n_tokens_mistral': 4654, 'n_tokens_neox': 4371, 'n_words': 667}