Crack Forclass

这同样适用于 Forclass,Sunclass,271BAY,Zhizhiniao

目前為 2021-06-06 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name               Crack Forclass
// @namespace          https://www.forclass.tk/script
// @version            3.7.1
// @icon               https://houtar.coding.net/p/crackForclass/d/crackForclass/git/raw/master/icon.png
// @description        这同样适用于 Forclass,Sunclass,271BAY,Zhizhiniao
// @author             Houtarchat
// @match              *://*.forclass.net/Student/Dati*
// @match              *://*.271bay.com/Student/Dati*
// @match              *://web.zhizhiniao.com/Student/Dati*
// @contributionURL    https://www.houtarchat.ml/donate.html
// @contributionAmount 5 RMB
// @license            GNU General Public License
// @run-at             document-idle
// ==/UserScript==
(() => {
    /* jslint browser: true */
    /* global unsafeWindow */

    unsafeWindow.g_debugmode = true;
    unsafeWindow.tick = () => null;
    unsafeWindow.polling4Submit = () => null;
    unsafeWindow.$('.qoption input,.qoption textarea').unbind('cut copy paste');
    unsafeWindow.document
        .querySelector(
            '#paperoperation > div.el-dati-funcs.el-upload-submit > div.el-dati-submit-td'
        )
        .setAttribute('class', 'el-dati-submit-td');

    if (unsafeWindow.getRequestParamValue('type') === '5') {
        const oneClickCompletionReviewButton = document.createElement('input');
        oneClickCompletionReviewButton.onclick = () =>
            unsafeWindow.addToQueue('UploadAttachmentPaperAnswer2', {
                aidx: unsafeWindow.getRequestParamValue('aidx'),
                session: unsafeWindow.getSession(),
                page: 1,
                studentAnswerURL: '',
                size: '',
                studentAnswer: `
    <style>
        [ads] .ea-content a:link,
        [ads] .ea-content a:visited {
            color: #505050;
        }

        [ads] .ea-content a:active,
        [ads] .ea-content a:hover {
            color: #373737;
        }

        [ads] .ea-callout a:link,
        [ads] .ea-callout a:visited {
            color: #6a6a6a;
        }

        [ads] .ea-callout a:active,
        [ads] .ea-callout a:hover {
            color: #505050;
        }
    </style>
    <div ads style="vertical-align: baseline; font-weight: 400; font-style: normal; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; line-height: 1.3em; letter-spacing: 0; font-size: 14px;">
        <div class="ea-content"
             style="margin: 1em 1em 0.5em; padding: 1em; background: rgba(0, 0, 0, 0.03); color: #505050; border: 0; border-radius: 3px; box-shadow: none; text-align: left;">
            <a href="https://greasyfork.org/zh-CN/scripts?set=451857" rel="nofollow" target="_blank"
               style="text-decoration: none;"><strong style="color: #088cdb;">Crack
                Forclass: </strong><span>The best plugin for Forclass.</span>
                <strong style="color: #088cdb;">Try it now!</strong></a>
        </div>
        <div class="ea-callout"
             style="margin: 0.5em 1em 1em; padding-right: 1em; padding-left: 1em; text-align: right; font-style: italic;">
            <a href="https://greasyfork.org/zh-CN/users/614734-houtar0chat" target="_blank"
               style="text-decoration: none; font-size: 0.8em;">Ad by Houtarchat</a>
        </div>
    </div>`,
            }, () => {
                unsafeWindow.http('GetStudentAnsweredPaper', {
                    session: unsafeWindow.getSession(),
                    page: 1,
                    paidx: unsafeWindow.getRequestParamValue('paidx'),
                    aidx: unsafeWindow.getRequestParamValue('aidx'),
                }, response =>
                    unsafeWindow.addToQueue('SetAssignmentPaperAnswer', {
                        session: JSON.parse(unsafeWindow.sessionStorage.account).session,
                        paIdx: response[0]['PAIdx'],
                        score: '100',
                        comment: '',
                        page: 0,
                    }, () => null, '', true), '');
            }, '', true);
        oneClickCompletionReviewButton.type = 'button';
        oneClickCompletionReviewButton.value = '一键完成&批阅';
        $('.el-dati-attach-require').append(oneClickCompletionReviewButton);
    } else {
        const htTime = document.createElement('input');
        htTime.id = 'HT-Time';
        htTime.value = 'HH:mm:ss';
        const modificationTimeButton = document.createElement('input');
        modificationTimeButton.onclick = () =>
            [unsafeWindow.sessionStorage.hour, unsafeWindow.sessionStorage.minute, unsafeWindow.sessionStorage.second] = $('#HT-Time').val().split(':');
        modificationTimeButton.type = 'button';
        modificationTimeButton.value = '修改答题所用时间';
        const openAnswerPageByFrameButton = document.createElement('input');
        openAnswerPageByFrameButton.onclick = () => {
            const out = unsafeWindow.document.createElement('div'), bar = unsafeWindow.document.createElement('div'),
                title = unsafeWindow.document.createElement('div'), rtbtns = unsafeWindow.document.createElement('div'),
                closeE = unsafeWindow.document.createElement('div'),
                body = unsafeWindow.document.createElement('iframe');
            out.setAttribute('class', 'dlg-out');
            out.setAttribute(
                'style',
                'z-index:3000;left:362.5px;top:140.5px;display:block'
            );
            unsafeWindow.document.querySelector('#main').appendChild(out);
            bar.setAttribute('class', 'dlg-bar');
            out.appendChild(bar);
            title.setAttribute('class', 'dlg-title');
            title.innerText = 'Houtarchat';
            bar.appendChild(title);
            rtbtns.setAttribute('class', 'dlg-rtbtns-out');
            bar.appendChild(rtbtns);
            closeE.setAttribute('class', 'dlg-close-e');
            closeE.setAttribute(
                'style',
                'text-align:center;width:34px;height:39px;display:inline-block;cursor:pointer;vertical-align:top;cursor:pointer;font-size:21px;font-weight:700'
            );
            closeE.innerText = '×';
            rtbtns.appendChild(closeE);
            body.setAttribute('class', 'dlg-body');
            body.setAttribute('src', `${unsafeWindow.location.protocol}//${unsafeWindow.location.host}/Student/Dajx${location.search.replace('state', '')}${location.hash}`);
            body.setAttribute(
                'style',
                'height:250px;width:450px;left:0;overflow:scroll;'
            );
            body.setAttribute('scrolling', 'yes');
            out.appendChild(body);

            closeE.onclick = () => out.style.display = 'none';

            body.onload = () => {
                const style = unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument.createElement('style');
                style.innerText = '*{max-width:520px!important;}';
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument.querySelector('head').appendChild(style);
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument.querySelector(`body`).setAttribute('style', 'width: 1040px;');
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector(`#main > div.el-main.el-w1200`)
                    .setAttribute('style', 'width:520px');
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector(
                        '#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content'
                    )
                    .setAttribute('style', 'width:520px');
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector(
                        '#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div'
                    )
                    .setAttribute('style', 'width:520px');
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector(
                        '#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-right.el-stu-manual-r > div > div'
                    )
                    .setAttribute('style', 'width:520px');
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument.querySelector('#header').remove();
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument.querySelector('#footer').remove();
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector('#main > div.el-main.el-w1200 > div > div.totop')
                    .remove();
                unsafeWindow.document.querySelector(
                    '#main > div:nth-child(10) > iframe'
                ).contentDocument
                    .querySelector(
                        '#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-left.el-main-left-thin'
                    )
                    .remove();
            };
        };
        openAnswerPageByFrameButton.type = 'button';
        openAnswerPageByFrameButton.value = '打开frame答案';
        const openAnswerPageByNewPageButton = document.createElement('input');
        openAnswerPageByNewPageButton.onclick = () =>
            window.open(`${unsafeWindow.location.protocol}//${unsafeWindow.location.host}/Student/Dajx${location.search.replace('state', '')}${location.hash}`);
        openAnswerPageByNewPageButton.type = 'button';
        openAnswerPageByNewPageButton.value = '新页面打开答案';
        $('.paperDesc').append(htTime, modificationTimeButton, '<br>', openAnswerPageByFrameButton, openAnswerPageByNewPageButton);
    }
})();