{% extends 'shorts/exams.html' %}

{% block content %}
Question -> <a href="{% url 'shorts:exam_question_detail' exam.id question_details.current|add:'-1' %}"
    title="View the Question">View</a>
<a href="{% url 'shorts:question_update' question.id %}" title="Edit the Question">Edit</a> <a
    href="{% url 'admin:shorts_question_change' question.id %}" title="Edit the Question using the admin interface">Admin
    Edit</a>
<h2>Marking question {{question_details.current}} of {{question_details.total}}</h2>
<div>

    {% if not unmarked_count %}
    <div class="alert alert-info" role="alert">No answers to mark.</div>
    {% else %}
    <div class="alert alert-warning" role="alert">{{unmarked_count}} answer(s) to mark.</div>

    {% endif %}
    Answers:
    <ul>
        {% for answer in user_answers %}
        <li>
            <a class="mark-answer-link" href="{% url 'shorts:mark_answer' exam.id question_details.current|add:'-1' answer.id %}"
                title="Click to mark"> {{answer.get_candidate_masked}}</a>:
            {% if answer.is_marked %}
            Score {{answer.get_answer_score}}
            {% else %}
            Unmarked
            {% endif %}

        </li>
        {% endfor %}
    </ul>
    <div>
        {% if question_details.current > 1 %}
        <a href="{% url 'shorts:mark' exam.id question_details.current|add:'-2' %}"
            title="Previous question">Previous</a>
        {% endif %}
        {% if question_details.current >= question_details.total %}
        {% else %}
        <a href="{% url 'shorts:mark' exam.id question_details.current %}" title="Next question">Next</a>
        {% endif %}
    </div>
</div>

{% endblock %}