answer/templates/index.html

110 lines
3.0 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>答题系统</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 0;
color: #333;
}
.container {
width: 100%;
max-width: 700px;
margin: 50px auto;
padding: 30px;
background-color: #fff;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
h1 {
text-align: center;
color: #4CAF50;
}
h2 {
color: #333;
margin-bottom: 20px;
}
form {
margin-top: 20px;
}
.question-box {
background-color: #f9f9f9;
padding: 15px;
margin-bottom: 15px;
border-radius: 8px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.question-box label {
font-weight: bold;
font-size: 16px;
}
.question-box input {
width: 100%;
padding: 10px;
margin-top: 5px;
border-radius: 5px;
border: 1px solid #ddd;
font-size: 16px;
}
.question-box input:focus {
border-color: #4CAF50;
outline: none;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
padding: 15px 20px;
width: 100%;
font-size: 18px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #45a049;
}
a {
display: inline-block;
text-align: center;
font-size: 16px;
color: #4CAF50;
margin-top: 20px;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>欢迎来到答题系统</h1>
<form action="{{ url_for('submit_answer') }}" method="post">
<h2>请回答以下问题:</h2>
{% for question in question_list %}
<div class="question-box">
<label for="answer{{ loop.index }}">问题{{ loop.index }}: {{ question['问题'] }}</label><br>
<input type="text" id="answer{{ loop.index }}" name="answer{{ loop.index }}" required><br><br>
</div>
{% endfor %}
<input type="submit" value="提交答案">
</form>
<div style="margin-top: 20px;">
<a href="{{ url_for('ranking') }}">查看排行榜</a> |
<a href="{{ url_for('logout') }}">注销</a>
</div>
</div>
</body>
</html>