2990524671qq.com / 超星学习通|智慧树|执教云 全平台自动答题脚本

// ==UserScript==
// @name         超星学习通|智慧树|执教云   全平台自动答题脚本
// @version      1.0.4
// @namespace    自动答题
// @description  支持超星,智慧树,执教云,雨课堂等自动答题
// @author       xuedeqj
// @match        *://*.chaoxing.com/*
// @match        *://*.edu.cn/*
// @match        *://*.hnsyu.net/*
// @match        *://*.zhihuishu.com/*
// @match        *://*.bsnc.cn/*
// @match        *://*.xuetangx.com/*
// @match        *://*.yuketang.cn/*
// @match        *://*.icve.com.cn/*
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @run-at       document-end
// @connect      lyck6.cn
// @license          MIT
// @require      https://cdn.jsdelivr.net/npm/jquery@2.2.3/dist/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/jquery.md5@1.0.2/index.min.js
// @require      https://cdn.jsdelivr.net/gh/zyufstudio/jQuery@3a09ff54b33fc2ae489b5083174698b3fa83f4a7/jPopBox/dist/jPopBox.min.js
// ==/UserScript==

//全局配置参数
var GLOBAL = {
    time: 5E3, //查题间隔时间,不建议小于5s,如果为了安全起见最好10s以上,即10E3
    delay: 2E3, //延迟加载,页面初始化完毕之后的等待2s之后再去搜题,
    fillAnswerDelay: 1E3 //填充答案的延迟,不建议小于0.5秒,默认一秒
};

