wlxx

网络学习代码

As of 2022-04-12. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://updategf.qytechs.cn/scripts/443181/1039150/wlxx.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

function func() {
    var i=0;var x1, t1;
    var zf1=24;//看课总分
    var zf2=6;//能力点总分
    //setTimeout(function(){
        var test = window.location.href;
        if(test.match("train/home")){
            document.querySelector(".btn.to-learn").click ();
            window.close();
        }else if(test.match("grain/course")){
            x1 = document.querySelector(".state").innerText;//学习
            t1 = window.setInterval(study,10000);//重复执行某个方法
        }else if(test.match("train/guide/course")){
            setTimeout( Select,5000);//选视频
        }else if(test.match("train/pointView")){
            nldxz(); //能力点选择
        }else if(test.match("train/workspace")){
            if(document.querySelectorAll('.score')[3].innerText!=zf1){
                page(0);
            }else if(document.querySelectorAll('.score')[4].innerText!=zf2){
                page(1);
            }else{window.alert("恭喜您已学完全部课程!")}
        }

    //},10000);
    //能力点选择
    function nldxz() {
        var sw=document.querySelectorAll('.ability-task-title');
        if(sw.length!=0){
            if(document.querySelector ('.info').innerText.match("3 个 / 3个")==null){
                for (i = 0; i < sw.length; i++) {
                    sw[i].click ();
                }
                setTimeout(function(){
                    switch(document.querySelector ('.info').innerText) {
                        case "0 个 / 3个":
                            page(0);
                            break;
                        case "1 个 / 3个":
                            page(1);
                            break;
                        case "2 个 / 3个":
                            page(2);
                            break;
                        default:
                    }
                },5000);
            }else{
                document.querySelector ('.g-nav-menu-name').click ();
                setTimeout(function(){
                    location.reload();
                },5000);
            }
        }else{
            var nldqd=document.querySelectorAll ('span');
            while (nldqd[i].innerText.indexOf('确定(3)') == -1){
                i++;
            }
            nldqd[i].click ();
            setTimeout(function(){
                location.reload();
            },5000);
        }
    }
    //切换窗口
    function page(x) {
        document.querySelectorAll ('.task-title')[x].click ();
        window.close();
    }
    //选择视频
    function Select() {
        window.clearInterval(t1);
        var div = document.querySelectorAll(".item-infos.default")
        if(div.length!=0){
            document.querySelector(".img").click ();
            window.close();
        }else{
            document.querySelector ('.ivu-page-next').click ();
            setTimeout( Select,5000);
        }
    }
    //学习
    function study() {
        if(i<7){
            i++;
            var str1 =document.querySelector('.vcp-controls-panel.show');
            var str2 =document.querySelector ('.alarmClock-wrapper');
            if(str1!=null){
                document.querySelector ('.vcp-playtoggle').click ();
            }
            if(str2.style.display!="none"){
                str2.click ();
            }
            if(document.querySelector(".scoring-wrapper").style.display!="none"){
                var mousemove = new Event('mousemove');
                var x=document.querySelectorAll(".rate-item")
                x=x[x.length-1];
                x.dispatchEvent(mousemove);
                x.click();
                setTimeout(function(){
                document.querySelector ('.ivu-btn.ivu-btn-primary').click ();
                },3000);
            }
        }else{
            i=0;
            var x2 = document.querySelector(".state").innerText;
            console.log(x2);
            if(x2!=x1){
                x1=x2;
            }else{
                window.clearInterval(t1);//你已学完本课,结束本课学习。
                document.querySelector ('.g-nav-menu-name').click ();//换课
            }
        }
    }
 }