parent
89801f2e62
commit
5933adeb5b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.25 on 2024-10-07 16:09
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('polls', '0002_student'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='student',
|
||||||
|
name='called_count',
|
||||||
|
field=models.IntegerField(default=0),
|
||||||
|
),
|
||||||
|
]
|
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.25 on 2024-10-07 16:37
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('polls', '0003_student_called_count'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='student',
|
||||||
|
name='protected',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
]
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>积分排行榜</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>积分排行榜</h1>
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<th>排名</th>
|
||||||
|
<th>学号</th>
|
||||||
|
<th>姓名</th>
|
||||||
|
<th>积分</th>
|
||||||
|
<th>到课次数</th>
|
||||||
|
</tr>
|
||||||
|
{% for student in students %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ forloop.counter }}</td> <!-- 使用forloop.counter显示排名 -->
|
||||||
|
<td>{{ student.student_id }}</td>
|
||||||
|
<td>{{ student.name }}</td>
|
||||||
|
<td>{{ student.score }}</td>
|
||||||
|
<td>{{ student.attendance_count }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in new issue