parent
619191b829
commit
77584735d0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for config project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
|
||||
application = get_asgi_application()
|
@ -0,0 +1,134 @@
|
||||
"""
|
||||
Django settings for config project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 5.1.1.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/5.1/ref/settings/
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-q4zt_!3q_l9bdtyzdaeqvf=gm)6^g+)h^h400+jugzvdeakvl5'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'user.apps.UserConfig'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
# 'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'config.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [os.path.join(BASE_DIR, 'pages')],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'config.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/5.1/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/5.1/howto/static-files/
|
||||
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
# settings.py
|
||||
STATIC_URL = '/static/' # 静态文件访问路径
|
||||
|
||||
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static/')]#css问题加载这个
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
"""
|
||||
URL configuration for config project.
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/5.1/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path,include
|
||||
|
||||
urlpatterns = [
|
||||
# path('admin/', admin.site.urls),
|
||||
path('',include('user.urls')),
|
||||
]
|
||||
|
@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for config project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
|
||||
application = get_wsgi_application()
|
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -0,0 +1,76 @@
|
||||
<!-- <div class="container"></div>
|
||||
<button id="toggleButton" class="close-button">
|
||||
<i class="fas fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div id="contentToHide">
|
||||
<p>这是要隐藏的内容。</p>
|
||||
<p>点击按钮后,这段文字将被隐藏。</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
// 示例 JavaScript 代码,用于处理点击事件
|
||||
document.getElementById('toggleButton').addEventListener('click', function() {
|
||||
var contentToHide = document.getElementById('contentToHide');
|
||||
contentToHide.classList.toggle('hidden');
|
||||
});
|
||||
</script> -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<span>nihap</span>
|
||||
<p>sandw</p>
|
||||
</body>
|
||||
</html>
|
||||
<div style="margin-left:15%;height:auto;padding: 120px 0 0 0;">
|
||||
<div style="text-align: end;">
|
||||
<form action="/zhuxiao/" id="zhuxiao" method="post">
|
||||
<button class="shangchuang" type="submit" style="color: red;" >账户注销</button>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('zhuxiao').addEventListener('submit', function(event) {
|
||||
// 阻止表单提交行为
|
||||
event.preventDefault();
|
||||
// 弹出确认对话框
|
||||
if (confirm('您确定要注销吗?')) {
|
||||
this.submit();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="sign-box">
|
||||
<form action="/xiugai/" method="post" id="myform">
|
||||
<div style="padding: 30px;font-size: 20px;">修改用户名和密码</div>
|
||||
<div style="padding: 10px;">
|
||||
<span>当前用户名:{{name}}</span>
|
||||
<input type="text" placeholder="修改用户名" name="username">
|
||||
</div>
|
||||
<input type="password" placeholder="修改密码" name="password">
|
||||
<div style="padding: 10px;">
|
||||
<button class="shangchuang" type="submit" >修改提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('myform').addEventListener('submit', function(event) {
|
||||
// 阻止表单提交行为
|
||||
event.preventDefault();
|
||||
// 弹出确认对话框
|
||||
if (confirm('您确定要修改吗?')) {
|
||||
this.submit();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
@ -0,0 +1,141 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>随机点名系统</title>
|
||||
<style>
|
||||
.biaoti {
|
||||
font-size: 30px;/* 文字大小 */
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
background-color: #163874;
|
||||
color: white;
|
||||
width: 100%;
|
||||
padding: 45px 0 45px 16px;/* 边框宽度 */
|
||||
height: 120px;
|
||||
box-sizing: border-box
|
||||
|
||||
}
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 120px 0 0 0;
|
||||
border: 0px;
|
||||
padding: 0;
|
||||
width: 15%;
|
||||
background-color: #163874;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
li a {
|
||||
display: block;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
padding: 45px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
li a.active {
|
||||
background-color: #7989E8;
|
||||
color: white;
|
||||
}
|
||||
|
||||
li a:hover:not(.active) {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.buof {
|
||||
|
||||
font-size: 30px;/* 文字大小 */
|
||||
text-align: center;
|
||||
color: white;
|
||||
box-sizing: border-box;
|
||||
margin-left: 15%;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.button {
|
||||
background-color: #1ab5dc;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 15px 32px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.twospan {
|
||||
font-size: 30px;
|
||||
color: gold;
|
||||
/* margin-left: ; */
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="biaoti">随机点名系统</div>
|
||||
<ul>
|
||||
<li><a class="active" href="#">点名提问</a></li>
|
||||
<li><a href="/second/">学生名单</a></li>
|
||||
<li><a href="/third/">积分排名</a></li>
|
||||
<li><a href="/fourth/">账号设置</a></li>
|
||||
</ul>
|
||||
<!-- 随机事件触发 -->
|
||||
<div style="margin-left:15%;padding:120px 0 0 16px;height:auto;">
|
||||
<div style="padding: 50px 0 0 0;">
|
||||
<div style="font-size: 70px;color: #163874;text-align: center;">天选之子</div>
|
||||
<div style="font-size: 60px;text-align: center;margin-top: 50px;">{{ form }}</div>
|
||||
<div style="margin:40px 0 20px 0;text-align: center;">
|
||||
{% if sign == 'zhongkou' %}
|
||||
<span class="twospan" style="text-align: center;">触发随机事件:双倍扣分</span>
|
||||
{% elif sign == 'lucky' %}
|
||||
<span class="twospan" style="text-align: center;">触发随机事件:可以寻求帮助</span>
|
||||
{% endif %}
|
||||
<span style="visibility: hidden;font-size: 30px;">占位</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 评分 -->
|
||||
<div style="margin-left:15%;height:auto;text-align: center;">
|
||||
<form action="/submitscore/" method="post" style="line-height: 30px;">
|
||||
<input type="hidden" name="student_name" value="{{ form }}"></input>
|
||||
<span style="font-size: 20px;color: #163874;">评分:</span>
|
||||
|
||||
<!-- 来没来 -->
|
||||
<input type="radio" name="daoda" value="1" checked="checked">到达课堂(加1分)
|
||||
{% if sign == 'zhongkou' %}
|
||||
<input type="radio" name="daoda" value="22">没到(扣2分)</input><br>
|
||||
{% else %}
|
||||
<input type="radio" name="daoda" value="2">没到(扣1分)</input><br>
|
||||
{% endif %}
|
||||
|
||||
<!-- 问题回复 -->
|
||||
<input type="radio" name="score1" value="1" checked="checked">重复问题(加0.5分)
|
||||
{% if sign == 'zhongkou' %}
|
||||
<input type="radio" name="score1" value="22">不能重复问题(扣2分)</input><br>
|
||||
{% else %}
|
||||
<input type="radio" name="score1" value="2">不能重复问题(扣1分)</input><br>
|
||||
{% endif %}
|
||||
|
||||
<span >回答问题得分:</span>
|
||||
<input type="number" name="score2" step = "0.5" min="0" max="3" placeholder="0.5-3" value="0">
|
||||
<button class="button" style="padding: 5px;" type="submit">确认</button>
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
<!-- 点名按钮 -->
|
||||
<div class="buof">
|
||||
<form action="/dianming/" method="get">
|
||||
<button class="button">随机点名</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,179 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>随机点名系统</title>
|
||||
<style>
|
||||
.biaoti {
|
||||
font-size: 30px;/* 文字大小 */
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
background-color: #163874;
|
||||
color: white;
|
||||
width: 100%;
|
||||
padding: 45px 0 45px 16px;/* 边框宽度 */
|
||||
height: 120px;
|
||||
box-sizing: border-box
|
||||
|
||||
}
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 120px 0 0 0;
|
||||
border: 0px;
|
||||
padding: 0;
|
||||
width: 15%;
|
||||
background-color: #163874;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
li a {
|
||||
display: block;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
padding: 45px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
li a.active {
|
||||
background-color: #7989E8;
|
||||
color: white;
|
||||
}
|
||||
|
||||
li a:hover:not(.active) {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
/* 表格样式 */
|
||||
.biaoge {
|
||||
width:100%;
|
||||
margin:0;
|
||||
border:0;
|
||||
color:black;
|
||||
|
||||
background-color:#EEEEEE;
|
||||
}
|
||||
.biaoge,.biaoge th,.biaoge td {
|
||||
font-size:26px;
|
||||
text-align:center;
|
||||
padding:4px;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
.biaoge th,.biaoge td {
|
||||
border-width:1px 0 1px 0;
|
||||
border:1px inset #D8D8D8;
|
||||
}
|
||||
.biaoge tr {
|
||||
border: 1px solid #D8D8D8;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.sign-box {
|
||||
position: fixed;
|
||||
top: 40%;
|
||||
left: 45%;
|
||||
width: 400px;
|
||||
height: 320px;
|
||||
z-index: 101;
|
||||
background-color: ghostwhite;
|
||||
border: 2px solid rgb(0, 0, 0);
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.sign-box input {
|
||||
width: 300px;
|
||||
height: 35px;
|
||||
font-size: 17px;
|
||||
background: transparent;
|
||||
text-indent: 8px;
|
||||
border: none;
|
||||
border-bottom: 1px solid black;
|
||||
margin: 15px;
|
||||
outline: none;
|
||||
color: black;
|
||||
}
|
||||
.shangchuang{
|
||||
font-size: 15px;
|
||||
width: 130px;
|
||||
height: 45px;
|
||||
margin: 5px auto 5px 5px;
|
||||
border: none;
|
||||
background-color: #d5e4f6;
|
||||
color: #71c9eb;
|
||||
border-radius: 8px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: .5s;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
var count=ref(0);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="biaoti">随机点名系统</div>
|
||||
<ul>
|
||||
<li><a href="/first/">点名提问</a></li>
|
||||
<li><a href="/second/">学生名单</a></li>
|
||||
<li><a href="/third/">积分排名</a></li>
|
||||
<li><a href="#" class="active">账号设置</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- 学生积分排名 -->
|
||||
<div style="margin-left:15%;height:auto;padding: 120px 0 0 0;">
|
||||
<div style="text-align: end;">
|
||||
<form action="/zhuxiao/" id="zhuxiao" method="post">
|
||||
<button class="shangchuang" type="submit" style="color: red;" >账户注销</button>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('zhuxiao').addEventListener('submit', function(event) {
|
||||
// 阻止表单提交行为
|
||||
event.preventDefault();
|
||||
// 弹出确认对话框
|
||||
if (confirm('您确定要注销吗?')) {
|
||||
this.submit();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="sign-box">
|
||||
<form action="/xiugai/" method="post" id="myform">
|
||||
<div style="padding: 30px;font-size: 20px;">修改用户名和密码</div>
|
||||
<div style="padding: 10px;">
|
||||
<span>当前用户名:{{name}}</span>
|
||||
<input type="text" placeholder="修改用户名" name="username">
|
||||
</div>
|
||||
<input type="password" placeholder="修改密码" name="password">
|
||||
<div style="padding: 10px;">
|
||||
<button class="shangchuang" type="submit" >修改提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('myform').addEventListener('submit', function(event) {
|
||||
// 阻止表单提交行为
|
||||
event.preventDefault();
|
||||
// 弹出确认对话框
|
||||
if (confirm('您确定要修改吗?')) {
|
||||
this.submit();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登陆界面</title>
|
||||
<link rel="stylesheet" href="../static/login.css">
|
||||
</head>
|
||||
|
||||
<body class="container2">
|
||||
<!-- 按钮模块 -->
|
||||
<input type="checkbox" id="a12" hidden>
|
||||
<i class="indicator"></i>
|
||||
<label class="c2" for="a12"></label>
|
||||
<!-- 日月交替模块 -->
|
||||
<div id="container" class="dark">
|
||||
<div class="bg"></div>
|
||||
<div class="moon-box">
|
||||
<div class="moon"></div>
|
||||
</div>
|
||||
<div class="sun-box">
|
||||
<div class="sun"></div>
|
||||
</div>
|
||||
<div class="sea"></div>
|
||||
</div>
|
||||
<!-- 登录模块 -->
|
||||
<form action="/login/" method="post">
|
||||
<div class="form-box">
|
||||
<div class="tit">login</div>
|
||||
<input type="text" placeholder="账号" name="username">
|
||||
<input type="password" placeholder="密码" name="password">
|
||||
<button>登录</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 注册模块 -->
|
||||
<div class="sign">
|
||||
|
||||
<input type="checkbox" id="search_btn" hidden>
|
||||
<label class="search-btn" for="search_btn">
|
||||
<i class="search" aria-hidden="true">点我注册</i>
|
||||
</label>
|
||||
|
||||
<label class="close-btn" for="search_btn">
|
||||
<i class="close" aria-hidden="true">登录</i>
|
||||
</label>
|
||||
|
||||
<div class="container3">
|
||||
<h2 class="signin" ><span>sign in</span></h2>
|
||||
|
||||
<form action="/register/" method="post">
|
||||
<div class="search-box s1 s2">
|
||||
<input type="password" placeholder="请输入密码" name="password">
|
||||
</div>
|
||||
<div class="search-box s1 s3">
|
||||
<input type="text" placeholder="请输入用户名" name="username">
|
||||
<button class="sign-btn" type="submit">注册</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="shade"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>随机点名系统</title>
|
||||
<style>
|
||||
.biaoti {
|
||||
font-size: 30px;/* 文字大小 */
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
background-color: #163874;
|
||||
color: white;
|
||||
width: 100%;
|
||||
padding: 45px 0 45px 16px;/* 边框宽度 */
|
||||
height: 120px;
|
||||
box-sizing: border-box
|
||||
|
||||
}
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 120px 0 0 0;
|
||||
border: 0px;
|
||||
padding: 0;
|
||||
width: 15%;
|
||||
background-color: #163874;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
li a {
|
||||
display: block;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
padding: 45px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
li a.active {
|
||||
background-color: #7989E8;
|
||||
color: white;
|
||||
}
|
||||
|
||||
li a:hover:not(.active) {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.biaoge {
|
||||
width:100%;
|
||||
margin:0;
|
||||
border:0;
|
||||
color:black;
|
||||
|
||||
background-color:#EEEEEE;
|
||||
}
|
||||
.biaoge,.biaoge th,.biaoge td {
|
||||
font-size:26px;
|
||||
text-align:center;
|
||||
padding:4px;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
.biaoge th,.biaoge td {
|
||||
border-width:1px 0 1px 0;
|
||||
border:1px inset #D8D8D8;
|
||||
}
|
||||
.biaoge tr {
|
||||
border: 1px solid #D8D8D8;
|
||||
height: 20px;
|
||||
}
|
||||
.shangchuang{
|
||||
font-size: 15px;
|
||||
width: 130px;
|
||||
height: 45px;
|
||||
margin: 5px auto 5px 5px;
|
||||
border: none;
|
||||
background-color: #d5e4f6;
|
||||
color: #71c9eb;
|
||||
border-radius: 8px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: .5s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="biaoti">随机点名系统</div>
|
||||
<ul>
|
||||
<li><a href="/first/">点名提问</a></li>
|
||||
<li><a class="active" href="#news">学生名单</a></li>
|
||||
<li><a href="/third/">积分排名</a></li>
|
||||
<li><a href="/fourth/">账号设置</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- 上传Excel文件 -->
|
||||
<div style="margin-left:15%;padding:120px 0 0 0;height:auto;">
|
||||
<div style="display: flex ;">
|
||||
<form action="/upload_excel/" method="get">
|
||||
<button class="shangchuang">上传名单</button>
|
||||
</form>
|
||||
<form action="/delete_excel/" method="get" id="delete">
|
||||
<button class="shangchuang" >删除名单</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('delete').addEventListener('submit', function(event) {
|
||||
// 阻止表单提交行为
|
||||
event.preventDefault();
|
||||
// 弹出确认对话框
|
||||
if (confirm('您确定要删除吗?')) {
|
||||
this.submit();
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- 学生名单表格 -->
|
||||
<div style="margin-left:15%;height:auto;">
|
||||
<table class="biaoge">
|
||||
<tr>
|
||||
<th>学号</th><th>姓名</th><th>专业</th> <th>班级</th>
|
||||
</tr>
|
||||
{% for row in form %}
|
||||
<tr>
|
||||
<td>{{ row.student_xuehao }}</td>
|
||||
<td>{{ row.student_name }}</td>
|
||||
<td>{{ row.student_major }}</td>
|
||||
<td>{{ row.student_class }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,110 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>随机点名系统</title>
|
||||
<style>
|
||||
.biaoti {
|
||||
font-size: 30px;/* 文字大小 */
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
background-color: #163874;
|
||||
color: white;
|
||||
width: 100%;
|
||||
padding: 45px 0 45px 16px;/* 边框宽度 */
|
||||
height: 120px;
|
||||
box-sizing: border-box
|
||||
|
||||
}
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 120px 0 0 0;
|
||||
border: 0px;
|
||||
padding: 0;
|
||||
width: 15%;
|
||||
background-color: #163874;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
li a {
|
||||
display: block;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
padding: 45px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
li a.active {
|
||||
background-color: #7989E8;
|
||||
color: white;
|
||||
}
|
||||
|
||||
li a:hover:not(.active) {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
/* 表格样式 */
|
||||
.biaoge {
|
||||
width:100%;
|
||||
margin:0;
|
||||
border:0;
|
||||
color:black;
|
||||
|
||||
background-color:#EEEEEE;
|
||||
}
|
||||
.biaoge,.biaoge th,.biaoge td {
|
||||
font-size:26px;
|
||||
text-align:center;
|
||||
padding:4px;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
.biaoge th,.biaoge td {
|
||||
border-width:1px 0 1px 0;
|
||||
border:1px inset #D8D8D8;
|
||||
}
|
||||
.biaoge tr {
|
||||
border: 1px solid #D8D8D8;
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var count=ref(0);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="biaoti">随机点名系统</div>
|
||||
<ul>
|
||||
<li><a href="/first/">点名提问</a></li>
|
||||
<li><a href="/second/">学生名单</a></li>
|
||||
<li><a class="active" href="#contact">积分排名</a></li>
|
||||
<li><a href="/fourth/">账号设置</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- 学生积分排名 -->
|
||||
<div style="margin-left:15%;height:auto;padding: 120px 0 0 0;">
|
||||
<table class="biaoge">
|
||||
<tr>
|
||||
<th>排名</th><th>学号</th><th>姓名</th><th>积分</th>
|
||||
</tr>
|
||||
{% for row in form %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ row.student_xuehao }}</td>
|
||||
<td>{{ row.student_name }}</td>
|
||||
<td>{{ row.student_score }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class UserConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'user'
|
@ -0,0 +1,35 @@
|
||||
# Generated by Django 5.1.1 on 2024-09-30 11:58
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='user',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('username', models.CharField(max_length=200, unique=True)),
|
||||
('password', models.CharField(max_length=200)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='student',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('student_xuehao', models.IntegerField(default=0)),
|
||||
('student_name', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('student_major', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('student_class', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('student_score', models.IntegerField(default=0)),
|
||||
('teather', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.user')),
|
||||
],
|
||||
),
|
||||
]
|
@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.1 on 2024-10-01 13:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('user', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='student',
|
||||
name='student_score',
|
||||
field=models.FloatField(default=0),
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
#用户表
|
||||
class user(models.Model):
|
||||
username = models.CharField(max_length=200,unique=True)
|
||||
password = models.CharField(max_length=200)
|
||||
|
||||
#学生表
|
||||
class student(models.Model):
|
||||
student_xuehao=models.IntegerField(default=0)
|
||||
student_name = models.CharField(max_length=200,null=True, blank=True)
|
||||
student_major = models.CharField(max_length=200,null=True, blank=True)
|
||||
student_class = models.CharField(max_length=200,null=True, blank=True)
|
||||
student_score = models.FloatField(default=0)
|
||||
teather=models.ForeignKey(to='user',to_field='id',on_delete=models.CASCADE)
|
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
@ -0,0 +1,19 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
urlpatterns = [
|
||||
path('', views.loginpage),
|
||||
|
||||
path('first/', views.firstpage,name='first'),#随机点名界面
|
||||
path('second/',views.secondpage,name='second'),#学生名单
|
||||
path('third/',views.thirdpage,name='third'),#积分排名
|
||||
path('login/', views.Loginadmit,name='login'),#登录验证
|
||||
path('register/', views.Register,name='register'),#注册
|
||||
path('upload_excel/', views.upload_excel, name='upload_excel'),#上传文件页面
|
||||
path('upload_file/', views.upload_file, name='upload_file'),#上传execl文件
|
||||
path('delete_excel/',views.delete_excel,name='delete_excel'),#删除学生名单
|
||||
path('dianming/',views.dianming,name='dianming'),#随机点名和特殊规则
|
||||
path('submitscore/',views.submitscore,name='submitscore'),#提交积分
|
||||
path('fourth/',views.fourthpage,name='fourth'),#用户信息
|
||||
path('xiugai/',views.xiugai,name='xiugai'),#账号和密码修改
|
||||
path('zhuxiao/',views.zhuxiao,name='zhuxiao'),#账户注销
|
||||
]
|
Loading…
Reference in new issue