您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
显示正确的单选选项方便复习
当前为
// ==UserScript== // @name [蓝墨云] 显示正确的单选选项 // @namespace ckylin-script-mosoteach-showsinglecurrectanswer // @version 0.1 // @description 显示正确的单选选项方便复习 // @author CKylinMC // @match https://www.mosoteach.cn/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let highlighted = false; function highlightCurrectAnswers(){ if(highlighted) return; else highlighted = true; const get = (q,p=document.body) => p.querySelector(q); const getAll = (q,p=document.body) => p.querySelectorAll(q); const list = get(".main-box .topic-list"); const items = getAll(".topic-item",list); const ansMap = ['A','B','C','D','E','F']; for(let it of items){ try{ const choices = [...getAll(".t-option.t-item>.opt",it)]; const currect = get(".t-answer.t-item>.answer-l>.light"); const answer = currect.innerHTML.trim(); const index = ansMap.indexOf(answer.toUpperCase()); choices.forEach((el,ind)=>{ if(ind!=index){ el.style.opacity = ".1"; el.style.fontSize = "smaller"; }else{ el.style.fontSize = "larger"; } }) }catch(Exception){} } } function disableBottom(yes=true){ const old = document.querySelector("#notbottomcss"); old&&old.remove(); if(yes){ const css = document.createElement("style"); css.appendChild(document.createTextNode(``)); css.id = "notbottomcss"; document.body.appendChild(css); } } function isContentReady(){ return document.querySelector(".topic-list")!==null; } let timer = null; function loader(){ if(!isContentReady()){ if(timer===null){ timer = setInterval(loader,200); }else{ console.log("Waiting..."); } }else{ clearInterval(timer); disableBottom(); highlightCurrectAnswers(); } } if(document.title.indexOf("查看个人解析")>=0)loader(); })();