From 2f795fd7de5d661aabbca2db983c57142996bfd7 Mon Sep 17 00:00:00 2001 From: marsteralex Date: Tue, 16 Aug 2022 14:22:55 -0400 Subject: [PATCH] hacked fix for removing image from name --- web/public/mtg/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/public/mtg/app.js b/web/public/mtg/app.js index b7358a49..160c887e 100644 --- a/web/public/mtg/app.js +++ b/web/public/mtg/app.js @@ -246,9 +246,13 @@ function checkAnswers() { currCard = document.getElementById('card-' + cardIndex) let incorrect = true if (currCard.dataset.name) { - let guess = document.getElementById(currCard.dataset.name).innerText - // window.console.log(artDict[currCard.dataset.url][0], guess); - incorrect = artDict[currCard.dataset.url][0] !== guess + // remove image text + let guess = document + .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 } if (incorrect) currCard.classList.add('incorrect')