{% extends "base.html" %}

{% load quiz_tags %}

{% block title %} {{ quiz.title}} {% endblock %}
{% block description %} Exam Results for {{ quiz.title }} {% endblock %}

{% block content %}

  {% if previous.answers %}

  <p class="muted"><small>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>Explanation:</strong></p>
  <div class="well " style="background-color: #fcf8e3;">
    <p>{{ previous.previous_question.explanation }}</p>
  </div>
  <hr>

  {% endif %}

  {% if max_score %}

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

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

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

	{% endif %}

	<p>Review the questions below and try the exam again in the future.</p>

	{% if user.is_authenticated %}

	  <p>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">
	Your session score is {{ session }} 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 %}

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

	  <hr>

  {% endfor %}

  {% endif %}


{% endblock %}
