{% extends "base.html" %}
{% load i18n %}

{% load quiz_tags %}

{% block title %} {{ quiz.title}} {% endblock %}
{% block description %} {% trans "Exam results for" %} {{ quiz.title }} {% endblock %}

{% block content %}

  {% if previous.answers %}

  <p class="muted"><small>{% trans "The previous question" %}:</small></p>
  <p>{{ previous.previous_question }}</p>
  <p>Your answer was
	<strong>
	  {{ previous.previous_outcome|yesno:"correct,incorrect" }}
	</strong>
  </p>
  {% include 'correct_answer.html' %}
  <p><strong>{% trans "Explanation" %}:</strong></p>
  <div class="well " style="background-color: #fcf8e3;">
    <p>{{ previous.previous_question.explanation }}</p>
  </div>
  <hr>

  {% endif %}

  {% if max_score %}

  <div>
	<h2>{% trans "Exam results" %}</h2>
	<p>
	  <small class="muted">{% trans "Exam title" %}: </small>
	  <strong>{{ quiz.title }}</strong></p>

	<p class="lead">
	  {% trans "You answered" %} {{ score }} {% trans "questions correctly on " %} {{ max_score }}, {% trans "giving you" %} {{ percent }} {% trans " of correct answers" %}
	</p>

	{% if quiz.pass_mark %}
	<hr>
        <p class="lead">{{ sitting.result_message }}</p>
	<hr>

	{% endif %}
<!-- TO DO -->
	<p>{% trans "Review the questions below and try the exam again in the future"%}.</p>

	{% if user.is_authenticated %}

	  <p>{% trans "The result of this exam will be stored in your progress section so you can review and monitor your progression" %}.</p>

	{% endif %}
  </div>


  {% endif %}


  <hr>

  {% if possible %}

  <p class="lead">
	{% trans "Your session score is" %} {{ session }} {% trans "out of a possible" %} {{ possible }}
  </p>

  <hr>

  {% endif %}

  {% if questions %}

    {% for question in questions %}

      <p class="lead">
		{{ question.content }}
	  </p>

	  {% correct_answer_for_all question %}

      {% if question.user_answer %}
      <p>{% trans "Your answer" %}: {{ question|answer_choice_to_string:question.user_answer }}</p>
      {% endif %}

	  <p><strong>{% trans "Explanation" %}:</strong></p>
	  <div class="well " style="background-color: #fcf8e3;">
		<p>{{ question.explanation|safe }}</p>
	  </div>

	  <hr>

  {% endfor %}

  {% endif %}


{% endblock %}
