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

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

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

// ==UserScript==
// @name        zaixian100f.com 在线100分 自动答题,自动学完视频
// @namespace   www.miw.cn
// @description zaixian100f.com 在线100分 自动答题,自动学完视频, 如果需要题库,因题库是加密原因请 email联系 [email protected]
// @match       *://*.zaixian100f.com/*
// @grant       none
// @version     1.2.1
// @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('&');
  console.log(params);
  var p = {"now_minute":"63:00","need_face_num":0,"vide_ratio":"0.01"};
  for(let s of params){
    let a=s.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": "{\"course_id\":"+p.courseId+",\"lesson_id\":"+p.lessonId+",\"now_minute\":\"59:50\",\"need_face_num\":0,\"vide_ratio\":\"0\"}",
    "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) {
        //console.log("xhr时url",url);
        const res = await ___open.apply(this, arguments);
        if(url.indexOf('/api/exam/testPaper')!=-1){
            //console.log("返回结果",typeof res);
        }
        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) {
                const responseText = this.responseText;
                //console.log('Original response:', responseText);
                // this.responseText = 'Modified response';
              const res = JSON.parse(responseText);
              const list = res.data.testpaper_item || res.data.content || res.data.items;
              if(list && list.length){
                list.map(x=>{
                  an = JSON.parse(x.answer).answer;
                  //console.log(an);
                  ans[x.id] = typeof an ==='string' ? an : an.join('');
                });
              }
            }

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

setTimeout(()=>{
  addFuncs();

},2000);

QingJ © 2025

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