Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit 109d6cd

Browse files
committed
IMAGE MATCHING (v1.1.0)
Re-wrote the answer handling and it now supports same-text questions with images!!!
1 parent ec90ca1 commit 109d6cd

File tree

5 files changed

+39
-19
lines changed

5 files changed

+39
-19
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# answer.js
2+
3+
v1.1.0 - The images update
4+
25
A bookmarklet-based blooket auto-player that uses the offical blooket api to get question answers.
36

47
## How to use?
@@ -21,5 +24,5 @@ Running the cheat on unsupported modes will still auto-answer questions, but wil
2124

2225
Bookmarklet:
2326
```
24-
javascript:(()%3D%3E%7Basync%20function%20a(a)%7Bvar%20b%3D%7B%7D%2Cc%3D%22%22%3Bfetch(%22https%3A%2F%2Ffb.blooket.com%2Fc%2Ffirebase%2Fjoin%22%2C%7Bbody%3A%60%7B%5C%22id%5C%22%3A%5C%22%24%7Ba%7D%5C%22%2C%5C%22name%5C%22%3A%5C%22answerdotjs%5C%22%7D%60%2Cmethod%3A%22PUT%22%2Cmode%3A%22cors%22%7D).then(async%20d%3D%3E%7Bvar%20e%3Dawait%20d.json()%3Bconsole.log(%60Set%20id%20is%20%24%7Be.host.set%7D%60)%2Cconsole.log(%60Game%20pin%20is%20%24%7Ba%7D%60)%2Cconsole.log(%60Game%20mode%20is%20%24%7Be.host.s.t%7D%60)%2Cc%3De.host.s.t%2Cconsole.log(%22Getting%20game%20answers...%22)%3Bvar%20f%3Dawait%20fetch(%60https%3A%2F%2Fapi.blooket.com%2Fapi%2Fgames%3FgameId%3D%24%7Be.host.set%7D%60)%2Cg%3Dawait%20f.json()%2Ch%3Dg.questions%3Bh.forEach(a%3D%3E%7Ba.question%3Da.question.replace(%2F%20%2B(%3F%3D%20)%2Fg%2C%22%22).trim()%2Cconsole.log(a.question%2B%22%3A%22%2Ba.correctAnswers)%2Ca.correctAnswers%5B0%5D%3Da.correctAnswers%5B0%5D.trim().replace(%2F%20%2B(%3F%3D%20)%2Fg%2C%22%22)%2Cb%5Ba.question%5D%3D%7Bnum%3Aa.number%2Ctext%3Aa.question%2CpossibleAnswers%3Aa.answers%2CcorrectAnswers%3Aa.correctAnswers%7D%7D)%7D)%3Bvar%20d%3D%7B%7D%2Ce%3D%7B%7D%2Cf%3DsetInterval(()%3D%3E%7Bvar%20a%3DMath.floor%3Bswitch(c)%7Bcase%22Gold%22%3Avar%20g%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D%5C%22styles__choice%5C%22%22)%3B3%3D%3Dg.length%26%26g%5Ba(3*Math.random())%5D.click()%3Bvar%20h%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__headerInside___'%5D%22)%3Bh%26%26h.innerText%26%26document.querySelector(%22%5Bclass%5E%3D'arts__regularBody___'%5D%22).click()%3Bvar%20j%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__noPlayers___'%5D%20%3E%20div%22)%3Bj%26%26j.click()%3Bvar%20k%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__playerContainer___'%5D%22)%3Bk%26%26k.click()%3Bbreak%3Bcase%22Hack%22%3Avar%20l%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__button___'%5D%22)%2Cm%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__introHeader___'%5D%22)%3Bl.length%26%26m.innerText%26%26!m.innerText.includes(%22HACKING%22)%26%26l%5Ba(Math.random()*l.length)%5D.click()%3Bvar%20n%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__nextText___'%5D%22)%3Bn%26%26n.parentElement.click()%3Bvar%20o%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D%5C%22styles__choice__%5C%22%5D%22)%3B3%3D%3Do.length%26%26o%5Ba(Math.random()*o.length)%5D.click()%3Bvar%20p%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__choiceContainer___'%5D%22)%3Bif(p%26%26p.click()%2Cl.length%26%26m%26%26m.innerText.includes(%22HACKING%22))%7Bvar%20q%2Cr%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__introHeader___'%5D%20%3E%20span%22).innerText%2Cs%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__buttonDeactivated___'%5D%22)%3Bif(s.forEach(a%3D%3E%7Ba.classList.contains(%22%5Bclass%5E%3D'styles__buttonNotChosen___'%5D%22)%7C%7C(q%3Da.innerText)%7D)%2C!d%5Br%5D%26%26!e%5Br%5D)l%5Ba(Math.random()*l.length)%5D.click()%3Belse%20if(!d%5Br%5D%26%26e%5Br%5D)e%5Br%5D.forEach(a%3D%3E%7Bl.forEach(b%3D%3E%7Bb.innerText%3D%3Da%26%26b.click()%7D)%7D)%3Belse%7Bvar%20t%3Bl.forEach(a%3D%3E%7Ba.innerText%3D%3Dd%5Br%5D%26%26(t%3Da)%7D)%2Ct%26%26t.click()%7Dvar%20u%3D%22%22%2Cv%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__introHeader___'%5D%22).forEach(a%3D%3E%7B%22CORRECT%22%3D%3Da.innerText%3Fu%3D%22CORRECT%22%3A%22INCORRECT%22%3D%3Da.innerText%26%26(u%3D%22INCORRECT%22)%7D)%3Bif(%22CORRECT%22%3D%3Du)d%5Br%5D%3Dq%3Belse%20if(%22INCORRECT%22%3D%3Du%26%26!s%5Br%5D)%7Bvar%20w%3D%5B%5D%3Bl.forEach(a%3D%3E%7Bw.push(a.innerText)%7D)%2Ce%5Br%5D%3Dw%7D%7Dbreak%3Bcase%22Royale%22%3AclearInterval(f)%2CsetInterval(()%3D%3E%7Bvar%20a%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__questionText___'%5D%22)%3Bif(a%26%26a.innerText)%3Belse%20return%3Bfor(var%20c%2Cd%3Db%5Ba.innerText%5D%2Ce%3D!1%2Cf%3D0%3B4%3Ef%26%26!1%3D%3De%3Bf%2B%2B)c%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__answerContainer___'%5D%22)%5Bf%5D%2Cc.innerText%26%26d.correctAnswers.includes(c.innerText)%26%26(c.click()%2Ce%3D!0)%7D%2C50)%3Bbreak%3Bcase%22Fish%22%3Avar%20x%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__pageButton___'%5D%22)%3Bx%26%26x.click()%3Bvar%20y%3Ddocument.querySelector(%22%5Bclass%5E%3D'arts__modal___'%5D%22)%3By%26%26y.click()%3B%7Dvar%20z%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__questionText___'%5D%22)%2CA%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__feedbackContainer___'%5D%20%3E%20div%22)%3Bif(A%26%26A.click()%2Cz%26%26z.innerText)%3Belse%20return%3Bfor(var%20B%2CC%3Db%5Bz.innerText%5D%2CD%3D!1%2CE%3D0%3B4%3EE%26%26!1%3D%3DD%3BE%2B%2B)B%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__answerContainer___'%5D%22)%5BE%5D%2CB.innerText%26%26C.correctAnswers.includes(B.innerText)%26%26(B.click()%2CD%3D!0)%7D%2C250)%7Dvar%20b%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__idInput___'%5D%22)%3Bif(!b)%7Bvar%20c%3Ddocument.body.appendChild(document.createElement(%22iframe%22))%2Cd%3Dc.contentWindow%3Breturn%20d.alert(%22Please%20only%20run%20this%20script%20on%20the%20start%20screen%20(where%20you%20input%20id)%22)%2Cvoid%20document.body.removeChild(c)%7Dvar%20e%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__mainBox___'%5D%22)%3Be.onsubmit%3Dfunction(...c)%7Bvar%20d%3Ddocument.body.appendChild(document.createElement(%22iframe%22))%2Ce%3Dd.contentWindow%3Be.alert(%60Starting%20bot%20with%20game%20code%20%24%7Bb.value%7D.%20If%20you%20incorrectly%20entered%20the%20game%20code%2C%20please%20refresh%20the%20page.%60)%2Cdocument.body.removeChild(d)%2Ca(b.value)%7D%3Bvar%20f%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__joinButton___'%5D%22)%3Bf.onclick%3Dfunction(...a)%7Be.onsubmit()%7D%7D)()%3B
27+
javascript:(()%3D%3E%7Basync%20function%20a(a)%7Bvar%20b%3D%5B%5D%2Cc%3D%22%22%3Bfetch(%22https%3A%2F%2Ffb.blooket.com%2Fc%2Ffirebase%2Fjoin%22%2C%7Bbody%3A%60%7B%5C%22id%5C%22%3A%5C%22%24%7Ba%7D%5C%22%2C%5C%22name%5C%22%3A%5C%22answerdotjs%5C%22%7D%60%2Cmethod%3A%22PUT%22%2Cmode%3A%22cors%22%7D).then(async%20d%3D%3E%7Bvar%20e%3Dawait%20d.json()%3Bconsole.info(%60Set%20id%20is%20%24%7Be.host.set%7D%60)%2Cconsole.info(%60Game%20pin%20is%20%24%7Ba%7D%60)%2Cconsole.info(%60Game%20mode%20is%20%24%7Be.host.s.t%7D%60)%2Cc%3De.host.s.t%2Cconsole.log(%22Getting%20game%20answers...%22)%3Bvar%20f%3Dawait%20fetch(%60https%3A%2F%2Fapi.blooket.com%2Fapi%2Fgames%3FgameId%3D%24%7Be.host.set%7D%60)%2Cg%3Dawait%20f.json()%2Ch%3Dg.questions%3Bh.forEach(a%3D%3E%7Ba.question%3Da.question.replace(%2F%20%2B(%3F%3D%20)%2Fg%2C%22%22).trim()%2Cconsole.log(a.question%2B%22%3A%22%2Ba.correctAnswers)%2Ca.correctAnswers%5B0%5D%3Da.correctAnswers%5B0%5D.trim().replace(%2F%20%2B(%3F%3D%20)%2Fg%2C%22%22)%3Bvar%20c%3D!1%3B%22object%22%3D%3Dtypeof%20a.image%26%26(c%3D!0)%2Cb.push(%7Bnum%3Aa.number%2Ctext%3Aa.question%2CpossibleAnswers%3Aa.answers%2CcorrectAnswers%3Aa.correctAnswers%2ChasImage%3Ac%2Cimage%3Aa.image%7D)%7D)%7D)%3Bvar%20d%3D%7B%7D%2Ce%3D%7B%7D%2Cf%3DsetInterval(()%3D%3E%7Bvar%20a%3DMath.floor%3Bswitch(c)%7Bcase%22Gold%22%3Avar%20g%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D%5C%22styles__choice%5C%22%22)%3B3%3D%3Dg.length%26%26g%5Ba(3*Math.random())%5D.click()%3Bvar%20h%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__headerInside___'%5D%22)%3Bh%26%26h.innerText%26%26document.querySelector(%22%5Bclass%5E%3D'arts__regularBody___'%5D%22).click()%3Bvar%20j%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__noPlayers___'%5D%20%3E%20div%22)%3Bj%26%26j.click()%3Bvar%20k%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__playerContainer___'%5D%22)%3Bk%26%26k.click()%3Bbreak%3Bcase%22Hack%22%3Avar%20l%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__button___'%5D%22)%2Cm%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__introHeader___'%5D%22)%3Bl.length%26%26m.innerText%26%26!m.innerText.includes(%22HACKING%22)%26%26l%5Ba(Math.random()*l.length)%5D.click()%3Bvar%20n%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__nextText___'%5D%22)%3Bn%26%26n.parentElement.click()%3Bvar%20o%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D%5C%22styles__choice__%5C%22%5D%22)%3B3%3D%3Do.length%26%26o%5Ba(Math.random()*o.length)%5D.click()%3Bvar%20p%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__choiceContainer___'%5D%22)%3Bif(p%26%26p.click()%2Cl.length%26%26m%26%26m.innerText.includes(%22HACKING%22))%7Bvar%20q%2Cr%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__introHeader___'%5D%20%3E%20span%22).innerText%2Cs%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__buttonDeactivated___'%5D%22)%3Bif(s.forEach(a%3D%3E%7Ba.classList.contains(%22%5Bclass%5E%3D'styles__buttonNotChosen___'%5D%22)%7C%7C(q%3Da.innerText)%7D)%2C!d%5Br%5D%26%26!e%5Br%5D)l%5Ba(Math.random()*l.length)%5D.click()%3Belse%20if(!d%5Br%5D%26%26e%5Br%5D)e%5Br%5D.forEach(a%3D%3E%7Bl.forEach(b%3D%3E%7Bb.innerText%3D%3Da%26%26b.click()%7D)%7D)%3Belse%7Bvar%20t%3Bl.forEach(a%3D%3E%7Ba.innerText%3D%3Dd%5Br%5D%26%26(t%3Da)%7D)%2Ct%26%26t.click()%7Dvar%20u%3D%22%22%2Cv%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__introHeader___'%5D%22).forEach(a%3D%3E%7B%22CORRECT%22%3D%3Da.innerText%3Fu%3D%22CORRECT%22%3A%22INCORRECT%22%3D%3Da.innerText%26%26(u%3D%22INCORRECT%22)%7D)%3Bif(%22CORRECT%22%3D%3Du)d%5Br%5D%3Dq%3Belse%20if(%22INCORRECT%22%3D%3Du%26%26!s%5Br%5D)%7Bvar%20w%3D%5B%5D%3Bl.forEach(a%3D%3E%7Bw.push(a.innerText)%7D)%2Ce%5Br%5D%3Dw%7D%7Dbreak%3Bcase%22Royale%22%3AclearInterval(f)%2CsetInterval(()%3D%3E%7Bvar%20a%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__questionText___'%5D%22)%3Bif(a%26%26a.innerText)%3Belse%20return%3Bfor(var%20c%2Cd%3Db%5Ba.innerText%5D%2Ce%3D!1%2Cf%3D0%3B4%3Ef%26%26!1%3D%3De%3Bf%2B%2B)c%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__answerContainer___'%5D%22)%5Bf%5D%2Cc.innerText%26%26d.correctAnswers.includes(c.innerText)%26%26(c.click()%2Ce%3D!0)%7D%2C50)%3Bbreak%3Bcase%22Fish%22%3Avar%20x%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__pageButton___'%5D%22)%3Bx%26%26x.click()%3Bvar%20y%3Ddocument.querySelector(%22%5Bclass%5E%3D'arts__modal___'%5D%22)%3By%26%26y.click()%3B%7Dvar%20z%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__questionText___'%5D%22)%2CA%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__feedbackContainer___'%5D%20%3E%20div%22)%2CB%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__image___'%5D%22)%2CC%3Dnull!%3D%3DB%2CD%3DC%3FB.src.split(%22%2F%22)%5BB.src.split(%22%2F%22).length-1%5D.split(%22.%22)%5B0%5D%3Avoid%200%3Bif(A%26%26A.click()%2Cz%26%26z.innerText)%3Belse%20return%3Bfor(var%20E%2CF%3Db.filter(a%3D%3EC%3F!0%3D%3Da.hasImage%26%26a.image.id%3D%3DD%26%26a.text%3D%3Dz.innerText%3Aa.text%3D%3Dz.innerText)%5B0%5D%2CG%3D!1%2CH%3D0%3B4%3EH%26%26!1%3D%3DG%3BH%2B%2B)E%3Ddocument.querySelectorAll(%22%5Bclass%5E%3D'styles__answerContainer___'%5D%22)%5BH%5D%2CE.innerText%26%26F.correctAnswers.includes(E.innerText)%26%26(E.click()%2CG%3D!0)%7D%2C250)%7Dvar%20b%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__idInput___'%5D%22)%3Bif(!b)%7Bvar%20c%3Ddocument.body.appendChild(document.createElement(%22iframe%22))%2Cd%3Dc.contentWindow%3Breturn%20d.alert(%22Please%20only%20run%20this%20script%20on%20the%20start%20screen%20(where%20you%20input%20id)%22)%2Cvoid%20document.body.removeChild(c)%7Dvar%20e%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__mainBox___'%5D%22)%3Be.onsubmit%3Dfunction(...c)%7Bvar%20d%3Ddocument.body.appendChild(document.createElement(%22iframe%22))%2Ce%3Dd.contentWindow%3Be.alert(%60Starting%20bot%20with%20game%20code%20%24%7Bb.value%7D.%20If%20you%20incorrectly%20entered%20the%20game%20code%2C%20please%20refresh%20the%20page.%60)%2Cdocument.body.removeChild(d)%2Ca(b.value)%7D%3Bvar%20f%3Ddocument.querySelector(%22%5Bclass%5E%3D'styles__joinButton___'%5D%22)%3Bf.onclick%3Dfunction(...a)%7Be.onsubmit()%7D%7D)()%3B
2528
```

