{% extends 'base.html' %} {% block content %}

Quiz Results

{{ quiz.title }}

Attempted on {{ attempt.attempted_at.strftime('%B %d, %Y at %I:%M %p') }}

Your Score
{{ attempt.score }}/{{ attempt.total_questions }}
{{ "%.1f"|format(attempt.percentage) }}%
Performance
{% if attempt.percentage >= 80 %}Excellent {% elif attempt.percentage >= 60 %}Good {% elif attempt.percentage >= 40 %}Fair {% else %}Needs Improvement{% endif %}

Question Review

{% for question in quiz.questions %}

Question {{ loop.index }} {{ question.question_type.upper() }}

{% set student_answer = answers[question.id] %} {% if question.question_type == 'mcq' %} {% if student_answer and student_answer == question.correct_answer %} Correct {% else %} Incorrect {% endif %} {% elif question.question_type == 'qa' %} {% if student_answer and student_answer.lower() == question.expected_answer.lower() %} Correct {% else %} Incorrect {% endif %} {% endif %}

{{ question.question_text }}

{% if question.question_type == 'mcq' %}

Options:

{% for option in question.get_options() %}
{{ option }} {% if option == question.correct_answer %} Correct Answer {% elif option == student_answer and option != question.correct_answer %} Your Answer {% endif %}
{% endfor %}
{% elif question.question_type == 'qa' %}

Your Answer:

{{ student_answer or 'No answer provided' }}

Expected Answer:

{{ question.expected_answer }}

{% endif %}
{% endfor %}
Back to Quizzes Back to Dashboard
{% endblock %}