您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
模拟考试的答案在页面里。
当前为
// ==UserScript== // @name 上海市大学生安全教育在线 - 自动答题(模拟考试版) // @description 模拟考试的答案在页面里。 // @version 1.0 // @namespace UnKnown // @author UnKnown // @match http://www.halnedu.com/pcexam/test/start // @grant none // @run-at document-end // ==/UserScript== (() => { const clickAnswer = (question, answer) => question.querySelector('input[value="' + answer + '"]').click(); // 1 & 2. True or False & Single Choice Question document.querySelectorAll('#q1 .question, #q2 .question').forEach( question => clickAnswer(question, question.getAttribute("as")) ); // 3. Multiple Choice Question const MCQ = document.getElementById('q3'); /* Uncheck all checked checkbox in Multiple Choice Question first, in case of duplicated click */ MCQ.querySelectorAll('li.active').forEach( selected => { selected.classList.remove('active'); selected.checked = false; } ); MCQ.querySelectorAll('.question').forEach( question => question.getAttribute('as').split("").forEach( answer => clickAnswer(question, answer) ) ); })(); // 4. Show right answers /* showAnswers = */ true && ((onHover = false) => document.head.appendChild( document.createElement("style") ).textContent = ( onHover ? ".box .question:hover .answer, .box .question:focus " : "" ) + ".answer {display: block !important}" )();