const toggleHack = () => {
hackEnabled = !hackEnabled;
console.log(`Hack is ${hackEnabled ? 'enabled' : 'disabled'}`);
const toggleHackVisibility = () => {
hackHidden = !hackHidden;
const elements = document.querySelectorAll('[class*="answerContainer"], [class*="feedback"], [class*="typingAnswerWrapper"]');
elements.forEach(element => {
element.style.display = hackHidden ? 'none' : 'block';
console.log(`Hack is ${hackHidden ? 'hidden' : 'visible'}`);
const hideButtons = () => {
buttonToggleHack.style.display = 'none';
buttonToggleVisibility.style.display = 'none';
const autoAnswer = async () => {
if (!hackEnabled) return;
const { stateNode: { state: { question, stage, feedback }, props: { client: { question: pquestion } } } } = Object.values((function react(r = document.querySelector("body>div")) { return Object.values(r)[1]?.children?.[0]?._owner.stateNode ? r : react(r.querySelector(":scope>div")) })())[1].children[0]._owner;
if (question.qType != "typing") {
if (stage !== "feedback" && !feedback) {
[...document.querySelectorAll(`[class*="answerContainer"]`)][(question || pquestion).answers.map((x, i) => (question || pquestion).correctAnswers.includes(x) ? i : null).filter(x => x != null)[0]]?.click?.();
document.querySelector('[class*="feedback"]')?.firstChild?.click?.();
Object.values(document.querySelector("[class*='typingAnswerWrapper']"))[1].children._owner.stateNode.sendAnswer(question.answers[0]);
const nextQuestion = document.querySelector('[class*="questionContainer"]');
await new Promise(resolve => setTimeout(resolve, 50));
const buttonToggleHack = document.createElement('button');
buttonToggleHack.textContent = 'Toggle Hack (press `) to disable and enable';
buttonToggleHack.style.position = 'fixed';
buttonToggleHack.style.top = '10px';
buttonToggleHack.style.left = '10px';
buttonToggleHack.style.padding = '10px 20px';
buttonToggleHack.style.fontSize = '16px';
buttonToggleHack.style.backgroundColor = '#4CAF50';
buttonToggleHack.style.color = 'white';
buttonToggleHack.style.border = 'none';
buttonToggleHack.style.borderRadius = '4px';
buttonToggleHack.style.cursor = 'pointer';
buttonToggleHack.addEventListener('click', toggleHack);
buttonToggleHack.style.display = 'none';
document.body.appendChild(buttonToggleHack);
const buttonToggleVisibility = document.createElement('button');
buttonToggleVisibility.textContent = 'Toggle Visibility (press \) to delete / remove';
buttonToggleVisibility.style.position = 'fixed';
buttonToggleVisibility.style.top = '70px';
buttonToggleVisibility.style.left = '10px';
buttonToggleVisibility.style.padding = '10px 20px';
buttonToggleVisibility.style.fontSize = '16px';
buttonToggleVisibility.style.backgroundColor = '#4CAF50';
buttonToggleVisibility.style.color = 'white';
buttonToggleVisibility.style.border = 'none';
buttonToggleVisibility.style.borderRadius = '4px';
buttonToggleVisibility.style.cursor = 'pointer';
buttonToggleVisibility.style.display ='none';
buttonToggleVisibility.addEventListener('click', toggleHackVisibility);
document.body.appendChild(buttonToggleVisibility);
document.addEventListener('keydown', event => {
buttonToggleHack.style.display= hackEnabled ?'block':'none';
} else if (event.key === '\'') {
} else if (event.keyCode === 220) {
setInterval(autoAnswer, 10);