{% extends "base.html" %} {% block title %}我的成绩 - FlashExam{% endblock %} {% block head %} {% endblock %} {% block content %}

我的成绩

姓名
{{ current_user.get_display_name() }}
学号
{{ current_user.username }}
{% if current_user.extra_info %}
专业
{{ current_user.extra_info.get('major', '-') }}
班级
{{ current_user.extra_info.get('class_name', '-') }}
{% endif %}
{% if exam_results %} {% set graded_exams = exam_results|selectattr('is_graded', 'true')|list %}

{{ exam_results|length }}

参加考试

{% if graded_exams %}{{ "%.1f"|format(graded_exams|map(attribute='score')|sum / graded_exams|length) }}{% else %}-{% endif %}

平均分

{% if graded_exams %}{{ graded_exams|map(attribute='score')|max|round(1) }}{% else %}-{% endif %}

最高分

{{ graded_exams|selectattr('score', '>=', 60)|list|length }}

及格次数

{% endif %}
考试记录
{% if exam_results %}
{% for result in exam_results %} {% endfor %}
考试名称 成绩 等级 完成时间 状态 操作
{{ result.get('exam_title', '未知考试') }}
#{{ result.get('exam_id') }}
{% if result.get('is_graded') %} {% set score = result.get('score', 0) %} {% set total = result.get('total_score', 100) %} {% set pct = (score/total*100)|round(1) if total > 0 else 0 %} {{ "%.1f"|format(score) }}/{{ "%.1f"|format(total) }} {% else %} 等待评分 {% endif %} {% if result.get('is_graded') %} {% set score = result.get('score', 0) %} {% set total = result.get('total_score', 100) %} {% set pct = (score/total*100)|round(1) if total > 0 else 0 %} {% if pct >= 90 %}优秀 {% elif pct >= 80 %}良好 {% elif pct >= 70 %}中等 {% elif pct >= 60 %}及格 {% else %}不及格 {% endif %} {% else %} - {% endif %} {% if result.get('end_time') %} {{ result.get('end_time')[:16].replace('T', ' ') }} {% else %} - {% endif %} {% if result.get('is_graded') %} 已评分 {% else %} 等待评分 {% endif %}
{% else %}

暂无考试记录

您还没有参加任何考试

参加考试
{% endif %}
{% endblock %}