Update captcha.html

This commit is contained in:
Arma-Damna-Dillo 2025-02-15 16:52:49 +00:00
parent cedd74a9ff
commit 303ce83990

View file

@ -212,6 +212,12 @@
currentQuestionIndex = randomIndex; currentQuestionIndex = randomIndex;
} }
function generateRandomURL() {
// Generate a random number to append as a query parameter
const randomParam = Math.floor(Math.random() * 1000000);
return window.location.href.split('?')[0] + `?captcha=${randomParam}`;
}
function checkAnswer() { function checkAnswer() {
const answer = document.getElementById("captcha-answer").value.trim().toLowerCase(); const answer = document.getElementById("captcha-answer").value.trim().toLowerCase();
const correctAnswer = questions[currentQuestionIndex].answer.toLowerCase(); const correctAnswer = questions[currentQuestionIndex].answer.toLowerCase();
@ -222,8 +228,13 @@
document.getElementById("captcha-question").style.display = 'none'; document.getElementById("captcha-question").style.display = 'none';
document.getElementById("captcha-answer").style.display = 'none'; document.getElementById("captcha-answer").style.display = 'none';
document.getElementById("submit-button").style.display = 'none'; document.getElementById("submit-button").style.display = 'none';
// Generate a random URL parameter and redirect after 2 seconds
setTimeout(function() {
window.location.href = generateRandomURL();
}, 2000);
strikeCount = 0; strikeCount = 0;
setTimeout(loadNewQuestion, 2000); // Wait before loading next question
} else { } else {
strikeCount++; strikeCount++;
if (strikeCount < 3) { if (strikeCount < 3) {