answer.js

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// answer.js
2-
// v1.0.0
2+
// v1.1.0
33
// Made by mmccall0813 on github
44
// https://www.github.com/mmccall0813/answer.js
55
// dont steal pls!
@@ -36,17 +36,17 @@ joinButton.onclick = function(...args){
3636
form.onsubmit()
3737
}
3838
async function start(gameid){
39-
var answers = {};
39+
var answers = [];
4040
var mode = "";
4141
fetch("https://fb.blooket.com/c/firebase/join", {
4242
"body": `{\"id\":\"${gameid}\",\"name\":\"answerdotjs\"}`,
4343
"method": "PUT",
4444
"mode": "cors"
4545
}).then( async (res) => {
4646
var json = await res.json();
47-
console.log(`Set id is ${json.host.set}`);
48-
console.log(`Game pin is ${gameid}`)
49-
console.log(`Game mode is ${json.host.s.t}`);
47+
console.info(`Set id is ${json.host.set}`);
48+
console.info(`Game pin is ${gameid}`);
49+
console.info(`Game mode is ${json.host.s.t}`);
5050
mode = json.host.s.t;
5151
console.log("Getting game answers...");
5252
var gameinfo = await fetch(`https://api.blooket.com/api/games?gameId=${json.host.set}`);
@@ -58,12 +58,16 @@ async function start(gameid){
5858
q.correctAnswers[0] = q.correctAnswers[0].trim().replace(/ +(?= )/g,'');
5959
// note to self: rewrite this to support image matching
6060
// questions can have the same text, but different images
61-
answers[q.question] = {
61+
var hasImage = false;
62+
if(typeof q.image == "object") hasImage = true;
63+
answers.push({
6264
num:q.number,
6365
text:q.question,
6466
possibleAnswers:q.answers,
65-
correctAnswers:q.correctAnswers
66-
}
67+
correctAnswers:q.correctAnswers,
68+
hasImage: hasImage,
69+
image: q.image
70+
});
6771
})
6872
})
6973
var cryptoPasswords = {};
@@ -78,15 +82,15 @@ async function start(gameid){
7882
var header = document.querySelector("[class^='styles__headerInside___']");
7983
if(header && header.innerText) document.querySelector("[class^='arts__regularBody___']").click()
8084
// after you select a chest, go to the next screen
81-
85+
8286
var noPlayersNext = document.querySelector("[class^='styles__noPlayers___'] > div");
8387
if(noPlayersNext) noPlayersNext.click();
8488
// if theres no players to swap with or steal from, hit the button to go to the next screen
8589

8690
var firstPlayerToSteal = document.querySelector("[class^='styles__playerContainer___']");
8791
if(firstPlayerToSteal) firstPlayerToSteal.click(); // might swap with lower player if its a swap
8892
// steal from players
89-
93+
9094
break;
9195
case "Hack": // crypto hack auto-play
9296
var passwords = document.querySelectorAll("[class^='styles__button___']");
@@ -95,9 +99,9 @@ async function start(gameid){
9599
// choose a randomized password
96100

97101
var feedbackText = document.querySelector("[class^='styles__nextText___']");
98-
if(feedbackText) feedbackText.parentElement.click();
102+
if(feedbackText) feedbackText.parentElement.click();
99103
// automatically click next after getting question correct
100-
104+
101105
var outputs = document.querySelectorAll("[class^=\"styles__choice__\"]");
102106
if(outputs.length == 3) outputs[Math.floor(Math.random()*outputs.length)].click();
103107
// auto choose a random output
@@ -134,7 +138,7 @@ async function start(gameid){
134138
})
135139
if(correct) correct.click()
136140
}
137-
141+
138142
var status = "";
139143
var result = document.querySelectorAll("[class^='styles__introHeader___']").forEach( (e) => {
140144
if(e.innerText == "CORRECT"){
@@ -160,7 +164,7 @@ async function start(gameid){
160164
var questionText = document.querySelector("[class^='styles__questionText___']")
161165
if(questionText && questionText.innerText); else return;
162166
var question = answers[questionText.innerText];
163-
167+
164168
var answered = false;
165169
for(var i = 0; i < 4 && answered == false; i++){
166170
var button = document.querySelectorAll("[class^='styles__answerContainer___']")[i];
@@ -180,10 +184,20 @@ async function start(gameid){
180184
}
181185
var questionText = document.querySelector("[class^='styles__questionText___']")
182186
var feedback = document.querySelector("[class^='styles__feedbackContainer___'] > div");
187+
var img = document.querySelector("[class^='styles__image___']");
188+
var hasImage = img !== null;
189+
var imgID = hasImage ? img.src.split("/")[img.src.split("/").length-1].split(".")[0] : undefined;
183190
if(feedback) feedback.click();
184191
if(questionText && questionText.innerText); else return;
185-
var question = answers[questionText.innerText];
186-
192+
193+
var question = answers.filter( (ques, index) => {
194+
if(hasImage){
195+
return ques.hasImage == true && ques.image.id == imgID && ques.text == questionText.innerText;
196+
} else {
197+
return ques.text == questionText.innerText
198+
}
199+
})[0];
200+
187201
var answered = false;
188202
for(var i = 0; i < 4 && answered == false; i++){
189203
var button = document.querySelectorAll("[class^='styles__answerContainer___']")[i];

0 commit comments

Comments
 (0)