haojiachengutil

【本脚本功能】在复习学习通的各科题时,可以方便的隐藏和显示答案,提高学习效率

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name   haojiachengutil
// @namespace    https://www.haojiacheng.cn
// @version      0.1
// @description  【本脚本功能】在复习学习通的各科题时,可以方便的隐藏和显示答案,提高学习效率
// @author       SuYi
// @license      End-User License Agreement
// @match        *://*.chaoxing.com/*
// @match        *://*.edu.cn/*
// @match        *://*.nbdlib.cn/*
// @match        *://*.hnsyu.net/*
// @match        *://*.gdhkmooc.com/*
// @icon         https://www.haojiacheng.cn/favicon.ico
// @grant        none
// ==/UserScript==
(function() {
    'use strict';

    // Your code here...
    //document.getElementById("rightHeight").innerHTML="<button id='mybtn'>点我啊</button>";

    var cj=document.createTextNode("点我 显示/隐藏 答案");
    var jiacheng=document.createElement("button");
    jiacheng.id="mybtn";
    jiacheng.style="font: 12px/1.5 微软雅黑, 黑体, Arial, Helvetica, sans-serif;-webkit-font-smoothing: antialiased;padding: 0;outline: none;width: 180px;height: 32px;line-height: 32px;margin: 20px;background: #FFFFFF;border: solid #3A8BFF 1px;font-size: 14px;float: left;border-radius: 5px;text-align: center;cursor: pointer;background-color: #71e871;border-color: #3A8BFF;color: rgb(224 20 20);";
    jiacheng.appendChild(cj);
    document.getElementById("rightHeight").appendChild(jiacheng);

    var mybtn = document.getElementById("mybtn");
    var j = 0;
    mybtn.addEventListener("click",function(){
         j++;
    if(j%2==0){
        for(var i=0;i<document.getElementsByClassName("mark_answer").length;i++){document.getElementsByClassName("mark_answer")[i].style="display:block";}
    }else{
        for(var w=0;w<document.getElementsByClassName("mark_answer").length;w++){document.getElementsByClassName("mark_answer")[w].style="display:none";}
    }
    });

})();