超星网课助手(新)(最新题库) was reported 2020-11-11 by nfsq as an unauthorized copy of 超星网课助手(改)(查题可用).

nfsqBanned said:
Migrated from script report 5280 https://greasyfork.org/zh-CN/scripts/401447-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B-%E6%94%B9-%E6%9F%A5%E9%A2%98%E5%8F%AF%E7%94%A8 直接未经允许使用COPY我的脚本接口
No-one said:
Dear GF administrator: The script is completely open source, free, NO ADS and is available under the MIT License. It was modified from https://greasyfork.org/zh-CN/scripts/369625-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B , which uses the MIT License too and is created at 2018-06-19. Since https://greasyfork.org/zh-CN/scripts/369625-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B is out of maintenance for a long time, we modified the script, fix many bugs and continue to serving the users. And for all we know, many scripts, including the whistleblowers' script, are modified from https://greasyfork.org/zh-CN/scripts/369625-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B too. 尊敬的GF管理员: 本脚本完全开源免费,无广告,且遵循MIT许可协议。本脚本修改自 https://greasyfork.org/zh-CN/scripts/369625-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B ,原脚本创建于2018年,遵循MIT许可协议。 由于原脚本已停止维护,本脚本在原脚本的基础上修改了若干bug,继续为大家服务。据我们所知,很多脚本,包括举报者的脚本,都是在这个脚本上修改的。
Script License Created Updated
Reported 超星网课助手(新)(最新题库) MIT 2020-10-13 03:37:48 UTC 2020-11-15 00:56:49 UTC
Original 超星网课助手(改)(查题可用) MIT 2020-04-20 00:30:43 UTC 2020-11-21 09:00:53 UTC
  • // ==UserScript==
  • -// @name 超星网课助手(改)(查题可用)
  • -// @version 4.7.2
  • -// @namespace coder_tq
  • -// @description 自动挂机看尔雅MOOC,支持视频、音频、文档、图书自动完成,章节测验自动答题提交,支持自动切换任务点、挂机阅读时长、自动登录等,解除各类功能限制,开放自定义参数
  • -// @author coder_tq
  • +// @name 超星网课助手(新)(最新题库)
  • +// @version 1.0.5
  • +// @namespace hurricane
  • +// @description 更新了新学期题库,完全免费,无广告,无引流,每天更新10w+题目!自动挂机看尔雅MOOC,支持视频、音频、文档、图书自动完成,章节测验自动答题提交,支持自动切换任务点、挂机阅读时长、自动登录等,解除各类功能限制,开放自定义参数
  • +// @author hurricane
  • // @match *://*.chaoxing.com/*
  • // @match *://*.edu.cn/*
  • // @match *://*.nbdlib.cn/*
  • // @match *://*.hnsyu.net/*
  • -// @connect work.52msr.cn
  • -// @connect cx.beaa.cn
  • -// @connect cx.icodef.com
  • +// @connect cx.kinghenet.cn
  • +// @connect aliyuncs.com
  • // @run-at document-end
  • // @grant unsafeWindow
  • // @grant GM_xmlhttpRequest
  • // @grant GM_setValue
  • // @grant GM_getValue
  • // @grant GM_setClipboard
  • +// @require https://cdn.staticfile.org/jsencrypt/2.3.1/jsencrypt.min.js
  • // @license MIT
  • // ==/UserScript==
  • var setting = {
  • // 5E3 == 5000,科学记数法,表示毫秒数
  • time: 5E3 // 默认响应速度为5秒,不建议小于5秒
  • - , token: '' // token可以增加并发次数,用来打码,采集题库奖励.这不是必须申请的,没有token也可以正常使用.token是我们识别用户的一个令牌,脚本会收集你的正确答案,我们会用token来对这些数据进行统计和拦截恶意的提交.另外会用token进行限流操作(ip不可靠),防止恶意的进行cc攻击和误拦截.
  • + , token: '' // token可以增加并发次数,用来打码,采集题库奖励
  • , review: 0 // 复习模式,完整挂机视频(音频)时长,支持挂机任务点已完成的视频和音频,默认关闭
  • , queue: 1 // 队列模式,开启后任务点逐一完成,关闭则单页面所有任务点同时进行,默认开启
  • , rate: '1' // 视频播放默认倍率,参数范围0∪[0.0625,16],'0'为秒过,默认'1'倍
  • // 仅开启work时,修改此处才会生效
  • - // auto: 1 已放置面板,请在面板配置,默认为自动提交 // 答题完成后自动提交,默认开启
  • + , auto: 1 // 答题完成后自动提交,默认关闭
  • , none: 0 // 无匹配答案时执行默认操作,关闭后若题目无匹配答案则会暂时保存已作答的题目,默认开启
  • , scale: 0 // 富文本编辑器高度自动拉伸,用于文本类题目,答题框根据内容自动调整大小,默认关闭
  • url = location.pathname,
  • top = _self;
  • -var tmpSubmit = 1;//本次
  • -Object.defineProperty(setting, "auto", {
  • - get: function () {
  • - if (tmpSubmit >= 2) {
  • - return tmpSubmit === 3;
  • - }
  • - return GM_getValue("autosubmit");
  • - }, set: function (value) {
  • - tmpSubmit = value + 2;
  • +function getCookie(name) {
  • + var nameEQ = name + "=";
  • + var ca = document.cookie.split(';');
  • + for(var i=0;i < ca.length;i++) {
  • + var c = ca[i];
  • + while (c.charAt(0)==' ') c = c.substring(1,c.length);
  • + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  • + }
  • + return null;
  • +}
  • +if(location.search.match(/cpi=(\d+)/i)){
  • + GM_setValue('cpi',location.search.match(/cpi=(\d+)/i)[1]);
  • }
  • -});
  • -
  • setting.notice = '公告栏';
  • +initNotice();
  • if (url != '/studyApp/studying' && top != _self.top) document.domain = location.host.replace(/.+?\./, '');
  • try {
  • setting.tip = !setting.queue || top != _self && jobSort($ || Ext.query);
  • +
  • if (url == '/mycourse/studentstudy') {
  • _self.checkMobileBrowerLearn = $.noop;
  • var classId = location.search.match(/cla[zs]{2}id=(\d+)/i)[1] || 0,
  • setting.username && getSchoolId();
  • } else if (location.hostname == 'i.mooc.chaoxing.com') {
  • _self.layui.use('layer', function () {
  • - this.layer.open({ content: '拖动进度条、倍速播放、秒过会导致不良记录!题库在慢慢补充,搜不到的题目系统会在次日进行自动补充', title: '超星网课助手提示', btn: '我已知悉', offset: 't', closeBtn: 0 });
  • + this.layer.open({ content: '拖动进度条、倍速播放、秒过会导致不良记录!', title: '超星网课助手提示', btn: '我已知悉', offset: 't', closeBtn: 0 });
  • });
  • } else if (url == '/widget/pcvote/goStudentVotePage') {
  • $(':checked').click();
  • });
  • } else if (url == '/work/selectWorkQuestionYiPiYue') {
  • submitAnswer(getIframe().parent(), $.extend(true, [], parent._data));
  • +} else if (url == '/mooc2/work/view') {
  • + submitAnswer(getIframe().parent(), $.extend(true, [], parent._data));
  • }
  • function getIframe(tip, win, job) {
  • '<button style="margin-right: 10px;">' + (setting.auto ? '取消本次自动提交' : '开启本次自动提交') + '</button>' +
  • '<button style="margin-right: 10px;">重新查询</button>' +
  • '<button>折叠面板</button><br>' +
  • - '<input id="autosubmit" type="checkbox"' + (setting.auto ? ' checked' : '') + '>自动提交</input>' +
  • '<div style="max-height: 300px; overflow-y: auto;">' +
  • '<table border="1" style="font-size: 12px;">' +
  • '<thead>' +
  • '</table>' +
  • '</div>' +
  • '</div>'
  • - ).appendTo('body').on('click', 'button, td, input', function () {
  • + ).appendTo('body').on('click', 'button, td', function () {
  • var len = $(this).prevAll('button').length;
  • if (this.nodeName == 'TD') {
  • $(this).prev().length && GM_setClipboard($(this).text());
  • delete setting.loop;
  • len = ['已暂停搜索', '继续答题'];
  • } else {
  • - setting.loop = setInterval(findAnswer, setting.time);
  • + setting.loop = setInterval(findAnswer2, setting.time);
  • len = ['正在搜索答案...', '暂停答题'];
  • }
  • setting.div.children('div:eq(0)').html(function () {
  • parent.location.reload();
  • } else if (len == 3) {
  • setting.div.find('tbody, tfoot').toggle();
  • - } else if (this.id == "autosubmit") {
  • - // 题目自动提交配置
  • - console.log(this.checked);
  • - GM_setValue("autosubmit", this.checked);
  • + } else if (len == 4) {
  • + setting.tk_num++;
  • + GM_setValue('tk_num_1', setting.tk_num);
  • + setting.tk_num = GM_getValue('tk_num_1');
  • + console.log(setting.tk_num);
  • + parent.location.reload();
  • }
  • }).on('click', 'minimize', function () {
  • $(this).parent().parent().css("display", "none");
  • setting.data = parent._data = [];
  • setting.over = '<button style="margin-right: 10px;">跳过此题</button>';
  • setting.curs = $('script:contains(courseName)', top.document).text().match(/courseName:\'(.+?)\'|$/)[1] || $('h1').text().trim() || '无';
  • - setting.loop = setInterval(findAnswer, setting.time);
  • + setting.loop = setInterval(findAnswer2, setting.time);
  • var tip = ({ undefined: '任务点排队中', null: '等待切换中' })[setting.tip];
  • tip && setting.div.children('div:eq(0)').data('html', tip).siblings('button:eq(0)').click();
  • -
  • - GM_xmlhttpRequest({
  • - method: 'GET',
  • - url: 'http://cx.icodef.com/update?s=wyn',
  • - timeout: setting.time,
  • - onload: function (xhr) {
  • - if (xhr.status == 200) {
  • - var obj = $.parseJSON(xhr.responseText) || {};
  • - setting.notice = obj.injection;
  • - document.querySelector('#cx-notice').innerHTML = setting.notice;
  • - }
  • - },
  • - ontimeout: function () {
  • - setting.loop && setting.div.children('div:eq(0)').html(setting.over + '服务器超时,正在重试...');
  • - }
  • - });
  • }
  • -function findAnswer() {
  • - if (setting.num >= $('.TiMu').length) {
  • - var arr = setting.lose ? ['共有 <font color="red">' + setting.lose + '</font> 道题目待完善(已深色标注)', saveThis] : ['答题已完成', submitThis];
  • - setting.div.children('div:eq(0)').data('html', arr[0]).siblings('button:eq(0)').hide().click();
  • - return setTimeout(arr[1], setting.time);
  • - }
  • - var $TiMu = $('.TiMu').eq(setting.num),
  • - question = filterImg($TiMu.find('.Zy_TItle:eq(0) .clearfix')).replace(/^【.*?】\s*/, '').replace(/\s*(\d+\.\d+分)$/, '').replace(/[(]\s*[)]。$/, '').replace(/(\s*)。$/, '').replace(/[(]\s*[)]$/, '').replace(/(\s*)$/, '').replace(/。$/, ''),
  • - type = $TiMu.find('input[name^=answertype]:eq(0)').val() || '-1';
  • - console.log("正在使用1号题库查询");
  • -
  • - GM_xmlhttpRequest({
  • - method: 'POST',
  • - url: 'http://cx.icodef.com/wyn-nb',
  • - headers: {
  • - 'Content-type': 'application/x-www-form-urlencoded',
  • - 'Authorization': setting.token,
  • - },
  • - data: 'question=' + encodeURIComponent(question) + '&type=' + type + '&id=' + ($('#workLibraryId').val() || $('#oldWorkId').val()),
  • - timeout: setting.time,
  • - onload: function (xhr) {
  • - if (!setting.loop) {
  • - } else if (xhr.status == 200) {
  • - var obj = $.parseJSON(xhr.responseText) || {};
  • - obj.answer = obj.data;
  • - if (obj.code == 1) {
  • - setting.div.children('div:eq(0)').text('正在搜索答案...');
  • - var td = '<td style="border: 1px solid;',
  • - answer = String(obj.answer).replace(/&/g, '&amp;').replace(/<(?!img)/g, '&lt;');
  • - obj.answer = /^http/.test(answer) ? '<img src="' + obj.answer + '">' : obj.answer;
  • - $(
  • - '<tr>' +
  • - td + ' text-align: center;">' + $TiMu.find('.Zy_TItle:eq(0) i').text().trim() + '</td>' +
  • - td + '" title="点击可复制">' + (question.match('<img') ? question : question.replace(/&/g, '&amp;').replace(/</g, '&lt')) + '</td>' +
  • - td + '" title="点击可复制">' + (/^http/.test(answer) ? obj.answer : '') + answer + '</td>' +
  • - '</tr>'
  • - ).appendTo(setting.div.find('tbody')).css('background-color', fillAnswer($TiMu.find('ul:eq(0)').find('li'), obj, type) ? '' : 'rgba(0, 150, 136, 0.6)');
  • - setting.data[setting.num++] = {
  • - code: obj.code > 0 ? 1 : 0,
  • - question: question,
  • - option: obj.answer,
  • - type: Number(type)
  • - };
  • - } else {
  • - findAnswer2();
  • - }
  • - setting.div.children('span').html(obj.msg || '');
  • - } else {
  • - findAnswer2();
  • - }
  • - },
  • - ontimeout: function () {
  • - findAnswer2();
  • - }
  • - });
  • -}
  • -function findAnswer2() {
  • - if (setting.num >= $('.TiMu').length) {
  • - var arr = setting.lose ? ['共有 <font color="red">' + setting.lose + '</font> 道题目待完善(已深色标注)', saveThis] : ['答题已完成', submitThis];
  • - setting.div.children('div:eq(0)').data('html', arr[0]).siblings('button:eq(0)').hide().click();
  • - return setTimeout(arr[1], setting.time);
  • - }
  • - var $TiMu = $('.TiMu').eq(setting.num),
  • - question = filterImg($TiMu.find('.Zy_TItle:eq(0) .clearfix')).replace(/^【.*?】\s*/, '').replace(/\s*(\d+\.\d+分)$/, '').replace(/[(]\s*[)]。$/, '').replace(/(\s*)。$/, '').replace(/[(]\s*[)]$/, '').replace(/(\s*)$/, '').replace(/。$/, ''),
  • - type = $TiMu.find('input[name^=answertype]:eq(0)').val() || '-1';
  • -
  • - console.log("正在使用2号题库查询");
  • -
  • - GM_xmlhttpRequest({
  • - method: 'POST',
  • - url: 'http://work.52msr.cn/new/cx.php',
  • - headers: {
  • - 'Content-type': 'application/x-www-form-urlencoded',
  • - 'Authorization': setting.token,
  • - },
  • - data: 'content=' + question.replace(/^<img src="/,'').replace(/>$/,'') + '&type=' + type + '&id=' + ($('#workLibraryId').val() || $('#oldWorkId').val()),
  • - timeout: setting.time,
  • - onload: function (xhr) {
  • - if (!setting.loop) {
  • - } else if (xhr.status == 200) {
  • - var obj = $.parseJSON(xhr.responseText) || {};
  • - if (obj.code) {
  • - setting.div.children('div:eq(0)').text('正在搜索答案...');
  • - var td = '<td style="border: 1px solid;',
  • - answer = String(obj.answer).replace(/&/g, '&amp;').replace(/<(?!img)/g, '&lt;');
  • - obj.answer = /^http/.test(answer) ? '<img src="' + obj.answer + '">' : obj.answer;
  • - $(
  • - '<tr>' +
  • - td + ' text-align: center;">' + $TiMu.find('.Zy_TItle:eq(0) i').text().trim() + '</td>' +
  • - td + '" title="点击可复制">' + (question.match('<img') ? question : question.replace(/&/g, '&amp;').replace(/</g, '&lt')) + '</td>' +
  • - td + '" title="点击可复制">' + (/^http/.test(answer) ? obj.answer : '') + answer + '</td>' +
  • - '</tr>'
  • - ).appendTo(setting.div.find('tbody')).css('background-color', fillAnswer($TiMu.find('ul:eq(0)').find('li'), obj, type) ? '' : 'rgba(0, 150, 136, 0.6)');
  • - setting.data[setting.num++] = {
  • - code: obj.code > 0 ? 1 : 0,
  • - question: question,
  • - option: obj.answer,
  • - type: Number(type)
  • - };
  • - } else {
  • - setting.div.children('div:eq(0)').html(obj.answer || setting.over + '服务器繁忙,正在重试...');
  • - }
  • - setting.div.children('span').html(obj.msg || '');
  • - } else if (xhr.status == 403) {
  • - var html = xhr.responseText.indexOf('{') ? '请求过于频繁,请稍后再试' : $.parseJSON(xhr.responseText).data;
  • - setting.div.children('div:eq(0)').data('html', html).siblings('button:eq(0)').click();
  • - } else {
  • - setting.div.children('div:eq(0)').html('题库异常,可能被恶意攻击了...请等待恢复');
  • - }
  • - },
  • - ontimeout: function () {
  • - setting.loop && setting.div.children('div:eq(0)').html(setting.over + '服务器超时,正在重试...');
  • - }
  • - });
  • -}
  • function fillAnswer($li, obj, type) {
  • var $input = $li.find(':radio, :checkbox'),
  • });
  • }
  • -function submitAnswer($job, data) {
  • - $job.removeClass('ans-job-finished');
  • - data = data.length ? $(data) : $('.TiMu').map(function () {
  • - var title = filterImg($('.Zy_TItle .clearfix', this));
  • - return {
  • - question: title.replace(/^【.*?】\s*/, ''),
  • - type: ({ 单选题: 0, 多选题: 1, 填空题: 2, 判断题: 3 })[title.match(/^【(.*?)】|$/)[1]]
  • +function filterImg(dom) {
  • + return $(dom).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') + '"></iframe>');
  • + }).end().text().trim();
  • +}
  • +if (!String.prototype.cordwood) {
  • + String.prototype.cordwood = function(cordlen) {
  • + if (cordlen === undefined || cordlen > this.length) {
  • + cordlen = this.length;
  • + }
  • + var yardstick = new RegExp(`.{${cordlen}}`, 'g');
  • + var pieces = this.match(yardstick);
  • + var accumulated = (pieces.length * cordlen);
  • + var modulo = this.length % accumulated;
  • + if (modulo) pieces.push(this.slice(accumulated));
  • + return pieces;
  • };
  • +}
  • +
  • +function initNotice(){
  • + GM_xmlhttpRequest({
  • + method: 'GET',
  • + url: 'http://cx.kinghenet.cn/api/update',
  • + timeout: setting.time,
  • + onload: function (xhr) {
  • + if (xhr.status == 200) {
  • + var obj = $.parseJSON(xhr.responseText) || {};
  • + setting.notice = obj.injection;
  • + document.querySelector('#cx-notice').innerHTML = setting.notice;
  • + }
  • + },
  • + ontimeout: function () {
  • + setting.loop && setting.div.children('div:eq(0)').html(setting.over + '服务器超时,正在重试...');
  • + }
  • });
  • - data = $.grep(data.map(function (index) {
  • - var $TiMu = $('.TiMu').eq(index);
  • - if (!($.isPlainObject(this) && this.type < 4 && $TiMu.find('.fr').length)) {
  • - return false;
  • - } else if (this.type == 2) {
  • - var $ans = $TiMu.find('.Py_tk, .Py_answer').eq(0);
  • - if (!$TiMu.find('.cuo').length && this.code) {
  • - return false;
  • - } else if (!$ans.find('.cuo').length) {
  • - this.option = $ans.find('.clearfix').map(function () {
  • - return $(this).text().trim();
  • - }).get().join('#') || '无';
  • - } else if (this.code) {
  • - this.code = -1;
  • - } else {
  • - return false;
  • +};
  • +
  • +function my_encode(data){
  • + var public_key = "" + "-----BEGIN PUBLIC KEY-----" +
  • + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZDIcgiijK35yN2PQSXXShDtKE" +
  • + "0L+i4fE4aPF/vm7P+iCF5Y717uh9kQE4Itk4PFD7Pal5M4c086LoC8X4pv+9VhTr" +
  • + "OQ4a428VfgvGTHSwerxx4TcRp2UHxtNm5t6msJyKNERYlPPy0pOQomGm/54nNZzt" + "0DYE4pOYf93D+EfCTwIDAQAB" +
  • + "-----END PUBLIC KEY-----";
  • + var encrypt = new JSEncrypt();
  • + encrypt.setPublicKey(public_key);
  • + var encode_data = [];
  • +data.cordwood(100).forEach((item,index,array)=>{
  • + encode_data.push(encrypt.encrypt(item))
  • +})
  • +return encode_data;
  • }
  • - } else if (this.type == 3) {
  • - var ans = $TiMu.find('.font20:last').text();
  • - if ($TiMu.find('.cuo').length) {
  • - this.option = ({ '√': '错误', '×': '正确' })[ans] || '';
  • - } else if (!this.code) {
  • - this.option = ({ '√': '正确', '×': '错误' })[ans] || '无';
  • - } else {
  • - return false;
  • +function findAnswer2() {
  • + if (setting.num >= $('.TiMu').length) {
  • + var arr = setting.lose ? ['共有 <font color="red">' + setting.lose + '</font> 道题目待完善(已深色标注)', saveThis] : ['答题已完成', submitThis];
  • + setting.div.children('div:eq(0)').data('html', arr[0]).siblings('button:eq(0)').hide().click();
  • + return setTimeout(arr[1], setting.time);
  • + }
  • + var $TiMu = $('.TiMu').eq(setting.num),
  • + ori_question = $TiMu.find('.Zy_TItle:eq(0)').clone().find('img[src]').replaceWith(function () {
  • + return $('<p></p>').text('<img src="' + $(this).attr('src') + '">');
  • + }).end().html(),
  • + question = filterImg($TiMu.find('.Zy_TItle:eq(0) .clearfix')).replace(/^【.*?】\s*/, '').replace(/\s*(\d+\.\d+分)$/, '').replace(/[(]\s*[)]。$/, '').replace(/(\s*)。$/, '').replace(/[(]\s*[)]$/, '').replace(/(\s*)$/, '').replace(/。$/, ''),
  • + type = $TiMu.find('input[name^=answertype]:eq(0)').val() || '-1';
  • + var enc = document.getElementsByTagName('html')[0].outerHTML.match(/ueditorupload\/upload-image.*?"\&enc=(.*?)\&/i)[1];
  • + var t = document.getElementsByTagName('html')[0].outerHTML.match(/ueditorupload\/upload-image.*?\&t=(\d*)\&uploadtype=work/i)[1];
  • + var data = {
  • + 'uid': getCookie('_uid'),
  • + 'uname': getCookie('uname'),
  • + 'd': getCookie('_d'),
  • + 'cpi' : GM_getValue('cpi'),
  • + 'enc': enc,
  • + 't' : t,
  • + 'courseId': $('#courseId').val(),
  • + 'question': ori_question,
  • + 'title': question,
  • + 'type': type,
  • + 'workid': ($('#workLibraryId').val() || $('#oldWorkId').val())
  • }
  • + var encode_data = JSON.stringify(my_encode(encodeURIComponent(JSON.stringify(data))))
  • + GM_xmlhttpRequest({
  • + method: 'POST',
  • + url: 'http://cx.kinghenet.cn/api/cx',
  • + headers: {
  • + 'Content-type': 'application/x-www-form-urlencoded',
  • + 'Authorization': setting.token,
  • + },
  • + // data: 'uid='+getCookie('_uid')+'&uname=' + getCookie('uname')+'&d=' + getCookie('_d')+'&cpi='+GM_getValue('cpi')+'&enc=' + enc+'&t='+t+'&courseId=' + $('#courseId').val()+ '&question=' + encodeURIComponent(ori_question)+ '&title=' + encodeURIComponent(question) + '&type=' + type + '&workid=' + ($('#workLibraryId').val() || $('#oldWorkId').val()),
  • + data:'data='+encodeURIComponent(encode_data),
  • + timeout: setting.time,
  • + onload: function (xhr) {
  • + if (!setting.loop) {
  • + } else if (xhr.status == 200) {
  • + var obj = $.parseJSON(xhr.responseText) || {};
  • + obj.answer = obj.data;
  • + if (obj.code) {
  • + setting.div.children('div:eq(0)').text('正在搜索答案...');
  • + var td = '<td style="border: 1px solid;',
  • + answer = String(obj.answer).replace(/&/g, '&amp;').replace(/<(?!img)/g, '&lt;');
  • + obj.answer = /^http/.test(answer) ? '<img src="' + obj.answer + '">' : obj.answer;
  • + $(
  • + '<tr>' +
  • + td + ' text-align: center;">' + $TiMu.find('.Zy_TItle:eq(0) i').text().trim() + '</td>' +
  • + td + '" title="点击可复制">' + (question.match('<img') ? question : question.replace(/&/g, '&amp;').replace(/</g, '&lt')) + '</td>' +
  • + td + '" title="点击可复制">' + (/^http/.test(answer) ? obj.answer : '') + answer + '</td>' +
  • + '</tr>'
  • + ).appendTo(setting.div.find('tbody')).css('background-color', fillAnswer($TiMu.find('ul:eq(0)').find('li'), obj, type) ? '' : 'rgba(0, 150, 136, 0.6)');
  • + setting.data[setting.num++] = {
  • + code: obj.code > 0 ? 1 : 0,
  • + question: question,
  • + option: obj.answer,
  • + type: Number(type)
  • + };
  • } else {
  • - var text = $TiMu.find('.Py_answer > span:eq(0)').text();
  • - if ($TiMu.find('.dui').length && this.code && !/^A?B?C?D?E?F?G?$/.test(this.option)) {
  • - return false;
  • - } else if ($TiMu.find('.dui').length || text.match('正确答案')) {
  • - text = text.match(/[A-G]/gi) || [];
  • - this.option = $.map(text, function (value) {
  • - return filterImg($TiMu.find('.fl:contains(' + value + ') + a'));
  • - }).join('#') || '无';
  • - this.key = text.join('');
  • - } else if (this.code) {
  • - this.code = -1;
  • + setting.div.children('div:eq(0)').html(obj.answer || setting.over + '服务器繁忙,正在重试...');
  • + }
  • + setting.div.children('span').html(obj.msg || '');
  • + } else if (xhr.status == 403) {
  • + var html = xhr.responseText.indexOf('{') ? '请求过于频繁,等一会儿试试吧' : $.parseJSON(xhr.responseText).data;
  • + setting.div.children('div:eq(0)').data('html', html).siblings('button:eq(0)').click();
  • } else {
  • - return false;
  • + setting.div.children('div:eq(0)').html('题库异常,联系作者...');
  • }
  • + },
  • + ontimeout: function () {
  • + setting.loop && setting.div.children('div:eq(0)').html(setting.over + '服务器超时,正在重试...');
  • }
  • - return this;
  • - }), function (value) {
  • - return value && value.option != '无';
  • });
  • - setting.curs = $('script:contains(courseName)', top.document).text().match(/courseName:\'(.+?)\'|$/)[1] || $('h1').text().trim() || '无';
  • - data.length && GM_xmlhttpRequest({
  • +}
  • +
  • +function submitAnswer($job, data) {
  • + $job.removeClass('ans-job-finished');
  • + GM_xmlhttpRequest({
  • method: 'POST',
  • - url: 'http://cx.icodef.com/upload/cx?workRelationId=' + $('#workId').val(),
  • + url: 'http://cx.kinghenet.cn/api/upload/cx?workRelationId=' + $('#workId').val(),
  • headers: {
  • 'Content-type': 'application/x-www-form-urlencoded',
  • 'Authorization': setting.token,
  • },
  • - data: 'course=' + encodeURIComponent(setting.curs) + '&data=' + encodeURIComponent((Ext.encode || JSON.stringify)(data)) + '&id=' + $('#jobid').val().slice(5)
  • + data: 'url=' + encodeURIComponent(location.href) + '&data=' + encodeURIComponent((Ext.encode || JSON.stringify)(document.getElementsByTagName('html')[0].outerHTML))
  • });
  • $job.addClass('ans-job-finished');
  • }
  • -
  • -function filterImg(dom) {
  • - return $(dom).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();
  • -}

nfsq has made 0 pending reports, 5 dismissed reports, 0 reports marked as fixed, and 2 upheld reports.

hurricane2002 has made 0 comments and posted 3 scripts.

This report has been upheld by a moderator.