MOOC互评全自动化脚本

自动填充内容并默认勾选最高分提交,默认互评5次

// ==UserScript==
// @name         MOOC互评全自动化脚本
// @description  自动填充内容并默认勾选最高分提交,默认互评5次
// @version      1.2
// @author       无知呦
// @match        https://www.icourse163.org//*  
// @grant        none
// @license MIT
// @namespace https://gf.qytechs.cn/users/1195678
// ==/UserScript==

// 2023年10月14日15:17:22 mooc互评全自动化脚本 无知呦

function fillRadios() {
  var radios = document.getElementsByTagName('input');
  for (var i = 0; i < radios.length; i++) {
    if (radios[i].type === 'radio') {
      radios[i].checked = true;
    }
  }
}

function fillTextareas() {
  var textareas = document.getElementsByTagName('textarea');
  for (var i = 0; i < textareas.length; i++) {
    textareas[i].value = '100';
  }
}

function clickLinkByTextContent(textContent) {
  var links = document.querySelectorAll('a');
  for (var i = 0; i < links.length; i++) {
    if (links[i].textContent === textContent) {
      links[i].click();
      break;
    }
  }
}

function clickNextLinks() {
  var nextLinks = document.querySelectorAll('a.j-gotonext');
  for (var j = 0; j < nextLinks.length; j++) {
    nextLinks[j].click();
  }
}

function doTask(taskIndex) {
  fillRadios();
  fillTextareas();
  clickLinkByTextContent('提交');

  setTimeout(function () {
    clickNextLinks();
    if (taskIndex < 4) {
      setTimeout(function () {
        doTask(taskIndex + 1);
      }, Math.random() * 2000 + 1000); // 随机等待时间在1秒到3秒之间
    }
  }, 2000);
}

doTask(0);

QingJ © 2025

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