Greasy Fork

来自缓存

Greasy Fork is available in English.

合工大启用复制

合工大考试启用复制

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         合工大启用复制
// @namespace    https://wyq.icu/
// @version      0.0.2
// @description  合工大考试启用复制
// @author       wangyuqi
// @match        *://learning.wencaischool.net/openlearning/exam/portal/exam.jsp?exam_id=*&type=work&content_id=*&type=work&is_make_up=undefined
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var iframe = document.getElementById('cboxIframe'); // 替换为实际的iframe ID
    if (iframe) {
        // 在iframe中执行 JavaScript 代码
        var iframeWindow = iframe.contentWindow;
        iframeWindow.postMessage('document.onkeydown = null;', '*');
        iframeWindow.postMessage('document.onselectstart = null;', '*');
        iframeWindow.postMessage('document.oncopy = null;', '*');
        iframeWindow.postMessage('document.oncut = null;', '*');
        iframeWindow.postMessage('document.onpaste = null;', '*');
        iframeWindow.postMessage('document.getElementById("tblDataList").onselectstart = null;', '*');
    }
})();
/** 以下为提取答案的 js 代码先放着
let tbody = document.querySelector("#_block_content_exam_1 > form > table > tbody");
let tr_list = tbody.querySelectorAll('tr[correctstatus="1"]');
div_list = [];
for(let i=0;i<tr_list.length;i++){
    tr = tr_list[i];
    temp_div = document.querySelector("#"+ tr.id + " > td:nth-child(2) > table:nth-child(2) > tbody > tr:nth-child(2) > td > div:nth-child(2)")
    console.log("第"+String(Number(i)+1)+"题:"+temp_div.innerText)
}
//       *://learning.wencaischool.net/openlearning/exam/portal/exam.jsp?exam_id=*&type=work&content_id=*&type=work&is_make_up=undefined
//       *://learning.wencaischool.net/openlearning/exam/portal/view_answer.jsp?exam_id=*&score_id=*&content_id=*&type=work&is_make_up=undefined&reexamine=0&*
**/