-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path93669220-f6b8-4783-8a6e-f510e04a4534.html
74 lines (70 loc) · 2.5 KB
/
93669220-f6b8-4783-8a6e-f510e04a4534.html
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
<!-- Clue 1e -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Clue 1</title>
<link rel="stylesheet" href="./styles.css" />
<link rel="icon" href="./assets/mpl-logo.png" type="image/png" />
</head>
<body>
<div class="container">
<div class="clue-box">
<h1>Clue 1</h1>
<div class="poem">
<p>
I sit near a mind that sparked many a light,<br />
Inventive, resourceful, a genius of flight.<br />
Where machines and motors took their first stand,<br />
A pioneer's legacy across the land.<br />
Yet just a stone's throw from this man of fame,<br />
I offer fuel of a different name.<br />
Not for engines or gears, but for the soul,<br />
Where minds take a break, and bellies find their goal.<br />
What am I, this place of rest,<br />
Near a creator whose work was the best?<br />
</p>
</div>
<input type="text" id="answer2" placeholder="Enter your answer" />
<button onclick="checkAnswer()">Submit</button>
<p id="message2" class="message"></p>
<p id="message3" class="message"></p>
</div>
</div>
<script>
async function checkAnswer() {
const userAnswer = document.getElementById("answer2").value.trim();
const response = await fetch(
"https://mpl-treasurehunt-be.onrender.com/checkAnswer",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
question_number: 5,
answer: userAnswer,
}),
}
);
if (response.ok) {
const data = await response.json();
if (data.correct) {
document.getElementById("message2").textContent =
"Correct! Advance to GDN Main Canteen for your next clue";
document.getElementById("message3").textContent =
"Secret Clue: 188";
} else {
document.getElementById("message2").textContent =
"Wrong answer. Try again!";
document.getElementById("message3").textContent = "";
}
} else {
document.getElementById("message2").textContent =
"Error checking answer. Please try again.";
}
}
</script>
</body>
</html>