JavaScript之正方教务系统自动化教评[插件-转载]

【声明】本插件系学院学长原创,非博主所创,发布此处,仅供学习和效仿。

 

/**
     * @name:正方教务系统自动化教评-插件
     * 
     * @author:chenzhongshu
     * @date:2017-07-04
     * @notice:原生js;无需依赖项
     *
     */
    (function() {
        var courseCode;
        var timer;

        var autoFill = function() {
            var frame = document.getElementById('rightDiv').querySelector('iframe').contentWindow.document;
            var divJs = frame.getElementById('divJs');
            var items = divJs.querySelectorAll('select');

            if (!frame.getElementById('pjkc'))
                return false;

            var newCourseCode = frame.getElementById('pjkc').value;
            if (newCourseCode == courseCode) {
                clearInterval(timer);
                console.log('评价完成');
                return true;
            }
            courseCode = newCourseCode;

            for (i = 0; i < items.length; i++)
                items[i].value = "1(完全同意)"
            frame.getElementById('Button1').click();
        }
        timer = setInterval(autoFill, 1000);
    })();

 

转载于:https://www.cnblogs.com/johnnyzen/p/7208524.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值