-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolite.html
More file actions
72 lines (63 loc) · 2.11 KB
/
polite.html
File metadata and controls
72 lines (63 loc) · 2.11 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!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;
display: flex;
flex-direction: column;
align-items: center;
}
button {
margin: 10px;
display: inline-block;
}
</style>
</head>
<body>
<h3 id="question-number">第1题</h3>
<p id="question">这里是题目内容</p>
<div>
<button id="prev" onclick="previousQuestion()" disabled>前一题</button>
<button id="next" onclick="nextQuestion()">后一题</button>
</div>
<button id="submit" onclick="submitAnswers()" style="display: none;">交卷</button>
<script>
let currentQuestion = 0;
const totalQuestions = 30;
function updateQuestionNumber() {
document.getElementById('question-number').innerText = `第${currentQuestion + 1}题`;
if (currentQuestion === 0) {
document.getElementById('prev').disabled = true;
} else {
document.getElementById('prev').disabled = false;
}
if (currentQuestion === totalQuestions - 1) {
document.getElementById('next').style.display = 'none';
document.getElementById('submit').style.display = 'block';
} else {
document.getElementById('next').style.display = 'inline-block';
document.getElementById('submit').style.display = 'none';
}
}
function previousQuestion() {
if (currentQuestion > 0) {
currentQuestion--;
updateQuestionNumber();
}
}
function nextQuestion() {
if (currentQuestion < totalQuestions - 1) {
currentQuestion++;
updateQuestionNumber();
}
}
function submitAnswers() {
// 在此处处理答案提交和评分逻辑
}
</script>
</body>
</html>