hacked fix for removing image from name

This commit is contained in:
marsteralex 2022-08-16 14:22:55 -04:00
parent cc15e46874
commit 2f795fd7de

View File

@ -246,9 +246,13 @@ function checkAnswers() {
currCard = document.getElementById('card-' + cardIndex) currCard = document.getElementById('card-' + cardIndex)
let incorrect = true let incorrect = true
if (currCard.dataset.name) { if (currCard.dataset.name) {
let guess = document.getElementById(currCard.dataset.name).innerText // remove image text
// window.console.log(artDict[currCard.dataset.url][0], guess); let guess = document
incorrect = artDict[currCard.dataset.url][0] !== guess .getElementById(currCard.dataset.name)
.innerText.split('>')
let ans = artDict[currCard.dataset.url][0].split('>')
window.console.log(ans, guess)
incorrect = ans[ans.length - 1] !== guess[guess.length - 1]
// decide if their guess was correct // decide if their guess was correct
} }
if (incorrect) currCard.classList.add('incorrect') if (incorrect) currCard.classList.add('incorrect')