Skip to content

Commit 2f10a64

Browse files
authored
Update index.html
1 parent aaf394d commit 2f10a64

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

index.html

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,10 @@ <h1 id="quiz-title">Simple Quiz</h1>
203203
const radioButtons = document.querySelectorAll('input[name="question1"]');
204204

205205
document.querySelector('.container-wrapper').addEventListener('mouseout', function (e) {
206-
// Check if the mouse has actually left the container-wrapper, not just moved between elements inside it
207-
if (!e.currentTarget.contains(e.relatedTarget)) {
208-
logViolation("Mouse left the quiz container", "red");
209-
}
210-
});
206+
if (!e.currentTarget.contains(e.relatedTarget)) {
207+
logViolation("Mouse left the quiz container", "red");
208+
}
209+
});
211210

212211
function addEvent(obj, evt, fn) {
213212
if (obj.addEventListener) {
@@ -299,24 +298,20 @@ <h1 id="quiz-title">Simple Quiz</h1>
299298
addEvent(document, "contextmenu", handleContextMenu);
300299
addEvent(document, "selectionchange", debounceSelectionChange);
301300
addEvent(document, "visibilitychange", handleVisibilityChange);
302-
addEvent(document, "'DOMContentLoaded'", () => logViolation("Session started", "green");
303301
window.onblur = () => logViolation("Window focus lost", "yellow");
304302
window.onfocus = () => logViolation("Window focus regained", "blue");
305303
});
306304
}
307305

308306
setupEventListeners();
309307

310-
311-
312-
radioButtons.forEach(radio => {
308+
radioButtons.forEach(radio => {
313309
radio.addEventListener('change', () => {
314-
logViolation(`Selected answer: ${button.value}`, "yellow");
310+
logViolation(`Selected answer: ${radio.value}`, "yellow");
315311
submitButton.disabled = !document.querySelector('input[name="question1"]:checked');
316312
});
317313
});
318314

319-
320315
submitButton.addEventListener('click', function() {
321316
const selectedAnswer = document.querySelector('input[name="question1"]:checked');
322317
logViolation("Session ended", "purple"); // Log session end in purple
@@ -341,8 +336,6 @@ <h1 id="quiz-title">Simple Quiz</h1>
341336
// Stop all tracking after submit
342337
removeEventListeners();
343338
});
344-
345-
346339
</script>
347340
</body>
348341
</html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy