东华网络教育刷课专用

try to take over the world!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         东华网络教育刷课专用
// @namespace    http://tampermonkey.net/
// @version      0.13
// @description  try to take over the world!
// @author       zhangyanhua
// @match        *://*.donghuacj.ct-edu.com.cn/*
// @grant        none
// @require   https://cdn.bootcdn.net/ajax/libs/jquery/2.2.3/jquery.min.js
// ==/UserScript==


const isObject = x => {
  return typeof x === 'object' && x !== null
}
var href = location.href
var btn=document.getElementsByClassName("layui-layer-btn0")
var flag1 = 0
   function doClick() {
            document.getElementsByClassName("layui-layer-btn0")[0].click()
        }
        setInterval(() => {
            if (btn.length > 0) {
                doClick()
                if($('.left_content').text(). indexOf('英语')!==-1){
                                  setTimeout(function(){
                       $('.course_chapter_list .active').next().children(".section_title").click()

                           },500)
                }

            }
             var pop = document.getElementsByClassName("popup_do_question")
            //增加禁音播放
            var vidio = document.getElementsByTagName('video')
            if(vidio.length>0){vidio[0].volume = 0}
            
            //这个是增加倍速的但是目前不支持playbackRate
            var erroePop=document.getElementsByClassName("popup_do_error")
            var succPop=document.getElementsByClassName("popup_show")
         if (pop.length > 0||erroePop.length>0||succPop.length>0) {
             var check = document.getElementsByClassName('checkbox-inline')
             var btnText = $('.popup_operate .whaty-button').html()
             if (btnText == '提交') {
                 check[0].click()
                 console.log('提交了111')
                 flag1++
                 $('.popup_operate .whaty-button').click()
             } else if (btnText == '重做') {
                 console.log('重做===',flag1)
                 $('.popup_operate .whaty-button').click()
                 check[flag1].click()
                 flag1++
                 $('.popup_operate .whaty-button').click()

             } else {
                 //回答正确等于继续的时候
                 console.log('提交正确')
                 $('.course_chapter_list .active').next().children(".section_title").click()  //回答正确点击侧边直接换专治英语花里胡哨
                 //$('.popup_operate .whaty-button').click()
             flag1=0
             }

    }
            console.log('脚本在执行了')
        }, 10000)