{% extends "base.html" %}

{% load quiz_tags %}

{% block title %} {{ quiz.title }} {% endblock %}
{% block description %} {{ quiz.title }} - {{ quiz.description }} {% endblock %}

{% block content %}

<div class="container">


{% if previous %}

        <p class="muted"><small>The previous question:</small></p>
        <p>{{ previous.previous_question }}</p>

        {% ifequal previous.previous_outcome 'correct' %}
			<div class="alert alert-success">
		{% else %}
			<div class="alert alert-warning">
		{% endifequal %}

		    	<p><small>Your answer was </small><strong>{{ previous.previous_outcome }}</strong></p>
		    </div>

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


<hr>

{% endif %}

<br />


{% if question %}

    	<p><small class="muted">Question category:</small> <strong>{{ question.category }}</strong></p>
        <p class="lead">{{ question.content }}</p>

		<form action="{% url 'quiz_question' quiz.url %}" method="get">
		  <input type=hidden name="question_id" value="{{ question.id }}">

		  <table class="table table-hover table-bordered" id="answerchoice">
			<tbody>

			  {% ifequal question_type 'TF_Question' %}
			      {% include 'answers_for_tf_question.html' %}
			  {% endifequal %}

			  {% ifequal question_type 'MCQuestion' %}
		          {% answers_for_mc_question question %}
			  {% endifequal %}

			</tbody>
		  </table>
		  <input type="submit" value="Check" class="btn btn-large btn-block btn-warning" >
		</form>


{% endif %}

    <hr>



</div>

{% endblock %}
