北化评价一键减负

Tech Chemist Destroy the World!

目前为 2023-12-28 提交的版本。查看 最新版本

// ==UserScript==
// @name         北化评价一键减负
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Tech Chemist Destroy the World!
// @author       Snowman
// @match        https://buct.mycospxk.com/index.html*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=https://buct.mycospxk.com
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    //############################ 配置 #################################

    // 对该课程的老师的建议
    let FILLTEXT = ''
    // 点击按钮后自动滑动的距离
    let SCROLL = 2500;

    //########################## 配置结束 #################################

    function postHonkai() {

        document.querySelectorAll('.ant-radio-group>div:last-child>label').forEach(item => item.click())

        // do it twice to cover all the conditions
        document.querySelectorAll('.ant-radio-group>div:last-child>label').forEach(item => item.click())

        document.querySelectorAll('.ant-input').forEach(item => item.textContent = FILLTEXT)

        setTimeout(() => {
            document.querySelector('.ant-layout-content main')
                .scrollBy({ top: SCROLL, behavior: 'smooth' })
        }, 400);
    }


    // always trying to display a big button
    setInterval(() => {
        if (document.querySelector('#snow-hi3-btn') == null) {
            tryCreateButton();
        }
    }, 200);

    (function InsertCSS(css) {
        var styleSheet = document.createElement('style');
        styleSheet.innerHTML = css;
        document.head.appendChild(styleSheet);
    })('#snow-hi3-btn{width:300px;height:64px;border:none;border-radius:8px;background-color:#FFDC40;box-shadow:#ACA231 0px 0px 5px 1px}#snow-hi3-btn:hover{outline:#333102 3px solid;cursor:pointer}#snow-hi3-btn:focus{background-color:#FDFFFD;cursor:wait}#snow-hi3-btn>svg{zoom:.2;padding-top:32px}');

    function tryCreateButton() {
        let ele = document.querySelector('.AnswerFinalEvaluateZGKXJSDXCustomization_task_desc_wrap-3_pCj');
        if (ele == null) return;

        // <div><btn>...svg</btn><div>
        let btn = document.createElement('button');
        btn.id = 'snow-hi3-btn';
        btn.addEventListener('click', postHonkai);

        let div = document.createElement('div');
        div.style.marginLeft = '-100px';
        let svgContent = '<svg width="581" height="170" overflow="hidden"><path d="M175.5 89.458v21.92l10.04-8.146c.1.987.2 2.419.3 4.295.39 5.332.74 9.381 1.03 12.145 2.96-3.554 5.42-7.06 7.39-10.515-3.15-5.53-5.91-12.096-8.27-19.699zm187.61-4.739v20.142h9.6V84.719zm142.26-19.995h19.49l-2.06 25.771c-.3 2.172-.69 4.295-1.19 6.368 19.11 7.998 38.91 16.786 59.39 26.364l-10.78 17.477a1238.397 1238.397 0 0 0-56.14-27.845c-8.07 11.355-27.28 20.735-57.61 28.141-1.58-2.567-4.24-6.665-7.98-12.293-1.67-2.567-2.95-4.493-3.84-5.776 39.89-6.813 59.63-19.008 59.24-36.583zm-196.48-1.482c3.74 1.383 9.06 3.012 15.96 4.888a2469.064 2469.064 0 0 0-13.15 53.468l-16.4-5.777c3.35-10.762 7.88-28.288 13.59-52.579zM0 57.466h140.49v21.328H0zm349.96-10.96H386v14.367h-36.04zm-93.36-1.185v7.85h10.93v-7.85zm231.63-17.476c-5.02 5.332-10.05 10.17-15.07 14.514h41.36l13.89-14.514zM256.6 24.438v7.702h10.93v-7.702zm55.69-15.552a5347.8 5347.8 0 0 1 3.54 9.331c4.83 12.244 8.28 21.575 10.35 27.993l-16.25 5.776c-2.86-9.182-7.19-21.871-13-38.064zM388.66.592h16.99v12.293c0 2.963.05 5.629.15 7.998h12.56c-1.48-1.876-3.94-4.838-7.39-8.886-1.58-1.778-2.76-3.16-3.55-4.147l10.79-6.517c5.12 5.135 9.35 9.726 12.7 13.774l-8.86 5.776h13v16.292h-28.81c0 .296.05.691.15 1.185v.889c.49 16.786 1.08 28.881 1.77 36.287 4.14-8.689 7.88-18.267 11.23-28.734l14.92 6.517c-7.09 19.551-14.53 35.744-22.31 48.58.89 4.246 2.02 8.146 3.4 11.701 1.18 3.258 2.46 4.838 3.84 4.739 1.18-.099 1.92-1.234 2.22-3.406.88-5.826 1.67-12.639 2.36-20.439 4.33 1.777 8.67 3.455 13 5.035-1.08 10.17-2.26 18.465-3.54 24.883-2.07 9.578-6.7 14.514-13.89 14.811-9.06-.198-15.71-6.517-19.94-18.958a218.074 218.074 0 0 1-17.29 19.846c-.78-.691-2.02-1.777-3.69-3.258-3.64-3.357-6.55-5.924-8.72-7.702 3.45-3.456 6.75-6.911 9.9-10.367h-29.54V70.648h35.3v41.471c3.25-4.147 6.36-8.344 9.31-12.59-2.36-13.33-4.04-33.127-5.02-59.391-.1-.988-.15-1.975-.15-2.963h-43.87v27.252c.88 30.511-4.14 55.887-15.07 76.129-6.31-4.049-11.62-7.208-15.96-9.479 5.52-10.664 9.21-20.785 11.08-30.363 1.97-9.183 2.91-21.722 2.81-37.619V20.883h60.42c-.2-7.306-.3-14.07-.3-20.291zm97.65-.148l22.6 1.777c-.2.297-.49.741-.89 1.334-1.57 2.172-3.44 4.69-5.61 7.553h52.15v15.551l-15.51 15.7h30.43v61.614h-19.06V59.836h-72.24v45.618h-19.05V53.616l-2.51 1.777c-2.47-2.864-6.95-7.356-13.45-13.478C459.42 31.35 473.8 17.526 486.31.444zM160.28 0l16.55 2.073c-1.38 5.629-2.81 10.862-4.29 15.7h14.18v15.551h-19.5a153.403 153.403 0 0 1-5.17 11.849h22.31v15.404h-8.86v13.181h10.93v7.258l9.01-6.665c1.38 6.714 3.35 12.836 5.91 18.365 1.77-6.813 2.85-14.712 3.25-23.697h-16.25v-15.7l15.81-28.585h-14.33V9.183h30.72v15.996l-15.36 28.288h14.33v16.144c-.99 15.897-3.6 28.98-7.83 39.249 5.81 6.715 15.71 10.269 29.69 10.664v-12.145h-20.83V94.197h20.83v-7.553h-18.02V73.462h18.02v-7.405h-16.69V53.171h16.69v-7.85h-21.12V32.14h21.12v-7.702h-16.54V11.404h16.54V.741h15.22v10.663h24.37V32.14h6.5v13.181h-6.5v20.736H256.6v7.405h25.11v13.182H256.6v7.553h27.47v13.182H256.6v12.441c13 .198 23.44.149 31.32-.148-1.48 5.233-2.91 10.862-4.29 16.885-12.61 0-26-.247-40.18-.741-18.61-.493-31.61-4.838-39-13.034-3.15 5.036-7.88 11.109-14.18 18.218a360.333 360.333 0 0 0-10.49-13.182l4.43-5.036c-4.72 3.259-9.3 6.665-13.74 10.22a57.239 57.239 0 0 0-6.05 5.036l-8.72-13.034c2.86-3.949 4.24-8.64 4.14-14.07V89.458h-11.52v-15.7h11.52V60.577h-6.95v-7.998l-6.35-11.701C152.45 29.326 157.03 15.7 160.28 0z" fill="#333102" fill-rule="evenodd"/></svg>';
        btn.innerHTML = svgContent;

        div.appendChild(btn);
        ele.appendChild(div);

        console.log('[SnowScriptLog] All Done!');
    }

    function taskWithNap(items, taskWithItems, nap = 100) {
        return new Promise(resolve => {
            let index = 0;
            let next = () => {
                if (index < items.length) {
                    taskWithItems(items[index]);
                    index++;
                    setTimeout(next, nap);
                } else {
                    resolve();
                }
            };
            next();
        });
    }

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址