Greasy Fork

奥鹏自动答题

安徽奥鹏暑假视频学习, 视频中会不间断跳出题目, 此插件可自动选择答题项并提交(默认选C项, 不保证答题正确), 不需要再手动答题

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

// ==UserScript==
// @name         奥鹏自动答题
// @namespace    http://tampermonkey.net/
// @version      2024-07-23
// @description  安徽奥鹏暑假视频学习, 视频中会不间断跳出题目, 此插件可自动选择答题项并提交(默认选C项, 不保证答题正确), 不需要再手动答题
// @author       SkuraZZ
// @match        https://learn.ourteacher.com.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ourteacher.com.cn
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    (function checkAndClickElementsInIframe() {
  setInterval(() => {
    const iframes = document.getElementsByTagName('iframe');
    for (let i = 0; i < iframes.length; i++) {
      try {
        const iframeDocument = iframes[i].contentDocument || iframes[i].contentWindow.document;
        const radioButtonC = iframeDocument.getElementById('radiobuttonC');
        if (radioButtonC) {
          radioButtonC.click();
          const submitButton = iframeDocument.getElementById('submit');
          if (submitButton) {
            submitButton.click();
              console.log("已答题", Date())
          }
        }
      } catch (e) {
        console.warn('Unable to access iframe content:', e);
      }
    }
  }, 20000); // Every 20s
})();
  console.log("奥鹏test")
    // Your code here...
})();