{% extends 'base.html' %}

{% block content %}
    <div class="physics">
        {% include 'user_score_header.html' %}
        <ul>
            {% for question, ans in answers_and_marks %}
                <li class="user-answer-li"><span class="question-stem-text">
                    {% if request.user.is_authenticated %}
                        <a href="{% url 'physics:exam_take_user' pk=exam.id sk=forloop.counter0 %}">
                            Question {{forloop.counter}}
                        </a>
                    {% else %}
                        <a href="{% url 'physics:exam_take' exam.pk forloop.counter0 cid passcode %}">
                            Question {{forloop.counter}}
                        </a>
                    {% endif %}
                    
                    - {{ question.stem|safe }}</span>
                    <ol type="a">
                        {% for q, a, score, correct_answer in ans %}
                            <li class="question-part">
                                <span class="question-text">{{q|safe}}:</span> {% if exam.publish_results %}<span class="correct-answer">Correct answer: {{correct_answer|safe}}</span>{% endif %}
                                <br />
                                <span class="submitted-user-answer">{{a}}</span>
                                    {% if exam.publish_results or view_all_results%}
                                        <span class="answer-{{score}}">
                                             (Score: {{score}})
                                        </span>
                                    {% endif %}
                            </li>
                        {% endfor %}
                    </ol>
                </li>
            {% endfor %}
        </ul>
        {% include 'user_scores_footer.html' %}
    </div>
{% endblock %}