-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautouploaderror.py
39 lines (38 loc) · 2.2 KB
/
autouploaderror.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
from mainpath import mainpath
def create_upload_error(student_id):
final_html = f"""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<link rel="icon" href="https://cdn-icons-png.flaticon.com/512/328/328201.png" type="image/x-icon"/>
<title>MESSAGE</title>
<style type="text/css">
html{{ width: 100%; height: 100%; overflow: hidden; font-style: sans-serif; }}
body{{width: 100%;height: 100%;font-family: 'Open Sans',sans-serif;margin: 0; background-color: #37464a; background:url("/img/upload_background.png");background-size: cover;background-attachment: fixed;background-position: center;}}
#login{{position: fixed;top: 50%;left:50%;transform: translate(-50%,-50%);background:#2329358e;text-align: center;border-radius: 40px;padding: 30px;}}
#login h1{{ color: #fff; text-shadow:0 0 10px; letter-spacing: 5px; text-align: center;}}
#login h2{{ color: #fff; letter-spacing: 5px; text-align: center;}}
.but{{width: 310px;min-height: 20px;display: block;background-color: #07070785;border: 2px solid #bccdf3;color: #fff;padding: 12px 20px;font-size: 16px;line-height: normal;border-radius: 10px;cursor: pointer; font-family: consolas;}}
.but:hover {{background-color: #fcfcfc85;color: rgb(2, 0, 0);}}
</style>
</head>
<body>
<div id="login">
<h1>{{{{ message }}}}</h1>
<h2>{{{{ Score }}}}</h2>
<h2>{{{{ Time }}}}</h2>
<h2>{{{{ Memory }}}}</h2>
<form action="/checkMistake/{student_id}">
<button class="but">❌ 查看錯誤的題目 ❌</button><br/>
</form>
</div>
</body>
</html>
"""
final_html = final_html.replace("'", "\"")
os.chdir(mainpath)
with open(f"templates/uploaderror.html", "w", encoding="utf-8") as file:
file.write(final_html)
os.chdir(mainpath)