-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspeaking-structure-quiz.html
More file actions
198 lines (178 loc) · 7.78 KB
/
speaking-structure-quiz.html
File metadata and controls
198 lines (178 loc) · 7.78 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Speaking - Structure Quiz</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/quiz.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" href="img/favicon.png" type="image/x-icon">
<!-- 1. Tích hợp CSS của Driver.js -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/driver.css"/>
<style>
/* CSS cho nút Help/Tour */
.tour-btn {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #fff;
border: 1px solid #ddd;
color: #333;
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
z-index: 999;
font-size: 24px;
transition: transform 0.2s, background-color 0.2s;
}
.tour-btn:hover {
transform: scale(1.1);
background-color: #f8f9fa;
}
/* Tùy chỉnh giao diện Driver.js */
.driver-popover.driverjs-theme {
background-color: #fff;
color: #333;
border-radius: 8px;
padding: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
max-width: 350px;
}
.driver-popover.driverjs-theme .driver-popover-title {
font-size: 18px;
font-weight: 700;
margin-bottom: 8px;
color: var(--primary-blue, #007bff);
}
.driver-popover.driverjs-theme .driver-popover-description {
font-size: 14px;
line-height: 1.6;
color: #555;
}
.driver-popover.driverjs-theme button {
background-color: var(--primary-blue, #007bff);
color: #fff;
text-shadow: none;
border: none;
border-radius: 4px;
padding: 6px 12px;
}
</style>
</head>
<body>
<header id="header-placeholder"></header>
<!-- 2. Nút kích hoạt lại Tour -->
<div class="tour-btn" id="restart-tour" title="Hướng dẫn sử dụng">❓</div>
<div class="content-pusher">
<div class="container">
<div class="page-intro">
<h1>Speaking - Prepare to Test (Mini Quiz)</h1>
<p>Kiểm tra khả năng ghi nhớ các sườn bài, công thức và mẹo cho bài thi Speaking.</p>
</div>
<div class="explanation-box">
<h3>💡 Phương pháp làm bài</h3>
<p>Dựa vào các cẩm nang Speaking bạn đã học, hãy chọn đáp án đúng nhất. Mục tiêu là giúp bạn ghi nhớ và
sử dụng thành thạo các cấu trúc câu này trong bài thi thật.</p>
</div>
<main id="quiz-container">
<!-- Các câu hỏi trắc nghiệm sẽ được JS chèn vào đây -->
</main>
<div class="card-actions" style="justify-content: center; margin-top: 20px;">
<button class="action-btn check-answer-btn" id="check-answers-btn">Kiểm tra đáp án</button>
</div>
<div id="result-message" class="feedback-message" style="text-align: center; margin-top: 20px;"></div>
</div>
<footer id="footer-placeholder"></footer>
</div>
<!-- Scripts -->
<script src="js/data-speaking-quiz.js"></script>
<script src="js/main.js"></script>
<script src="js/speaking-quiz-logic.js"></script>
<!-- 3. Tích hợp Script của Driver.js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/driver.js.iife.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
// --- KÍCH HOẠT TOUR HƯỚNG DẪN ---
// Gọi sau khi render xong để đảm bảo các element đã tồn tại
// Thời gian delay cần đủ lâu để speaking-quiz-logic.js render xong câu hỏi
setTimeout(initSpeakingQuizTour, 1000);
// Gán sự kiện cho nút ?
document.getElementById('restart-tour').addEventListener('click', () => {
initSpeakingQuizTour(); // Gọi hàm khởi tạo tour
});
});
// HÀM KHỞI TẠO TOUR
function initSpeakingQuizTour() {
const driver = window.driver.js.driver;
const driverObj = driver({
showProgress: true,
animate: true,
doneBtnText: 'Đã hiểu',
nextBtnText: 'Tiếp theo',
prevBtnText: 'Quay lại',
popoverClass: 'driverjs-theme',
steps: [
{
element: '.page-intro',
popover: {
title: 'Speaking Quiz',
description: 'Chào mừng bạn! Đây là bài kiểm tra nhanh để ôn lại các kiến thức lý thuyết về Speaking (sườn bài, từ nối, mẹo...).',
side: "bottom",
align: 'center'
}
},
{
element: '.explanation-box',
popover: {
title: 'Mục tiêu',
description: 'Mục tiêu là giúp bạn khắc sâu các công thức (như 5W1H, PEEL, 20-20-5) để phản xạ nhanh hơn khi thi thật.',
side: "bottom",
align: 'center'
}
},
{
element: '#quiz-container .quiz-card:first-child',
popover: {
title: 'Câu hỏi',
description: 'Các câu hỏi trắc nghiệm sẽ xoay quanh 4 phần thi Speaking. Hãy đọc kỹ và chọn đáp án đúng nhất.',
side: "top",
align: 'center'
}
},
{
element: '#check-answers-btn',
popover: {
title: 'Kiểm tra',
description: 'Sau khi hoàn thành, bấm nút này để xem kết quả và giải thích chi tiết cho từng câu.',
side: "top",
align: 'center'
}
},
{
element: '#restart-tour',
popover: {
title: 'Hỗ trợ',
description: 'Bấm vào đây bất cứ lúc nào để xem lại hướng dẫn.',
side: "left",
align: 'center'
}
}
]
});
// Logic tự động chạy lần đầu
showTourHint('hasSeenSpeakingQuizTour', () => driverObj.drive()); else {
// Nếu gọi thủ công từ nút ?, chạy luôn
driverObj.drive();
}
}
</script>
</body>
</html>