Update captcha.html
This commit is contained in:
parent
cedd74a9ff
commit
303ce83990
1 changed files with 12 additions and 1 deletions
13
captcha.html
13
captcha.html
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue