<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<%
  out_of_text = t("out of %{points_possible}", points_possible: I18n.n(round_if_whole(assignment.points_possible)))
%>

<label class="bold" for="grading-box-extended">
  <div id="grading-box-points-possible">
    <%= t('labels.grade', "Grade") %>
    <% if assignment.grading_type == 'points' %>
      <%= out_of_text %>
    <% elsif assignment.grading_type != 'gpa_scale' %>
      (<span class="score"></span> / <%= I18n.n(round_if_whole(assignment.points_possible)) %>)
    <% end %>
  </div>

  <div id="speed_grader_hidden_submission_pill_mount_point"></div>

  <% case assignment.grading_type %>
  <% when "points", "percent", "letter_grade", "gpa_scale" %>
    <input type="text" id="grading-box-extended" maxlength="254"/>
  <% when "pass_fail" %>
    <select id="grading-box-extended" class="pass_fail_grading_type">
      <option value="">---</option>
      <option value="complete"><%= t('#gradebooks.grades.complete', "Complete") %></option>
      <option value="incomplete"><%= t('#gradebooks.grades.incomplete', "Incomplete") %></option>
      <option value="EX"><%= t('Excused') %></option>
    </select>
  <% end %>

  <span id="grading-box-selected-grader"></span>
</label>

<div id="deduction-box" class="hidden">
  <div class="deduction-box-labels">
    <div class="error">
      <%= I18n.t('Late Penalty:') %>
    </div>
    <div class="primary">
      <%= I18n.t('Final Grade:') %>
    </div>
  </div>
  <div class="deduction-box-values">
    <div id="points-deducted" class="error bold"></div>
    <div id="final-grade" class="primary bold"></div>
  </div>
</div>
