Greasy Fork

Greasy Fork is available in English.

安徽省高等教育自考网络助学平台清楚答案

为了方便重复做题背题,添加了一个清楚答案的按钮。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         安徽省高等教育自考网络助学平台清楚答案
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  为了方便重复做题背题,添加了一个清楚答案的按钮。
// @author       lyl
// @match        https://*.edu-edu.com.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=edu-edu.com.cn
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    $(document).ready(function() {
        $(".ui-logo").append("<button style='margin-top: 14px;' id='clearBtn'>清楚答案</button>");
        $("#clearBtn").click(function(){
            let r=confirm("确定清楚吗?");
            if (r==true){
                $(".ui-paper-iframe").contents().find("li").removeClass("ui-option-selected");
            }
        })
        $(".ui-logo").append("<button style='margin-top: 14px;margin-left: 8px;' id='shuffleBtn'>乱序选项</button>");
        $("#shuffleBtn").click(function(){
            console.log( $(".ui-paper-iframe").contents().find("ul"))
            let ulList = $(".ui-paper-iframe").contents().find("ul").each(function(u){
                 console.log($(this).children());
                 $(this).children().each(function(){
                     if(parseInt(Math.random()*2)==0){
                         $(this).prependTo($(this).parent());
                     }
                 })
            });
        })
    });
})();