{% load i18n %}
{% load humanize %}
{% load cradmin_legacy_tags %}
<div id="devilry_admin_assignment_gradingconfiguration">
    <h2>{% trans "Grading configuration" %}</h2>

    <div id="devilry_admin_assignment_overview_gradingconfiguration_information">
        <dl class="devilry-definitionlist">
            <dt>{% trans "Examiner chooses" %}</dt>
            <dd>{{ assignment.get_grading_system_plugin_id_display }}</dd>

            <dt>{% trans "Students see" %}</dt>
            <dd>
                {% if assignment.points_to_grade_mapper == 'custom-table' %}
                    {% for points, grade in assignment.prefetched_point_to_grade_map.as_choices %}{% spaceless %}
                        {% if not forloop.first %}
                            {% if forloop.last %}
                                <span> {% trans "or" %} </span>
                            {% else %}
                                <span>, </span>
                            {% endif %}
                        {% endif %}
                        {{ grade }}
                    {% endspaceless %}{% endfor %}
                    
                {% else %}
                    {{ assignment.get_points_to_grade_mapper_display }}
                {% endif %}
            </dd>

            {% if assignment.grading_system_plugin_id == 'devilry_gradingsystemplugin_approved' %}
                <dt>{% trans "Points awarded for passing grade" %}</dt>
                <dd>
                    {{ assignment.max_points }}
                </dd>
            {% else %}
                <dt>{% trans "Maximum number of points achievable" %}</dt>
                <dd>
                    {{ assignment.max_points }}
                </dd>

                <dt>{% trans "Minimum number of points required to pass" %}</dt>
                <dd>
                    {{ assignment.passing_grade_min_points }}
                </dd>
            {% endif %}
        </dl>
    </div>
    <div id="devilry_admin_assignment_gradingconfiguration_buttons">
        <a href="{% cradmin_appurl "update_gradingconfiguration" assignment.id %}" type="button"
           class="btn btn-default btn-sm">{% trans "Edit grading configuration" %}</a>
    </div>
</div>
