Inicio /
E Cuestionarios y juegos de conocimientos informáticos
E Cuestionarios y juegos de conocimientos informáticos
Security+ Cyber Memory Match
Nivel: 1
Matches: 0 / 10
Moves: 0
Time: 0:00
Match each cybersecurity term with its correct definition!
${cardData.text}
`;
card.addEventListener("click", () => flipCard(card));
board.appendChild(card);
});
}
function flipCard(card) {
if (lockBoard) return;
if (card.classList.contains("matched")) return;
if (card === firstCard) return;
card.classList.add("flipped");
if (!firstCard) {
firstCard = card;
return;
}
secondCard = card;
moves++;
document.getElementById("moves").textContent = moves;
checkMatch();
}
function checkMatch() {
const match =
firstCard.dataset.pair === secondCard.dataset.pair;
if (match) {
firstCard.classList.add("matched");
secondCard.classList.add("matched");
matchedPairs++;
document.getElementById("matches").textContent =
matchedPairs + " / 10";
document.getElementById("message").textContent =
"Correct match! Great cybersecurity knowledge.";
resetTurn();
if (matchedPairs === 10) {
completeLevel();
}
} else {
lockBoard = true;
document.getElementById("message").textContent =
"Not a match. Try again!";
setTimeout(() => {
firstCard.classList.remove("flipped");
secondCard.classList.remove("flipped");
resetTurn();
}, 1000);
}
}
function resetTurn() {
firstCard = null;
secondCard = null;
lockBoard = false;
}
function completeLevel() {
clearInterval(timer);
document.getElementById("message").textContent =
"🎉 Level " + currentLevel +
" completed! You matched all 10 pairs.";
if (currentLevel
Páginas:
1 2 3 4 5 6 7 8 9 10