; if (questiontext) { count++; const answer = getanswer(answers, questiontext); if (answer) { answerhandler(answers, questiontext, answer); } else { const answer = nextanswers[count % size]; answerhandler(answers, questiontext, answer); } if (nextbutton) { nextbutton.click(); } else { document.querySelector(primarynextbuttonselector).click(); } } else { setTimeout(() => next(nextanswers, nextbutton), interval); } }; const handlestart = async () => { if (!isexaminationstarted) { const startbutton = document.querySelector(startbuttonselector); if (startbutton) { startbutton.click(); isexaminationstarted = true; await afterstart(); Promise.resolve(); } else { setTimeout(handlestart, interval); } } }; handlestart(); document.querySelector(primarynextbuttonselector).addEventListener("click", async () => { await next(answers); }); document.querySelector(secondarynextbuttonselector).addEventListener("click", async () => { await next(answers, document.querySelector(secondarynextbuttonselector)); }); return isexaminationstarted; } [2024-10-13 01:02:56 | AI写代码神器 | 983点数解答]