From 875b4ae9cf1526fab16aa88dc74e30bef36aa7aa Mon Sep 17 00:00:00 2001 From: Lyanling <1736289433@qq.com> Date: Thu, 10 Oct 2024 22:11:14 +0800 Subject: [PATCH] sixth commit --- .../polls/templates/confirm_roll_call.html | 113 ++++++------------ .../polls/templates/leaderboard.html | 54 ++++----- .../mysite10_7/polls/templates/login.html | 30 ++--- .../mysite10_7/polls/templates/register.html | 30 ++--- .../mysite10_7/polls/templates/roll_call.html | 18 --- .../polls/templates/upload_students.html | 28 ++--- .../mysite10_7/test/test_Login_view.py | 7 -- 7 files changed, 110 insertions(+), 170 deletions(-) diff --git a/pythonProject03/mysite10_7/polls/templates/confirm_roll_call.html b/pythonProject03/mysite10_7/polls/templates/confirm_roll_call.html index 5cc69ed..258cef7 100644 --- a/pythonProject03/mysite10_7/polls/templates/confirm_roll_call.html +++ b/pythonProject03/mysite10_7/polls/templates/confirm_roll_call.html @@ -1,75 +1,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 确认点名 + + +
+ {% csrf_token %} +

确认点名学生:

+

姓名: {{ student.name }}

+

学号: {{ student.student_id }}

+ + + + + + + + + + + +
+ +{% if protection_awarded %} +

该学生获得保护权,自动加2分!

+{% endif %} + + + diff --git a/pythonProject03/mysite10_7/polls/templates/leaderboard.html b/pythonProject03/mysite10_7/polls/templates/leaderboard.html index 2b5da7a..997ce63 100644 --- a/pythonProject03/mysite10_7/polls/templates/leaderboard.html +++ b/pythonProject03/mysite10_7/polls/templates/leaderboard.html @@ -1,27 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + 积分排行榜 + + +

积分排行榜

+ + + + + + + + + {% for student in students %} + + + + + + + + {% endfor %} +
排名学号姓名积分到课次数
{{ forloop.counter }} {{ student.student_id }}{{ student.name }}{{ student.score }}{{ student.attendance_count }}
+ + \ No newline at end of file diff --git a/pythonProject03/mysite10_7/polls/templates/login.html b/pythonProject03/mysite10_7/polls/templates/login.html index 0bb44a6..4b3567f 100644 --- a/pythonProject03/mysite10_7/polls/templates/login.html +++ b/pythonProject03/mysite10_7/polls/templates/login.html @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + 登录 + + +
+ {% csrf_token %} +

+

+ +
+ + \ No newline at end of file diff --git a/pythonProject03/mysite10_7/polls/templates/register.html b/pythonProject03/mysite10_7/polls/templates/register.html index 1515a51..bb353f2 100644 --- a/pythonProject03/mysite10_7/polls/templates/register.html +++ b/pythonProject03/mysite10_7/polls/templates/register.html @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + 注册 + + +
+ {% csrf_token %} +

+

+ +
+ + \ No newline at end of file diff --git a/pythonProject03/mysite10_7/polls/templates/roll_call.html b/pythonProject03/mysite10_7/polls/templates/roll_call.html index 1229abc..54fa87e 100644 --- a/pythonProject03/mysite10_7/polls/templates/roll_call.html +++ b/pythonProject03/mysite10_7/polls/templates/roll_call.html @@ -1,22 +1,4 @@ - - - - - - - - - - - - - - - - - - diff --git a/pythonProject03/mysite10_7/polls/templates/upload_students.html b/pythonProject03/mysite10_7/polls/templates/upload_students.html index d99ce94..68bae50 100644 --- a/pythonProject03/mysite10_7/polls/templates/upload_students.html +++ b/pythonProject03/mysite10_7/polls/templates/upload_students.html @@ -1,15 +1,15 @@ - - - - - - - - - - - - + + + + + Title + + +
+ {% csrf_token %} + {{ form.as_p }} + +
- - \ No newline at end of file + + \ No newline at end of file diff --git a/pythonProject03/mysite10_7/test/test_Login_view.py b/pythonProject03/mysite10_7/test/test_Login_view.py index d870159..8847596 100644 --- a/pythonProject03/mysite10_7/test/test_Login_view.py +++ b/pythonProject03/mysite10_7/test/test_Login_view.py @@ -1,18 +1,11 @@ import requests - - url = 'http://127.0.0.1:8000/polls/index/' - - data = { 'user': 'zmm', 'pwd': 'Zmm' } - - response = requests.post(url, data=data) -# if response.status_code == 200: print("登录成功:", response.json()) else: