<script type="text/template" id="xblock-grade-template">
  <% if (_.isNumber(max_attempts) && max_attempts > 0 && num_attempts >= max_attempts) {{ %>
  <p><%= gettext("Note: you have used all attempts. Continue to the next unit.") %></p>
  <% }} else {{ %>
  <p><%= gettext("Note: if you retake this assessment, only your final score counts.") %></p>
  <% }} %>

  <div class="grade-result">
    <h2>
      <%= _.template(gettext("You scored {percent}% on this assessment."), {percent: score}, {interpolate: /\{(.+?)\}/g}) %>
    </h2>
    <hr/>

    <span class="assessment-checkmark icon-2x checkmark-correct icon-ok fa fa-check"></span>
    <div class="results-section">
      <p>
        <%= _.template(
          ngettext(
            "You answered 1 question correctly.",
            "You answered {number_correct} questions correctly.",
            correct_answer
          ), {number_correct: correct_answer}, {interpolate: /\{(.+?)\}/g})
        %>
      </p>
      <%= runDetails('correct') %>
    </div>
    <div class="clear"></div>
    <span class="assessment-checkmark icon-2x checkmark-partially-correct icon-ok fa fa-check"></span>
    <div class="results-section">
      <p>
        <%= _.template(
          ngettext(
            "You answered 1 question partially correctly.",
            "You answered {number_partially_correct} questions partially correctly.",
            partially_correct_answer
          ), {number_partially_correct: partially_correct_answer}, {interpolate: /\{(.+?)\}/g})
        %>
      </p>
      <%= runDetails('partial') %>
    </div>
    <div class="clear"></div>
    <span class="assessment-checkmark icon-2x checkmark-incorrect icon-exclamation fa fa-exclamation"></span>
    <div class="results-section">
      <p>
        <%= _.template(
          ngettext(
            "You answered 1 question incorrectly.",
            "You answered {number_incorrect} questions incorrectly.",
            incorrect_answer
          ), {number_incorrect: incorrect_answer}, {interpolate: /\{(.+?)\}/g})
        %>
      </p>
      <%= runDetails('incorrect') %>
    </div>
    <div class="clear"></div>
    <hr/>
  </div>
</script>
