{% extends "base.html" %} {% block title %}QuizTrainer - 答题结果{% endblock %} {% block content %}
{% if record.is_correct %}
回答正确! +1 分
{% else %}
回答错误 再接再厉
{% endif %}
{{ question.type_display }} {{ question.difficulty_display }}
{{ question.category }}
{{ question.question }}
{% if question.type.value == 'choice' %}
{% for option in question.options %} {% set opt_key = ['A', 'B', 'C', 'D', 'E', 'F'][loop.index0] %} {% set is_correct_opt = opt_key == question.answer %} {% set is_user_opt = opt_key == record.user_answer %}
{{ opt_key }} {{ option }} {% if is_correct_opt %} 正确答案 {% endif %} {% if is_user_opt and not is_correct_opt %} 你的答案 {% endif %}
{% endfor %}
{% elif question.type.value == 'truefalse' %}
T 正确 (True) {% if question.answer == True %} 正确答案 {% endif %}
F 错误 (False) {% if question.answer == False %} 正确答案 {% endif %}
{% if record.user_answer != question.answer %}
你的答案: {{ '正确' if record.user_answer == 'true' else '错误' if record.user_answer == 'false' else record.user_answer }}
{% endif %}
{% else %}
正确答案
{{ question.answer }}
{% if record.user_answer != question.answer and question.type.value == 'fill' %}
你的答案
{{ record.user_answer }}
{% endif %} {% endif %} {% if question.explanation %}

题目解析

{{ question.explanation }}

{% endif %}
返回首页
继续答题 {% if session.current_index < session.progress.total - 1 %}
{% else %} 查看结果 {% endif %}
{% endblock %}