Greasy Fork

Greasy Fork is available in English.

清除雨课堂做题痕迹

清除雨课堂试卷做题痕迹(仅UI变更,不涉及雨课堂后台数据),便于复习。

目前为 2022-06-06 提交的版本,查看 最新版本

// ==UserScript==
// @name         清除雨课堂做题痕迹
// @namespace    http://tampermonkey.net/
// @version      1.0.0.RELEASE
// @description  清除雨课堂试卷做题痕迹(仅UI变更,不涉及雨课堂后台数据),便于复习。
// @author       冰镇杨梅瑞纳冰YYDS
// @match        https://examination.xuetangx.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=xuetangx.com
// @grant        none
// @license DONT FUCKING CARE
// ==/UserScript==

(function() {
    'use strict';
     var checkDiv = document.createElement("div");
    var rightAnswer;
    var button;
    checkDiv.setAttribute("id","test");
    document.body.appendChild(checkDiv);
    var testBlock = document.getElementById("test");
    testBlock.style.height="auto";
    testBlock.style.width="auto";
    testBlock.style.position="fixed";
    testBlock.style.top=0;
    testBlock.style.right=0;
    testBlock.style.zindex=1000;
    testBlock.innerHTML+='<div style="margin:60px; z-index:1000"><button id="start" onClick="ErasAll()" style=\"background-color:#4286F3; padding:15px; border-radius:5px;border:0;color:white\">清除做题痕迹</button></div>'
    // Your code here...



    window.ErasAll = function(){
        alert("🐵你的答案痕迹已被清除,查看答案点击对应题目的查看答案。题目处理可能需要等待。");
        // 删除所有蓝色选项按钮
        var isChecked = document.getElementsByClassName('el-radio');
        for(let i=0;i<isChecked.length;i++){
            isChecked[i].className="el-radio is-disabled";
        }

        
        //隐藏所有正确答案
        rightAnswer = document.getElementsByClassName("item-footer");
        for(let g=0;g<rightAnswer.length;g++){
            rightAnswer[g].style.display="none";
        }
        //新增显示答案
        var questions = document.getElementsByClassName("item-body");
        for(let t=0;t<questions.length;t++){
            var num = t;
            questions[t].innerHTML+='<button id="'+t+'" class="ShowAnswerBtn" style="background-color: #4286F3; padding:15px; border-radius:5px;border:0;color:white" onClick="ShowAnswer('+t+')"><p>显示答案</p></button><a id="num" style="display:none;">'+num+'</a>';

        }

        var myTextAnswer = document.getElementsByClassName("subject-answer");
        for(let i=0;i<myTextAnswer.length;i++){
            myTextAnswer[i].innerHTML="你的答案已被脚本吃掉了";
        }
        for(let j=0;j<50;j++){
            //删除所有的标记(多删几次)
            var rightAnswerMark = document.getElementsByClassName("dot");
            for(let i=0;i<rightAnswerMark.length;i++){
                let dotParent = rightAnswerMark[i].parentNode;
                dotParent.removeChild(rightAnswerMark[i]);
            }
        }
    }
    window.ShowAnswer=function(num){
       rightAnswer[num].style.display="block";
   }

})();