!function(s){"use strict";function p(e,t){s.top.document.getElementById("iframeNode").contentWindow.vueDefinedProp(e,t)}function a(e){return $(e).clone().find("img[src]").replaceWith(function(){return $("<p></p>").text('<img src="'+$(this).attr("src")+'">')}).end().find("iframe[src]").replaceWith(function(){return $("<p></p>").text('<iframe src="'+$(this).attr("src")+'"></irame>')}).end().text().trim()}function c(e,t){e=e.toLowerCase();let o=s.top.document.createElement(e);if(o.style.display="block",o.id=e.replace("hcsearche","hcSearche").replace(/\-[a-z]/g,function(e){return e.replace("-","").toUpperCase()}),t){!1===Array.isArray(t)&&(t=[t]);for(let e=0;e<t.length;e++)o.appendChild(t[e])}return o}function u(f,e){return $.map(e,function(t){{var o=w(t),n=w(f);if(t=2,!o||!n)return 0;if(o===n)return 100;var i,a,r,l,s,c,p=(o.length>n.length?o:n).length,u=o.length,d=n.length,m=[];if(t=t||2,0===u)return d;if(0===d)return u;for(i=0;i<=u;i++)m[i]=[],m[i][0]=i;for(a=0;a<=d;a++)m[0][a]=a;for(i=1;i<=u;i++)for(r=o.charAt(i-1),a=1;a<=d;a++)c=n.charAt(a-1),m[i][a]=(l=m[i-1][a]+1,s=m[i][a-1]+1,c=m[i-1][a-1]+(r===c?0:1),l<s?l<c?l:c:s<c?s:c);let e=100*(1-m[u][d]/p);return e.toFixed(t)}})}async function d(e,r,o){console.log(r);let t=[];for(const c of e){if(console.log("当前答案",JSON.stringify(c)),4===r.type||2===r.type){let e=c.length>r.$options.length?c.slice(0,r.$options.length):c;return e.forEach((e,t)=>{o(r.type,e,r.$options.eq(t))}),{ok:!0,ans:c.join("===="),question:r.question}}if(3===r.type){if(c.join().match(/(^|,)(正确|是|对|√|T|ri)(,|$)/))return r.options[0].match(/(^|,)(正确|是|对|√|T|ri)(,|$)/)?o(r.type,"",r.$options.eq(0)):r.options[0].match(/(^|,)(错误|否|错|×|F|不是|wr)(,|$)/)&&o(r.type,"",r.$options.eq(1)),{ok:!0,ans:"正确",question:r.question};if(c.join().match(/(^|,)(错误|否|错|×|F|不是|wr)(,|$)/))return r.options[0].match(/(^|,)(正确|是|对|√|T|ri)(,|$)/)?o(r.type,"",r.$options.eq(1)):r.options[0].match(/(^|,)(错误|否|错|×|F|不是|wr)(,|$)/)&&o(r.type,"",r.$options.eq(0)),o(r.type,"",r.$options.eq(1)),{ok:!0,ans:"错误",question:r.question}}else if(0===r.type||1===r.type){let a=new Set;for(const p of c)if(1===p.length&&function(n){if(!(8<n.length)&&/[A-Z]/.test(n)){let t={},o=0;for(let e=0;e<n.length;e++){if(n.charCodeAt(e)<o)return;o=n.charCodeAt(e),t[o]=(t[o]||0)+1}return 1}}(p)){const i=p.charCodeAt(0)-65;a.add(r.$options.eq(i))}c.forEach((e,t)=>{e=w(e);let n=$.inArray(e,r.options);if(0<=n)a.add(r.$options.eq(n));else if(1<a.size&&1===r.type)console.log("多选题已经有合适的选项,不进行模糊匹配");else{const i=u(e,r.options);let o=0;i.forEach((e,t)=>{e>o&&(o=e,n=t)}),-1!==n&&60<o&&a.add(r.$options.eq(n))}}),t.push(a)}}console.log(t);let n=new Set,i=0;if(0===r.type){for(var a of t)if(a&&1===a.size){n=a,i=t.indexOf(a);break}}else if(1===r.type)for(var l of t)l&&l.size>n.size&&(n=l,i=t.indexOf(l));if(console.log(n),0<n.size){let t=Array.from(n);for(let e in t)setTimeout(()=>{o(r.type,"",t[e])},e*GLOBAL.fillAnswerDelay);return s=GLOBAL.fillAnswerDelay*n.size,await new Promise(e=>{setTimeout(e,s)}),{ok:!0,ans:e[i].join("===="),question:r.question}}return{ok:!1,question:r.question,ans:e.join("====")};var s}function w(e){return e=e,(t=document.createElement("div")).innerHTML=e,e=t.innerText||t.textContent,t=null,e.replace(/\s+/," ").replace(/[\uff01-\uff5e]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).replace(/^[A-Z]\./,"").replace(/\(\d+\s分\)$/,"").replace(/[“”]/g,'"').replace(/[‘’]/g,"'").replace(/。/g,".").replace(/\+/g,"").replace(/;$/,"").toLowerCase();var t}const t={"单项选择题":0,"单选题":0,"多选题":1,"填空题":2,"判断题":3,"简答题":4,"名词解释":5,"论述题":6,"计算题":7,"其它":8,"分录题":9,"资料题":10,"连线题":11,"排序题":13,"完形填空":14,"阅读理解":15,"口语题":18,"听力题":19};function e(){var a=`
        <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- import CSS -->
    <link rel="stylesheet" href="//lib.baomitu.com/element-ui/2.15.9/theme-chalk/index.min.css">
    <style>
      .el-table .warning-row {
        background: oldlace;
      }
      .el-table .success-row {
        background: #f0f9eb;
      }
      *{
        padding: 0px;
        margin: 0px;
      }
      .el-form-item{
        display: flex;
        justify-content: center
      }
</style>
</head>
<body>
<div id="app">
    <div id="drag_auto_answer" style="position: absolute;">
        <el-main
                class="onlinekf"
                style="min-width: 309px;margin-top: 0px;margin-left: 0px;border: 0px solid #666;width: 100%;background-color: #ffffff; padding: 15px 0px 0px; z-index: 99999;">
            <el-row>
                <el-form>
                    <el-form-item  style="margin-top: -20px">
<a target="_blank" href="http://dt3.8tupian.com/1/11108a9b1000.pg3" style="text-decoration: none; color: aliceblue;">获取积分</a>                    </el-form-item>

                </el-form>
            </el-row>
            <el-row>
                <el-form>
                    <el-form-item label="请输入手机号" style="margin-top: -20px">
                        <el-input v-model="opt.token" placeholder="请输入内容" style="max-width: 130px" size="mini"></el-input>
                        <el-button  @click="btnClick(opt.token,'opt.confim')" size="mini" type="warning">确定</el-button>
                    </el-form-item>
                </el-form>
            </el-row>
           1112233445
            <el-row style="margin-top: -20px;margin-bottom: 5px;display: flex">
                <el-alert
                        style="display: block"
                        :title="tip"
                        :closable="false"
                        type="success">
                    <el-button v-if="need_jump" @click="btnClick(opt.jump,'opt.jump')" size="mini" type="info">跳过本题</el-button>
                    <el-button v-if="!hidden" @click="btnClick(opt.auto_jump,'opt.auto_jump')" size="mini" type="warning">{{opt.auto_jump ? '停止自动切换': '开启自动切换'}}</el-button>
                </el-alert>
            </el-row>
            <el-row style="display: flex;flex-flow: wrap;width: 100%;align-items: flex-start;">
                <el-button v-if="!hidden" @click="btnClick(opt.stop,'opt.stop')" size="mini" type="success" style="margin-left: 5px">{{!opt.stop ? '暂停答题': '继续答题'}}</el-button>
                <el-button size="mini" type="info" style="margin-left: 5px">重新查询</el-button>
                <el-button @click="btnClick(opt.start_pay,'opt.start_pay')" size="mini" type="primary" style="margin-left: 5px">{{opt.start_pay ?'关闭收费题库' : '开启收费题库'}}</el-button>
                <el-button size="mini" type="danger" style="margin-left: 5px"><a style="text-decoration:none;color: aliceblue" target="_blank" href="http://dt3.8tupian.com/1/11108a9b1000.pg3" >获取积分</a></el-button>
            </el-row>

            <el-table size="mini" :data="tableData" style="width: 100%;margin-top: 5px" :row-class-name="tableRowClassName">
                <el-table-column prop="index" label="题号" width="45"></el-table-column>
                <el-table-column prop="question" label="问题" width="125"></el-table-column>
                <el-table-column prop="answer" label="答案" width="120"></el-table-column>
            </el-table>
        </el-main>
    </div>
</div>
</body>
<!-- import Vue before Element -->
<script src="//lib.baomitu.com/vue/2.6.0/vue.min.js"></script>
<!-- import JavaScript -->
<script src="//lib.baomitu.com/element-ui/2.15.9/index.js"></script>

<style>
  .el-table .warning-row {
    background: oldlace;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }
</style>
<script>
    new Vue({
        el: '#app',
        data: function () {
            return {
                hidden: false,
                need_jump: false,
                tip: '正在搜索',
                opt:{
                    token: '`+GM_getValue("token")+`',
                    auto_jump: `+GM_getValue("auto_jump")+`,
                    stop: false,
                    start_pay: `+GM_getValue("start_pay")+`
                },
                input: '',
                visible: false,
                tableData: []
            }
        },
        mounted() {
        },
        created(){
            /**
            *  油猴脚本 给 iframe 通信的方法
            * @param type 消息类型
            * @param receiveParams 消息参数
            */
            window['vueDefinedProp'] = (type,receiveParams) => {
                //**
                if (type === 'push'){
                    let length = this.tableData.length
                    this.tableData.push({index: length + 1,question: receiveParams.question,answer: receiveParams.answer,ok:receiveParams.ok})
                }else if (type === 'clear'){
                    this.tableData = []
                }else if (type === 'tip'){
                    if (receiveParams.type && receiveParams.type === 'jump'){
                         window.parent.postMessage({"type": 'jump'}, '*');
                    }else if (receiveParams.type && receiveParams.type === 'error'){
                         this.need_jump = true
                    }else if (receiveParams.type && receiveParams.type === 'hidden'){
                         this.hidden = true
                    }else if (receiveParams.type && receiveParams.type === 'stop'){
                         this.opt.stop = true
                    }

                    this.tip = receiveParams.tip
                }
            }
        },
        methods: {
            tableRowClassName({row, rowIndex}) {
                return row.ok ? 'success-row': 'warning-row'
            },
            btnClick(e,type){
                if (type === 'opt.stop'){//暂停搜索
                    this.opt.stop = !this.opt.stop
                    this.tip = this.opt.stop? '已暂停搜索': '继续搜索'
                     window.parent.postMessage({type: 'stop',val:this.opt.stop}, '*');
                }else if (type === 'opt.start_pay'){
                    this.opt.start_pay = ! this.opt.start_pay
                     window.parent.postMessage({type: 'start_pay',flag:this.opt.start_pay}, '*');
                }else if (type === 'opt.auto_jump'){//开启自动切换
                    this.opt.auto_jump = ! this.opt.auto_jump
                    window.parent.postMessage({type: 'auto_jump',flag:this.opt.auto_jump}, '*');
                }else if (type === 'opt.jump'){//跳过本题
                    window.parent.postMessage({type: 'jump'}, '*');
                    this.need_jump = false
                }else if (type === 'opt.confim'){
                    window.parent.postMessage({type: 'confim',token:e}, '*');
                }
            }
        }
    })
</script>
</html>
`;{let e=c("headers-node"),t=s.top.document.createElement("img"),o=(t.setAttribute("src","http://lyck6.cn/img/6.png"),t.setAttribute("draggable","false"),t.setAttribute("width","98%"),t.setAttribute("height","101px"),t.setAttribute("style","display: block;margin-bottom: -2%;padding-left: 1%;"),e.appendChild(t),s.top.document.createElement("iframe")),n=(o.id="iframeNode",o.setAttribute("width","100%"),o.setAttribute("height","350px"),o.setAttribute("frameborder","0"),o.srcdoc=a,c("content-modal",[e,o])),i=function(e){return function(e,t,o){let n=s.top.document,i=n.getElementById(t);i?i.innerHTML="":((i=n.createElement(e)).id=t,n.body.appendChild(i));e=c(e+"-container",o);return i.appendChild(e),i.classList.add(t),i.style.zIndex="9999999",i.style.position="fixed",i.style.left="30px",i.style.top="30px",setTimeout(function(){i.classList.add(t+"-show")},10),i}("modal","model-id",e)}(n);{var r=i;const l=s.top;r.onmousedown=function(e){r.style.cursor="move";let n=(e=e||window.event).clientX-r.offsetLeft,i=e.clientY-r.offsetTop;s.top.onmousemove=function(e){let t=(e=e||o.event).clientX-n,o=e.clientY-i;t<0?t=0:t>.95*l.innerWidth-r.offsetWidth&&(t=.95*l.innerWidth-r.offsetWidth),o<0?o=0:o>l.innerHeight-r.offsetHeight&&(o=l.innerHeight-r.offsetHeight),console.log(r.style.left),console.log(r.style.top),r.style.left=t+"px",r.style.top=o+"px"},s.top.onmouseup=function(e){r.style.cursor="default",this.onmousemove=null,this.onmouseup=null}};return}}}function o(r,i,l,s=function(e){},c=function(){}){GLOBAL.index=0,this.init=function(e,t){var o=w(a(e.find(t.elements.question)));let n={question:0===o.length?e.find(t.elements.question):o,$options:e.find(t.elements.$options),options:$.map(e.find(t.elements.options),function(e){return w(a(e))})};return n.type=t.elements.type?e.find(t.elements.type).text()||e.find(t.elements.type).val():e,i(n)},this.fillAnswer=async function(){let a=$(r.root);GLOBAL.setInterval=async()=>{var e,n;if(console.log("当前index",GLOBAL.index),GLOBAL.index>=a.length)return clearInterval(GLOBAL.loop),delete GLOBAL.loop,(e=void 0===GM_getValue("auto_jump")||GM_getValue("auto_jump"))?(p("tip",{type:"jump",tip:"自动答题已完成,即将切换下一题"}),setTimeout(()=>{p("tip",{type:"hidden",tip:"自动答题已完成,请检查提交"})},GLOBAL.time)):p("tip",{tip:"自动答题已完成"+(1===a.length?",请手动切换":"请检查提交")}),s(e)&&(GLOBAL.index=0,setTimeout(()=>{this.fillAnswer()},GLOBAL.time)),!0;try{var t,o=this.init($(a[GLOBAL.index]),r);if(o){p("tip",{tip:"准备答第"+(GLOBAL.index+1)+"题"}),n={question:o.question};const i=function(e){let t=e.msg,o=e.data.num;return{success:200===e.code,msg:t=104===e.code?"积分不足请关闭收费答题答题功能\n或者请点击【获取积分】进行充值":t,num:o,list:e.data.list}}(await new Promise((t,o)=>{GM_xmlhttpRequest({method:"POST",url:"https://lyck6.cn/api/autoAnswer/"+(GM_getValue("start_pay")?GM_getValue("token"):0),headers:{"Content-Type":"application/json;charset=utf-8",Version:GM_info.script.version},data:JSON.stringify(n),timeout:1e4,onload:function(e){t(JSON.parse(e.responseText))},onerror:function(e){o(e)}})}));i.success?(p("tip",{tip:"准备填充答案,"+(i.num.includes("免费题库")?"免费题库不扣积分":"剩余积分:"+i.num)}),t=await d(i.list,o,l),p("push",{index:GLOBAL.index++,question:t.question,answer:t.ans,ok:t.ok})):p("tip",{tip:i.msg})}}catch(e){p("tip",{type:"error",tip:"发生异常"+e})}finally{c()}},GLOBAL.loop=setInterval(GLOBAL.setInterval,GLOBAL.time),console.log("GLOBAL.loop",GLOBAL.loop)}}function n(t){e(),setTimeout(()=>{let e=new o({root:".questionLi",elements:{question:"h3 div",options:".answerBg .answer_p, .textDIV, .eidtDiv",$options:".answerBg, .textDIV, .eidtDiv",type:"input[name^=type]:eq("+t+")"}},e=>(e.type=parseInt(e.type),1===e.type&&$.each(e.$options,(e,t)=>{1===$(t).find(".check_answer,.check_answer_dx").length&&$(t).click()}),e),(e,t,o)=>{0===e||1===e||3===e?0===o.find(".check_answer,.check_answer_dx").length&&o.click():4!==e&&2!==e||C.getEditor(o.find("textarea").attr("name")).setContent(t)},e=>{e&&setTimeout(()=>{$('.nextDiv .jb_btn:contains("下一题")').click()},GLOBAL.time/5)});e.fillAnswer()},GLOBAL.delay)}function V(){e(),setTimeout(()=>{new o({root:".q_content",elements:{question:".divQuestionTitle",options:".questionOptions .q_option",$options:".questionOptions .q_option"}},e=>{function t(e){let t=0;for(const o of n||[])null!==$(o).find(e)&&t++;return t}var n;return e.question=e.question.replace(/^\d+、/,"").replace(/(\d+\s+分)$/,""),e.type=(n=e.$options,2===t('[type="radio"]')?3:2<t('[type="radio"]')?0:2<t('[type="checkbox"]')?1:1<=t("textarea")?4:void 0),e.options=$.map(e.options,e=>w(e.replace(/[A-G][.|\\.\s+]/,"")).trim()),e.type,console.log(e),e},(e,t,o)=>{o=o.find("div"),(0===e||3===e||1===e&&"checkbox_on"!==o.attr("class"))&&o.click()},()=>{if($(".paging_next").attr("style").includes("block"))return $(".paging_next").click(),!0}).fillAnswer()},GLOBAL.delay)}var i=GM_getValue("rwl_userData");function z(){setTimeout(function(){try{(i=document.querySelector("#rwl-iqxin")).addEventListener("mousedown",function(e){i.style.transition="null";function t(e){i.style.left=e.clientX-o+"px",i.style.top=e.clientY-n+"px"}var o=e.clientX-i.offsetLeft,n=e.clientY-i.offsetTop;document.addEventListener("mousemove",t),document.addEventListener("mouseup",function(){i.style.transition="0.3s",document.removeEventListener("mousemove",t),i.offsetLeft,i.offsetWidth,i.style.right=G.positionRight="auto",i.style.left=G.positionLeft=0,G.positionTop=i.offsetTop,GM_setValue("rwl_userData",G)})})}catch(e){console.error("dragBtn函数 报错")}var i},1e3),document.querySelector("#rwl-setbtn").addEventListener("click",D),R.checked=!0,m()}function r(){var n=document.createElement("remove-web-limits-iqxin"),e=(n.id="rwl-iqxin",n.className="rwl-exempt",document.documentElement.clientHeight),e=G.positionTop>e?e-40:G.positionTop,e=(window.onresize=function(){var e=document.documentElement.clientHeight,e=G.positionTop>e?e-40:G.positionTop;n.style.top=e+"px"},n.style.cssText="position:fixed;top:"+(e=e<0?0:e)+"px;left:"+G.positionLeft+"px;right:"+G.positionRight+"px;",n.innerHTML='<qxinbutton type="qxinbutton" id="rwl-setbtn"> set </qxinbutton> <lalala style="cursor:move; font-size:12px;">限制解除</lalala> <input type="checkbox" name="" id="black_node" >',window.self===window.top&&(document.querySelector("body")?document.body:document.documentElement).appendChild(n),n.addEventListener("mouseover",function(){n.classList.add("rwl-active-iqxin")}),n.addEventListener("mouseleave",function(){setTimeout(function(){n.classList.remove("rwl-active-iqxin");var e=black_node.checked,t=GM_getValue("rwl_userData").data,o=function(t){for(let e=0;e<t.length;e++)if(~E.indexOf(t[e]))return e+1;return!1}(t);if(e&&!o)t=t.concat(E),G.waitUpload.push(E),G.currentURL=window.location.href,b(t),m();else{if(e||!o)return;t.splice(o-1,1),b(t),setTimeout(function(){window.location.reload(!0),console.log("刷新页面loading")},350)}},100)}),document.createElement("style")),t=(e.type="text/css","#rwl-iqxin{position:fixed;transform:translate(-95px,0);width:85px;height:25px;font-size:12px;font-weight: 500;font-family:Verdana, Arial, '宋体';color:#fff;background:#333;z-index:2147483647;margin: 0;opacity:0.05;transition:0.3s;overflow:hidden;user-select:none;text-align:center;white-space:nowrap;line-height:25px;padding:0 16px;border:1px solid #ccc;border-width:1px 1px 1px 0;border-bottom-right-radius:5px;box-sizing: content-box;}#rwl-iqxin input{margin: 0;padding: 0;vertical-align:middle;-webkit-appearance:checkbox;-moz-appearance:checkbox;position: static;clip: auto;opacity: 1;cursor: pointer;}#rwl-iqxin.rwl-active-iqxin{left: 0px;transform:translate(0,0);opacity: 0.9;height: 32px;line-height: 32px}#rwl-iqxin label{margin:0;padding:0;font-weight:500;}#rwl-iqxin #rwl-setbtn{margin: 0 4px 0 0;padding: 0 0 0 4px;border: none;border-radius: 2px;cursor: pointer;background: #fff;color: #000;} ");G.addBtn?e.innerHTML=t:e.innerHTML=t+"#rwl-iqxin{display:none}",document.querySelector("#rwl-iqxin")?document.querySelector("#rwl-iqxin").appendChild(e):GM_addStyle(t)}function D(){var e=document.querySelector("#rwl-setMenu");e?e.parentNode.removeChild(e):((e=GM_getValue("rwl_userData")).connectToTheServer,e.addBtn,(e=document.createElement("div")).id="rwl-setMenu",e.style.cssText="position: fixed;top: 100px;left: 50px;padding: 10px;background: #fff;border-radius: 4px;",GM_addStyle("#rwl-setMenuSave,#rwl-reset,#rwl-setMenuClose{margin: 0;padding: 0 2px;border: none;border-radius: 2px;cursor: pointer;background: #fff;color: #000;}#rwl-reset{border: 1px solid #666;}#rwl-setMenuSave{border: 1px solid green;}#rwl-setMenuClose{border: 1px solid red;}#rwl-setMenu{text-align:left;font-size:14px;z-index:999999;border: 1px solid cornflowerblue;}#rwl-setMenu p{margin:5px auto;} "),e.innerHTML="",document.body.appendChild(e),document.querySelector("#rwl-setMenuSave").addEventListener("click",I),document.querySelector("#rwl-setMenuClose").addEventListener("click",l),document.querySelector("#rwl-reset").addEventListener("click",N))}function I(){var e,t=document.querySelector("#rwl-setMenu #positiontop").value,o=document.querySelector("#rwl-setMenu #rwl-shortcut").selectedIndex,n=document.querySelector("#rwl-setMenu #btnchecked").checked,i=document.querySelector("#rwl-setMenu textarea").value;i?((e=GM_getValue("rwl_userData")).addBtn=n,e.data=JSON.parse(i),e.positionTop=parseInt(t),e.shortcut=parseInt(o),GM_setValue("rwl_userData",e),setTimeout(function(){window.location.reload()},300)):alert("输入为空"),l()}function N(){GM_deleteValue("rwl_userData"),window.location.reload()}function l(){var e=document.querySelector("#rwl-setMenu");e&&e.parentNode.removeChild(e)}function m(){if(T=x(),_=T.hook_eventNames.split("|"),k=T.unhook_eventNames.split("|"),L=_.concat(k),T.dom0&&(setInterval(h,1e4),setTimeout(h,1500),window.addEventListener("load",h,!0),h()),T.hook_addEventListener&&(EventTarget.prototype.addEventListener=f,document.addEventListener=f,O))for(let e=0;e<O.length;e++)O[e].contentWindow.document.addEventListener=f;if(T.hook_preventDefault&&(Event.prototype.preventDefault=function(){_.indexOf(this.type)<0&&B.apply(this,arguments)},O))for(let e=0;e<O.length;e++)O[e].contentWindow.Event.prototype.preventDefault=function(){_.indexOf(this.type)<0&&B.apply(this,arguments)};T.hook_set_returnValue&&Event.prototype.__defineSetter__("returnValue",function(){!0!==this.returnValue&&0<=_.indexOf(this.type)&&(this.returnValue=!0)}),T.add_css&&GM_addStyle('html, :not([class*="rwl-exempt"]) {-webkit-user-select:text!important; -moz-user-select:text!important;} :not([class*="rwl-exempt"]) ::selection {color:#fff; background:#3390FF!important;}')}function f(e,t,o){var n,i=this===document?F:U;0<=_.indexOf(e)?i.apply(this,[e,P,o]):0<=k.indexOf(e)?(void 0===this[n=M+e+(o?"t":"f")]&&(this[n]=[],i.apply(this,[e,o?W:H,o])),this[n].push(t)):i.apply(this,arguments)}function h(){T=x();var e,t=function(){var t,o=Array.prototype.slice.call(document.getElementsByTagName("*")),n=(o.push(document),document.querySelectorAll("frame"));if(n){O=n;for(let e=0;e<n.length;e++)t=Array.prototype.slice.call(n[e].contentWindow.document.querySelectorAll("*")),o.push(n[e].contentWindow.document),o=o.concat(t)}return o}();for(e in t)for(var o in L){var n="on"+L[o];"[object String]"!=Object.prototype.toString.call(t[e])&&null!==t[e][n]&&t[e][n]!==g&&(0<=k.indexOf(L[o])?(t[e][M+n]=t[e][n],t[e][n]=g):t[e][n]=null)}document.onmousedown=function(){return!0}}function P(e){return!0}function W(e){return y(e,this,M+e.type+"t")}function H(e){return y(e,this,M+e.type+"f")}function y(e,t,o){var n,i=t[o];for(n in i)i[n](e);return e.returnValue=!0}function g(e){return this[M+"on"+e.type](e),e.returnValue=!0}function b(e){e=e.filter(function(e){return 1<e.length}),G.data=e.sort(),GM_setValue("rwl_userData",G)}function x(){switch(E){case"chuangshi.qq.com":console.log("创世中文网 开始执行"),Array.prototype.each=function(e){for(var t=0;t<this.length;t++)this[t]=e(this[t],t,this);return this},Array.prototype.map=function(e){return[].concat(this).each(e)},RegExp.escape=function(e){return new String(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var e,t,o=document.querySelector(".bookreadercontent");o&&(n=function(e){if(""==e)return"请输入汉字";for(var t="",o=0;o<e.length;o++)t+="\\u"+parseInt(e[o].charCodeAt(0),10).toString(16);return t}(e=o.innerText),t={e2af:"4e09","e2af ":"4e0b",e2c9:"4e3b",e2d6:"4e48",e2b2:"4e4b",e2a6:"4e5f",e294:"4e8b",e2e9:"4e8c",e30a:"4e8e",e292:"4e94",e298:"4e9b",e2a2:"4ee3",e2f0:"4f46",e30e:"4f4d",e305:"4f53",e296:"4f5c",e2d3:"4f60",e2db:"4f7f",e29b:"516c",e2b0:"5176",e2ed:"51fa",e2eb:"5206",e2f1:"5229",e307:"5230",e2ce:"5236",e2e6:"524d",e2ea:"529b",e2a8:"52a0",e2a5:"5316",e2bd:"5341",e302:"539f",e2df:"53bb",e2c7:"53c8",e303:"53cd",e2ac:"53d1",e2f8:"53ea",e30b:"5404",e29c:"5408",e2d7:"540c",e2d8:"540e",e306:"5411",e2c5:"547d",e2b4:"56db",e2f9:"56e0",e2ca:"5730",e2ef:"5916",e2bc:"591a",e301:"5929",e29a:"597d",e2b7:"5b50",e2cc:"5b83",e2ee:"5b9a",e2ff:"5bb6",e2e8:"5c0f",e2d4:"5c31",e2d5:"5c55",e2a1:"5de5",e2a0:"5e73",e2fe:"5e74",e2c4:"5e76",e2c8:"5ea6",e2ae:"5efa",e304:"5f62",e291:"5f88",e2e2:"5f97",e2f2:"5fc3",e295:"6027",e2d9:"60c5",e2be:"60f3",e2c3:"610f",e30d:"6210",e2ba:"6216",e2fa:"6240",e29e:"628a",e2a7:"63d0",e2d2:"653f",e2ad:"6599",e2cd:"65b0",e2f3:"65b9"},i=new RegExp(function(e){var t,o=[];for(t in e)o.push(t);return o}(t).map(RegExp.escape).join("|"),"g"),n=(n=n.replace(i,function(e){return t[e]})).replace("u0",""),e=function(e){if(""==e)return"请输入十六进制unicode";e=e.split("\\u");for(var t="",o=0;o<e.length;o++)t+=String.fromCharCode(parseInt(e[o],16).toString(10));return t}(n),o.innerText=e);break;case"votetw.com":document.querySelectorAll(".mw-parser-output>div").forEach(function(e){e.setAttribute("style","")});break;case"www.myhtebooks.com":v(".fullimg");break;case"www.z3z4.com":v(".moviedownaddiv");break;case"huayu.baidu.com":v("#jqContextMenu");break;case"www.myhtlmebook.com":v("img.fullimg");break;case"zhihu.com":case"www.zhihu.com":return G.rules.rule_zhihu;case"t.bilibili.com":var n,i=document.querySelector(".description");i&&(n=i.querySelector(".content-ellipsis"),i.querySelector("a"),i.appendChild(n));break;case"www.uslsoftware.com":return v(".protect_contents-overlay"),v(".protect_alert"),G.rules.rule_plus;case"www.longmabookcn.com":return v(".fullimg"),G.rules.rule_plus;case"boke112.com":case"www.shangc.net":return G.rules.rule_plus}return G.rules.rule_def}function v(e){e=document.querySelector(e);e&&e.parentNode.removeChild(e)}var _,k,L,q,A={status:1,version:.1,message:"",positionTop:"0",positionLeft:"0",positionRight:"auto",addBtn:!(document.onkeydown=function(){var e=window.event.keyCode;if(112==e&&1==i.shortcut)return event.preventDefault(),setClipboard(),event.keyCode=0,event.returnValue=!1;112==e&&event.ctrlKey&&2==i.shortcut||67==e&&event.ctrlKey&&3==i.shortcut?setClipboard():console.log("关闭了快捷键")}),connectToTheServer:!1,waitUpload:[],currentURL:"null",shortcut:3,rules:{rule_def:{name:"default",hook_eventNames:"contextmenu|select|selectstart|copy|cut|dragstart|mousemove|beforeunload",unhook_eventNames:"mousedown|mouseup|keydown|keyup",dom0:!0,hook_addEventListener:!0,hook_preventDefault:!0,hook_set_returnValue:!0,add_css:!0},rule_plus:{name:"default",hook_eventNames:"contextmenu|select|selectstart|copy|cut|dragstart|mousedown|mouseup|mousemove|beforeunload",unhook_eventNames:"keydown|keyup",dom0:!0,hook_addEventListener:!0,hook_preventDefault:!0,hook_set_returnValue:!0,add_css:!0},rule_zhihu:{name:"default",hook_eventNames:"contextmenu|select|selectstart|copy|cut|dragstart|mousemove",unhook_eventNames:"keydown|keyup",dom0:!0,hook_addEventListener:!0,hook_preventDefault:!0,hook_set_returnValue:!0,add_css:!0}},data:["b.faloo.com","bbs.coocaa.com","book.hjsm.tom.com","book.zhulang.com","book.zongheng.com","chokstick.com","chuangshi.qq.com","city.udn.com","cutelisa55.pixnet.net","huayu.baidu.com","imac.hk","life.tw","luxmuscles.com","news.missevan.com","read.qidian.com","www.15yan.com","www.17k.com","www.18183.com","www.360doc.com","www.coco01.net","www.eyu.com","www.hongshu.com","www.hongxiu.com","www.imooc.com","www.jjwxc.net","www.readnovel.com","www.tadu.com","www.xxsy.net","www.z3z4.com","www.zhihu.com","yuedu.163.com","www.ppkao.com","movie.douban.com","www.ruiwen.com","vipreader.qidian.com","www.pigai.org","www.shangc.net","www.myhtlmebook.com","www.yuque.com","www.longmabookcn.com","www.alphapolis.co.jp","www.sdifen.com","votetw.com","boke112.com","www.myhtebooks.com","www.xiegw.cn","chuangshi.qq.com","www.uta-net.com","www.bimiacg.net"]},G=null,E=window.location.hostname,R=null,T=null,O=!1,M="iqxinStorageName",U=EventTarget.prototype.addEventListener,F=document.addEventListener,B=Event.prototype.preventDefault;for(q in G=(G=GM_getValue("rwl_userData"))||A,A)G.hasOwnProperty(q)||(G[q]=A[q],GM_setValue("rwl_userData",G));function J(){try{$.each(C.instants,function(){var e=this.key;this.ready(function(){this.destroy(),C.getEditor(e)})})}catch(e){}var e=setInterval(function(){document.getElementById("black_node")?(clearInterval(e),z()):r()},500)}function X(){console.log("我走到这;zhsExam"),e(),setTimeout(()=>{new o({root:".examPaper_subject",elements:{question:".subject_describe div",options:".subject_node .nodeLab .node_detail",$options:".subject_node .nodeLab",type:".subject_type span:eq(0)"}},e=>{if(e.question=e.question.get(0).__vue__._data.shadowDom.textContent,e.type=t[e.type.match("【(.*)】")[1]],1===e.type&&$.each(e.$options,(e,t)=>{$(t).find(".node_detail").hasClass("onChecked")&&$(t).click()}),!$(".yidun_popup").hasClass("yidun_popup--light"))return e;console.log("我到这了",GLOBAL.loop),p("tip",{type:"stop",tip:"答题暂停,请自行通过验证"}),clearInterval(GLOBAL.loop),delete GLOBAL.loop},(e,t,o)=>{0!==e&&3!==e&&1!==e||o.click()},()=>{setTimeout(()=>{$(".el-button:contains(保存)").click()},GLOBAL.time/3)},()=>{setTimeout(()=>{$(".el-button:contains(下一题)").click()},GLOBAL.time/3)}).fillAnswer()},1.5*GLOBAL.delay)}(S=GM_getValue("black_list"))&&(G.data=function(e){for(var t=[],o=0;o<e.length;o++){var n=e[o];-1===t.indexOf(n)&&t.push(n)}return t}(G.data.concat(S.data)),GM_setValue("rwl_userData",G),GM_deleteValue("black_list"),GM_deleteValue("rwl_userdata")),G.data.filter(function(e){return 1<e.length}),r();var R=document.getElementById("black_node"),j=unsafeWindow;s.top=j;try{for(;s.top!==j.top&&(s.top=s.top.parent.document?s.top.parent:j.top,"/mycourse/studentstudy"!==s.top.location.pathname););}catch(e){s.top=j}var S=j===s.top?self:j.parent,Y=j.Ext||S.Ext||{},C=j.UE;s.top.addEventListener("message",e=>{if(console.log("监听器的",GLOBAL),"jump"!==e.data.type)if("stop"===e.data.type)if(e.data.val){let e=setInterval(()=>{GLOBAL.loop&&(clearInterval(GLOBAL.loop),delete GLOBAL.loop,clearInterval(e))},20)}else GLOBAL.loop=setInterval(GLOBAL.setInterval,GLOBAL.time);else"start_pay"===e.data.type?(GM_setValue("start_pay",e.data.flag),p("tip",{tip:"已"+(e.data.flag?"开启":"关闭")+"请求收费题库,已实时生效"})):"auto_jump"===e.data.type?(GM_setValue("auto_jump",e.data.flag),p("tip",{tip:"已"+(e.data.flag?"开启":"关闭")+"自动切换,页面刷新后生效"})):"confim"===e.data.type?GM_setValue("token",e.data.token):"jump"===e.data.type&&(GLOBAL.index++,p("tip",{tip:"准备答第"+(GLOBAL.index+1)+"题"}))},!1),setTimeout(()=>{J()},GLOBAL.time),"/exam/examflow_index.action"===location.pathname||"exam/examflow_index.action"===location.pathname?V():"/exam/test/reVersionTestStartNew"!==location.pathname&&"/exam-ans/exam/test/reVersionTestStartNew"!==location.pathname||!location.href.includes("newMooc=true")?"/work/doHomeWorkNew"===location.pathname?(e(),setTimeout(()=>{new o({root:".clearfix .TiMu",elements:{question:".Zy_TItle .clearfix",options:"ul:eq(0) li .after",$options:"ul:eq(0) li :radio,:checkbox,textarea",type:"input[name^=answertype]"}},e=>(e.type=parseInt(e.type),3===e.type&&(e.options=["正确","错误"]),e),(e,t,o)=>{0===e||3===e||1===e?o.get(0).click():4!==e&&2!==e||C.getEditor(o.attr("name")).setContent(t)}).fillAnswer()},GLOBAL.delay)):"/mooc2/exam/preview"===location.pathname||"/exam-ans/mooc2/exam/preview"===location.pathname?n(0):"/study/workExam/testWork/preview.html"===location.pathname?(e(),setTimeout(()=>{new o({root:".e-q-r",elements:{question:".e-q-q .ErichText",options:".e-a-g .ErichText",$options:"li",type:".quiz-type"}},e=>(e.type=t[e.type],console.log(e),e),(e,t,o)=>{0!==e&&3!==e&&(1!==e||o.attr("class").includes("checked"))||o.click()},()=>{}).fillAnswer()},GLOBAL.delay)):"/stuExamWeb.html"===location.pathname&&location.href.includes("/webExamList/dohomework/")||"/stuExamWeb.html"===location.pathname&&location.href.includes("/webExamList/doexamination/")?X():"/web/index.php"===location.pathname&&(console.log("我走到这;ybkExam"),e(),setTimeout(()=>{new o({root:".topic-item",elements:{question:".t-con .t-subject",options:".t-option  .el-radio__label .option-content",$options:".t-option .el-radio__input .nodeLab",type:".t-info .t-type"}},e=>(e.type=t[e.type],e),(e,t,o)=>{0!==e&&3!==e&&1!==e||o.click()},()=>{setTimeout(()=>{$(".el-button:contains(保存)").click()},GLOBAL.time/3)},()=>{setTimeout(()=>{$(".el-button:contains(下一题)").click()},GLOBAL.time/3)}).fillAnswer()},1.5*GLOBAL.delay)):n(1),s.Ext=Y,s.UE=C,s._self=j,s.parent=S,Object.defineProperty(s,"__esModule",{value:!0})}({});