zaixian100f.com 在线100分 自动答题,自动学完视频

zaixian100f.com 在线100分 自动答题,自动学完视频, 因题库是加密原因,如果需要题库请 email联系 [email protected]

目前为 2024-09-09 提交的版本。查看 最新版本

// ==UserScript==
// @name        zaixian100f.com 在线100分 自动答题,自动学完视频
// @namespace   www.miw.cn
// @description zaixian100f.com 在线100分 自动答题,自动学完视频, 因题库是加密原因,如果需要题库请 email联系 [email protected]
// @match       *://*.zaixian100f.com/*
// @grant       none
// @version     1.2.2
// @author      [email protected]
// @license MIT
// @run-at document-start
// ==/UserScript==
const ans ={};

const answer = (x,v)=>{
  o=x.parentNode.nextElementSibling.querySelectorAll(`[value=${v}]`);
  if(o.length) {
    o[0].click();
  }
}

const doit=()=>{
  document.querySelectorAll('[id^=questions_]').forEach(x=>{
      id = x.id.substr(10);
      an = ans[id];
      if(an){
        if(an!='true' && an!='false'){
          for(v of an.split('')){
            answer(x,v);
          }
        } else {
          answer(x,an);
        }

      }
  });
};

const videoFinal=()=>{
  const params = location.href.split('?')[1].split('&');
  let p = {"now_minute":"63:00","need_face_num":0,"vide_ratio":"0.99"};
  for(let s of params){
    let a=s.replace('Id','_id').split('=');
    p[a[0]]=a[1];
  }
  fetch("https://www.zaixian100f.com/api/course/addStudyTime", {
    "headers": {
      "content-type": "application/json",
    },
    "referrerPolicy": "strict-origin-when-cross-origin",
    "body": JSON.stringify(p),
    "method": "POST",
    "mode": "cors",
    "credentials": "include"
  }).then(res=>res.json()).then(json=>{
      console.log(json);
      //location.reload();
    setTimeout(()=>{
      document.querySelector('.to-course').click();
    },2000);
  });
}

const addFunc=(c,n,fn)=>{
  p=document.querySelector(`${c}`);

  if(!!p){
    const have = p.querySelectorAll('.__doit');
    if(have.length==0){
        btn = document.createElement("button");
        btn.textContent = n;
        btn.classList.add('__doit');
        btn.addEventListener('click', function() {
          fn && fn();
        });
        p.appendChild(btn);
    }

  }

}

const addFuncs=()=>{
  addFunc('.lesson—left h1','学完收工',()=>{
    videoFinal();
  });
  addFunc('.test-paper h4','自动答题',()=>{
    doit();
  });
}

(function () {
    var ___open = window.XMLHttpRequest.prototype.open;
    window.XMLHttpRequest.prototype.open = async function (method, url, async) {
        const res = await ___open.apply(this, arguments);
        addFuncs();
        return res;
    };
})();

(function() {
    const nativeSend = XMLHttpRequest.prototype.send;

    XMLHttpRequest.prototype.send = function(body) {
        const nativeOnReadyStateChange = this.onreadystatechange;
        this.onreadystatechange = function() {

            if (this.readyState === 4) {
              if(this.responseType !='arraybuffer'){
                try{
                 const responseText=this.responseText;
                  const res = JSON.parse(responseText);
                  const list = res.data.testpaper_item || res.data.content || res.data.items || res.data.item;
                  if(list && list.length){
                    list.map(x=>{
                      an = JSON.parse(x.answer).answer;
                      ans[x.id] = typeof an ==='string' ? an : an.join('');
                      x['user_answer'] = an;
                    });
                  }
                }catch(e){
                  console.log('解析出错,说明不是需要的数据');
                }
              }
            }

            if (nativeOnReadyStateChange) {
                nativeOnReadyStateChange.apply(this, arguments);
            }
        };
        nativeSend.apply(this, arguments);
    };
})();

setTimeout(()=>{
  addFuncs();

},2000);

QingJ © 2025

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