parent
6dfe402fa7
commit
4e678a7a0f
@ -1,6 +1,91 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}统计 - 课堂点名系统{% endblock %}
|
||||
{% block content %}
|
||||
<h4>统计页面占位</h4>
|
||||
<p>上半部分:积分随时间走势图;下半部分:排行榜;右侧:点名记录。</p>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-8">
|
||||
<h4>积分排行榜</h4>
|
||||
</div>
|
||||
<div class="col-md-4 text-end">
|
||||
<a href="{{ url_for('main.export_students') }}" class="btn btn-sm btn-outline-primary">
|
||||
导出积分详单
|
||||
</a>
|
||||
<a
|
||||
href="{{ url_for('main.export_rollcalls') }}"
|
||||
class="btn btn-sm btn-outline-secondary ms-2"
|
||||
>
|
||||
导出点名记录
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名次</th>
|
||||
<th>学号</th>
|
||||
<th>姓名</th>
|
||||
<th>专业</th>
|
||||
<th>总积分</th>
|
||||
<th>出勤次数</th>
|
||||
<th>随机点名次数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in students %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ s.student_no }}</td>
|
||||
<td>{{ s.name }}</td>
|
||||
<td>{{ s.major }}</td>
|
||||
<td>{{ '%.1f'|format(s.total_score or 0) }}</td>
|
||||
<td>{{ s.attendance_count or 0 }}</td>
|
||||
<td>{{ s.random_called_count or 0 }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7" class="text-center">暂无学生数据。</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<h5>最近点名记录</h5>
|
||||
<div class="table-responsive" style="max-height: 500px; overflow-y: auto">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>时间</th>
|
||||
<th>姓名</th>
|
||||
<th>学号</th>
|
||||
<th>模式</th>
|
||||
<th>状态</th>
|
||||
<th>积分</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rc, s in records %}
|
||||
<tr>
|
||||
<td>{{ rc.call_time.strftime('%m-%d %H:%M') }}</td>
|
||||
<td>{{ s.name }}</td>
|
||||
<td>{{ s.student_no }}</td>
|
||||
<td>{{ '随机' if rc.mode == 'random' else '顺序' }}</td>
|
||||
<td>
|
||||
{% if rc.status == 'absent' %}缺勤{% elif rc.status == 'distracted' %}走神{% else %}到课{% endif %}
|
||||
</td>
|
||||
<td>{{ '%.1f'|format(rc.score_change or 0) }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center">暂无点名记录。</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Loading…
Reference in new issue