chore: move dir

This commit is contained in:
2024-06-05 11:36:16 +08:00
parent 03212f21b4
commit 769305eb3d
450 changed files with 0 additions and 0 deletions
+113
View File
@@ -0,0 +1,113 @@
{% load static %}
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
<script src="{% static 'js/vue.js' %}"></script>
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<style>
{% block css %}
.navbar {
justify-content: space-between;
border-radius: 0;
}
.mb-3 {
width: 50%;
}
{% endblock %}
</style>
<body style="overflow:hidden">
<div id="app" style="width: 100%;height: 90%">
<nav class="navbar navbar-expand-lg bg-body-tertiary" style="height: 100px">
<a class="navbar-brand" style="font-size: 36px">Python课程作业自动批改系统</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText"
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
</div>
{% if username == None %}
<button @click="openLogin()" class="btn btn-success">登录</button>
<button @click="register()" id="register" class="btn btn-light">注册</button>
{% elif username != None %}
<button @click="logout()" id="logout" class="btn btn-light">退出</button>
{% endif %}
</nav>
<el-row class="tac" style="height: 1400px">
<el-col :span="3" style="height: 100%">
<el-menu
default-active="/upload/"
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
style="height: 100%"
@select="handleSelect"
>
<el-menu-item index="/upload/" style="height: 100px">
<i class="el-icon-menu"></i>
<span slot="title" style="font-size: 24px">在线批改</span>
</el-menu-item>
{% if profession != '0' and profession %}
<el-menu-item index="/score/" style="height: 100px">
<i class="el-icon-menu"></i>
<span slot="title" style="font-size: 24px">成绩统计</span>
</el-menu-item>
{% endif %}
<el-menu-item index="/user_page/" style="height: 100px">
<i class="el-icon-menu"></i>
<span slot="title" style="font-size: 24px">个人主页</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="21" style="height: 100%">
<div style="height: 60px"></div>
<iframe id="mainiframe" name="mainiframe" width="100%" height="95%"
src="{% url 'mainProject:upload' %}" ></iframe>
</el-col>
</el-row>
</div>
</body>
<script type="text/javascript">
new Vue({
el: "#app",
data() {
return {
}
},
methods: {
openLogin() {
location.href = {% url 'mainProject:login_page' %}
},
logout(){
location.href = '/logout'
},
register(){
location.href = '/register_page'
},
handleSelect(key, keyPath) {
if (key === '/upload/') {
$('#mainiframe').attr('src', {% url 'mainProject:upload' %})
} else if(key === '/score/') {
$('#mainiframe').attr('src', {% url 'mainProject:static_page' %})
}else{
$('#mainiframe').attr('src', {% url 'mainProject:user_page' %})
}
}
}
})
</script>
</html>
+139
View File
@@ -0,0 +1,139 @@
{% load static %}
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
<script src="{% static 'js/vue.js' %}"></script>
<link rel="stylesheet" href="{% static 'css/elementui.css' %}">
<script src="{% static 'js/elementui.js' %}"></script>
</head>
<style>
* {
padding: 0;
margin: 0;
}
body {
background: rgb(135, 206, 235);
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
#admin {
position: absolute;
top: 50%;
left: 50%;
margin-top: -200px;
margin-left: -250px;
width: 500px;
height: 400px;
background: #fff;
border-radius: 10%;
box-shadow: 8px 10px 10px rgb(177, 223, 242);
}
.adminh1 {
margin: 20px 0;
text-shadow: 10px 13px 3px rgb(207, 207, 207);
text-align: center;
}
.pos {
width: 450px;
height: 350px;
position: absolute;
top: 25px;
left: 25px;
}
</style>
<body>
<div id="app" style="width: 100%;height: 90%">
<div id="admin">
<div class="pos" v-loading="loading">
<h1 class="adminh1">用户登录</h1>
<form method="post" action="/login_x/">
{% csrf_token %}
<div>
<label for="exampleInputEmail1" class="form-label">账号</label>
<input type="email" class="form-control" name="username" aria-describedby="emailHelp">
</div>
<div >
<label for="exampleInputPassword1" class="form-label">密码</label>
<input type="password" class="form-control" name="password">
</div>
<div class="form-group" style="height: 10px"></div>
<button type="submit" class="btn btn-success" style="margin-left: 200px" >登录</button>
</form>
</div>
</div>
</div>
</body>
<script type="text/javascript">
new Vue({
el: "#app",
data() {
var validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入用户信息"));
} else {
if (this.ruleForm.passWord !== "") {
this.$refs.ruleForm.validateField("passWord");
}
callback();
}
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else if (value.length < 8 || value.length > 13) {
callback(new Error("长度必须在8-12之内!"));
} else {
callback();
}
};
return {
loading: false,
ruleForm: {
username: "",
passWord: "",
},
rules: {
username: [{validator: validatePass, trigger: "blur"}],
passWord: [{validator: validatePass2, trigger: "blur"}],
},
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true;
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
}
})
</script>
</html>
+146
View File
@@ -0,0 +1,146 @@
{% load static %}
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
<script src="{% static 'js/vue.js' %}"></script>
<link rel="stylesheet" href="{% static 'css/elementui.css' %}">
<script src="{% static 'js/elementui.js' %}"></script>
</head>
<style>
* {
padding: 0;
margin: 0;
}
body {
background: rgb(135, 206, 235);
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
#admin {
position: absolute;
top: 50%;
left: 50%;
margin-top: -200px;
margin-left: -250px;
width: 500px;
height: 400px;
background: #fff;
border-radius: 10%;
box-shadow: 8px 10px 10px rgb(177, 223, 242);
}
.adminh1 {
margin: 20px 0;
text-shadow: 10px 13px 3px rgb(207, 207, 207);
text-align: center;
}
.pos {
width: 450px;
height: 350px;
position: absolute;
top: 25px;
left: 25px;
}
</style>
<body>
<div id="app" style="width: 100%;height: 90%">
<div id="admin">
<div class="pos" v-loading="loading">
<h1 class="adminh1">注册</h1>
<form method="post" action="/register/" style="width: 100%">
{% csrf_token %}
<div>
<label for="exampleInputEmail1" class="form-label">账号</label>
<input type="email" class="form-control" name="username" aria-describedby="emailHelp">
</div>
<div >
<label for="exampleInputPassword1" class="form-label">密码</label>
<input type="password" class="form-control" name="password">
</div>
<p>所属职业: <select class="custom-select" name="select" style="width: 100%">
<option value="0">学生</option>
<option value="1">老师</option>
</select></p>
<div class="form-group"></div>
<button type="submit " class="btn btn-success" style="width: 100%">注册</button>
</form>
</div>
</div>
</div>
</body>
<script type="text/javascript">
new Vue({
el: "#app",
data() {
var validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入用户信息"));
} else {
if (this.ruleForm.passWord !== "") {
this.$refs.ruleForm.validateField("passWord");
}
callback();
}
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else if (value.length < 8 || value.length > 13) {
callback(new Error("长度必须在8-12之内!"));
} else {
callback();
}
};
return {
loading: false,
ruleForm: {
username: "",
passWord: "",
},
rules: {
username: [{validator: validatePass, trigger: "blur"}],
passWord: [{validator: validatePass2, trigger: "blur"}],
},
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true;
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
}
})
</script>
</html>
+109
View File
@@ -0,0 +1,109 @@
{% load static %}
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>成绩统计</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
</head>
<style>
.navbar {
justify-content: space-between;
border-radius: 0;
}
</style>
<body>
<div class="card container" style="width: 100%;">
<div class="card-body">
<div style="width: 50%; float: left; overflow: hidden">
<h1>各分段人数分布</h1>
<div id="x" class="center-block" style="height: 500px;width: 100%;display: inline-block;">
</div>
</div>
<div style="width: 50%; float: left; overflow: hidden">
<h1>错题人数分布</h1>
<div id="a" style="height: 500px;width: 100%;display: inline-block;">
</div>
</div>
</div>
</div>
</body>
<script>
const chartDom = document.getElementById('x');
const myChart = echarts.init(chartDom);
let option;
option = {
xAxis: {
type: 'category',
data: [
'0-10',
'11-20',
'21-30',
'31-40',
'41-50',
'51-60',
'60-70',
'70-80',
'80-90',
'90-100'
],
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
}
},
yAxis: {
type: 'value'
},
series: [
{
data: {{ scores|safe }},
type: 'bar'
}
]
};
option && myChart.setOption(option);
const dom = document.getElementById('a');
const c = echarts.init(dom);
let op;
op = {
xAxis: {
type: 'category',
data: {{ all_type|safe }},
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
}
},
yAxis: {
type: 'value'
},
series: [
{
data: {{ number|safe }},
type: 'bar'
}
]
};
op && c.setOption(op);
$('#logout').click(function () {
location.href = '/logout'
})
</script>
</html>
+94
View File
@@ -0,0 +1,94 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/vue.js' %}"></script>
{# <link rel="stylesheet" href="{% static 'css/elementui.css' %}">#}
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<style>
html, body {
width: 80%;
height: 100%;
overflow: hidden;
margin: auto;
}
</style>
</head>
<body>
<div id="app">
<el-card class="box-card">
<div slot="header" class="clearfix">
欢迎您,{% if username == None %} 游客 {% else %} {{ username }} {% endif %},当前已批阅文件:
</div>
<el-table
:data="[tableData]"
border>
<el-table-column
prop="id"
label="文件编号"
width="auto">
</el-table-column>
<el-table-column
prop="title"
label="作业名"
width="auto">
</el-table-column>
<el-table-column
prop="score"
label="分数"
width="auto">
</el-table-column>
<el-table-column
label="操作"
width="auto">
<template slot-scope="scope">
<el-button @click="check(scope.row)" type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
<div style="height: 14px"></div>
<div class="mb-3" style="margin-left: 450px">
<form enctype="multipart/form-data" method="post"
action="{% url 'mainProject:word_upload' %}">
{% csrf_token %}
<div class="form-group" style="margin-left: 70px">
<div class="form-group">
<input type="file" id="exampleInputFile" name="words" multiple>
</div>
<p class="help-block">支持多文件上传(仅老师)</p>
</div>
<button type="submit" class="btn btn-success" style="width: 50%">提交</button>
</form>
</div>
</el-card>
</div>
</body>
<script type="text/javascript">
new Vue({
el: "#app",
methods: {
check(row) {
location.href = "{% url 'mainProject:download' %}?id= "+row.id
},
mounted(){
}
},
data() {
return {
tableData:{{ word_list|safe }}
}
}
})
</script>
</html>
+104
View File
@@ -0,0 +1,104 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
<script src="{% static 'js/vue.js' %}"></script>
{# <script src="{% static 'js/elementui.js' %}"></script>#}
{# <link rel="stylesheet" href="{% static 'js/lib-master/theme-chalk/index.css' %}">#}
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<title>123</title>
</head>
<body>
<div id="app">
<el-card class="box-card" style="width: 80%;margin: auto">
<el-descriptions class="margin-top" title="个人信息" :column="2" border>
<template slot="extra">
<el-button @click="change()" type="primary" size="small">更改密码</el-button>
</template>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
用户名
</template>
{{ username }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
<el-tag size="small" v-if="profession==1">
老师
</el-tag>
<el-tag size="small" v-if="profession!=1">
学生
</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
当前已提交文件:
</template>
{{ number }}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-dialog title="更改密码" :visible.sync="dialogFormVisible" style="width: 50%;margin: auto">
<el-form :model="form">
<el-form-item label="密码">
<el-input v-model="form.password" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button id="submit" type="primary" @click="changePassword()">确 定</el-button>
</div>
</el-dialog>
</div>
</body>
<script>
new Vue({
el: "#app",
methods: {
change() {
this.dialogFormVisible = true
},
changePassword() {
this.dialogFormVisible = false
const form = this.form;
$.ajax({
type: 'POST',
url: '/change/',
data: form, // 将表单数据序列化为字符串
success: function (data) {
if (data.result === 1) {
this.$message({
message: '修改密码成功!',
type: 'success'
});
}
}
});
}
},
data() {
return {
profession: {{ profession|safe }},
dialogFormVisible: false,
form: {}
}
},
})
</script>
</html>