Update index.html
Browse files- index.html +146 -22
index.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8" />
|
5 |
-
<title>
|
6 |
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
7 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap" rel="stylesheet">
|
8 |
<style>
|
@@ -107,7 +107,7 @@
|
|
107 |
</style>
|
108 |
</head>
|
109 |
<body>
|
110 |
-
<h1>
|
111 |
|
112 |
<div id="game-container">
|
113 |
<div class="progress-container">
|
@@ -132,44 +132,168 @@
|
|
132 |
|
133 |
<script>
|
134 |
let statements = [
|
135 |
-
{
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
];
|
141 |
|
142 |
let currentIndex = 0;
|
143 |
let score = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
-
function shuffleArray(array) { return array.sort(() => Math.random() - 0.5); }
|
146 |
function loadStatement() {
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
148 |
document.getElementById("result").style.display = "none";
|
149 |
document.getElementById("explanation").style.display = "none";
|
150 |
document.getElementById("next-btn").style.display = "none";
|
|
|
151 |
updateProgressBar();
|
152 |
-
updateScore();
|
153 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
function checkAnswer(userGuess) {
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
document.getElementById("result").style.display = "block";
|
159 |
-
|
|
|
160 |
document.getElementById("explanation").style.display = "block";
|
161 |
-
|
162 |
document.getElementById("next-btn").style.display = "inline-block";
|
|
|
163 |
updateScore();
|
164 |
}
|
165 |
-
function nextStatement() { currentIndex++; currentIndex < statements.length ? loadStatement() : endGame(); }
|
166 |
-
function updateScore() { document.getElementById("score").innerText = `Score: ${score}/${statements.length}`; }
|
167 |
-
function updateProgressBar() { document.getElementById("progress-bar").style.width = `${(currentIndex/statements.length)*100}%`; }
|
168 |
-
function endGame() { document.getElementById("statement").innerText = `Game Over! Final Score: ${score}/${statements.length}`; }
|
169 |
-
function restartGame() { currentIndex = 0; score = 0; shuffleArray(statements); loadStatement(); }
|
170 |
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
</script>
|
174 |
</body>
|
175 |
</html>
|
|
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8" />
|
5 |
+
<title>Fact or Faction AI</title>
|
6 |
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
7 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap" rel="stylesheet">
|
8 |
<style>
|
|
|
107 |
</style>
|
108 |
</head>
|
109 |
<body>
|
110 |
+
<h1>Fact or Faction AI</h1>
|
111 |
|
112 |
<div id="game-container">
|
113 |
<div class="progress-container">
|
|
|
132 |
|
133 |
<script>
|
134 |
let statements = [
|
135 |
+
{
|
136 |
+
text: "Small-scale AI projects typically involve highly complex models requiring significant compute power.",
|
137 |
+
isFact: false,
|
138 |
+
explanation: "Fiction! Small-scale AI usually employs simpler models and less compute, which is often more manageable and cost-effective."
|
139 |
+
},
|
140 |
+
{
|
141 |
+
text: "Large-scale AI projects often deal with multiple diverse data sources, leading to integration challenges.",
|
142 |
+
isFact: true,
|
143 |
+
explanation: "Fact! More extensive AI implementations typically involve numerous data sources that need careful integration."
|
144 |
+
},
|
145 |
+
{
|
146 |
+
text: "Small-scale AI projects frequently face scalability challenges with distributed and high-compute systems.",
|
147 |
+
isFact: false,
|
148 |
+
explanation: "Fiction! These challenges are usually associated with larger AI implementations that process massive datasets."
|
149 |
+
},
|
150 |
+
{
|
151 |
+
text: "Frequent deployments and model versioning complexity are more common in large-scale AI implementations.",
|
152 |
+
isFact: true,
|
153 |
+
explanation: "Fact! Large-scale AI systems often need to handle frequent updates and complex version management."
|
154 |
+
},
|
155 |
+
{
|
156 |
+
text: "Cost management for small-scale AI projects is usually predictable with relatively low costs.",
|
157 |
+
isFact: true,
|
158 |
+
explanation: "Fact! Smaller AI initiatives typically have limited scope and more predictable budgeting."
|
159 |
+
},
|
160 |
+
{
|
161 |
+
text: "Monitoring drift, bias, and system failures is typically a simple task in large-scale AI projects.",
|
162 |
+
isFact: false,
|
163 |
+
explanation: "Fiction! Large-scale systems need robust monitoring due to complexity, making it anything but simple."
|
164 |
+
},
|
165 |
+
{
|
166 |
+
text: "Large-scale AI projects usually involve small teams handling end-to-end processes.",
|
167 |
+
isFact: false,
|
168 |
+
explanation: "Fiction! Large-scale projects typically require multiple teams or departments to handle different aspects."
|
169 |
+
},
|
170 |
+
{
|
171 |
+
text: "Data integration is typically straightforward and involves few systems in small-scale AI projects.",
|
172 |
+
isFact: true,
|
173 |
+
explanation: "Fact! Smaller projects usually involve fewer data pipelines, reducing integration complexity."
|
174 |
+
},
|
175 |
+
{
|
176 |
+
text: "Risk exposure in large-scale AI projects includes significant risks such as data breaches, downtime, and poor scalability.",
|
177 |
+
isFact: true,
|
178 |
+
explanation: "Fact! Bigger systems pose greater operational and security challenges."
|
179 |
+
},
|
180 |
+
{
|
181 |
+
text: "Large-scale AI projects manage small-to-moderate data sizes that are easily stored and processed.",
|
182 |
+
isFact: false,
|
183 |
+
explanation: "Fiction! By definition, large-scale AI typically involves massive datasets requiring high storage and compute."
|
184 |
+
}
|
185 |
];
|
186 |
|
187 |
let currentIndex = 0;
|
188 |
let score = 0;
|
189 |
+
let answered = false;
|
190 |
+
|
191 |
+
// Shuffle the statements to randomize their order
|
192 |
+
function shuffleArray(arr) {
|
193 |
+
for (let i = arr.length - 1; i > 0; i--) {
|
194 |
+
const j = Math.floor(Math.random() * (i + 1));
|
195 |
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
196 |
+
}
|
197 |
+
return arr;
|
198 |
+
}
|
199 |
+
|
200 |
+
function startGame() {
|
201 |
+
shuffleArray(statements);
|
202 |
+
currentIndex = 0;
|
203 |
+
score = 0;
|
204 |
+
answered = false;
|
205 |
+
loadStatement();
|
206 |
+
updateScore();
|
207 |
+
updateProgressBar();
|
208 |
+
document.getElementById("restart-btn").style.display = "none";
|
209 |
+
}
|
210 |
|
|
|
211 |
function loadStatement() {
|
212 |
+
if (currentIndex >= statements.length) {
|
213 |
+
endGame();
|
214 |
+
return;
|
215 |
+
}
|
216 |
+
let current = statements[currentIndex];
|
217 |
+
document.getElementById("statement").textContent = current.text;
|
218 |
document.getElementById("result").style.display = "none";
|
219 |
document.getElementById("explanation").style.display = "none";
|
220 |
document.getElementById("next-btn").style.display = "none";
|
221 |
+
answered = false;
|
222 |
updateProgressBar();
|
|
|
223 |
}
|
224 |
+
|
225 |
+
function guessFact() {
|
226 |
+
if (!answered) {
|
227 |
+
checkAnswer(true);
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
function guessFiction() {
|
232 |
+
if (!answered) {
|
233 |
+
checkAnswer(false);
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
function checkAnswer(userGuess) {
|
238 |
+
answered = true;
|
239 |
+
let correctAnswer = statements[currentIndex].isFact;
|
240 |
+
// Show result
|
241 |
+
if (userGuess === correctAnswer) {
|
242 |
+
document.getElementById("result").textContent = "Correct!";
|
243 |
+
document.getElementById("result").className = "correct";
|
244 |
+
score++;
|
245 |
+
} else {
|
246 |
+
document.getElementById("result").textContent = "Incorrect!";
|
247 |
+
document.getElementById("result").className = "incorrect";
|
248 |
+
}
|
249 |
document.getElementById("result").style.display = "block";
|
250 |
+
// Show explanation
|
251 |
+
document.getElementById("explanation").textContent = statements[currentIndex].explanation;
|
252 |
document.getElementById("explanation").style.display = "block";
|
253 |
+
// Show Next button
|
254 |
document.getElementById("next-btn").style.display = "inline-block";
|
255 |
+
// Update the score display
|
256 |
updateScore();
|
257 |
}
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
+
function nextStatement() {
|
260 |
+
currentIndex++;
|
261 |
+
if (currentIndex < statements.length) {
|
262 |
+
loadStatement();
|
263 |
+
} else {
|
264 |
+
endGame();
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
function updateScore() {
|
269 |
+
document.getElementById("score").textContent = `Score: ${score} / ${statements.length}`;
|
270 |
+
}
|
271 |
+
|
272 |
+
function updateProgressBar() {
|
273 |
+
let progress = (currentIndex / statements.length) * 100;
|
274 |
+
document.getElementById("progress-bar").style.width = progress + "%";
|
275 |
+
}
|
276 |
+
|
277 |
+
function endGame() {
|
278 |
+
// Display a final message with score and percentage
|
279 |
+
let percentage = Math.round((score / statements.length) * 100);
|
280 |
+
document.getElementById("statement").textContent = "Game Over! You scored " + score + " out of " + statements.length + " (" + percentage + "%).";
|
281 |
+
// Hide these elements
|
282 |
+
document.getElementById("result").style.display = "none";
|
283 |
+
document.getElementById("explanation").style.display = "none";
|
284 |
+
document.getElementById("next-btn").style.display = "none";
|
285 |
+
// Show the restart button
|
286 |
+
document.getElementById("restart-btn").style.display = "inline-block";
|
287 |
+
// Fill the progress bar to 100%
|
288 |
+
document.getElementById("progress-bar").style.width = "100%";
|
289 |
+
}
|
290 |
+
|
291 |
+
function restartGame() {
|
292 |
+
startGame();
|
293 |
+
}
|
294 |
+
|
295 |
+
// Start the game on load
|
296 |
+
startGame();
|
297 |
</script>
|
298 |
</body>
|
299 |
</html>
|