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 %}