🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

超星/学习通自动抢答

超星/学习通自动抢答!

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         超星/学习通自动抢答
// @namespace    Anubis Ja
// @version      0.2
// @description  超星/学习通自动抢答!
// @author       Anubis Ja
// @match        *://mobilelearn.chaoxing.com/widget/pcpick/stu/index?*
// @supportURL   https://greasyfork.org/zh-CN/scripts/398151/feedback
// ==/UserScript==

(function() {
    var name = '系统繁忙'; //在此填写你的真实姓名,会在抢答页面显示!
    var time = 1; //监控频率/秒 请勿低于1,否则你的账号将会被超星屏蔽!
    var autoStop = 1; //抢答成功自动暂停。设置为0即可无限检测抢答。

    //以下内容除非你懂javascript,否则请勿修改!
    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return pair[1];
            }
        }
        return (false);
    }
    var courseId = getQueryVariable("courseId");
    var jclassId = getQueryVariable("jclassId");
    var t = 0;
    console.log('监控课程id:' + courseId + ' 班级id:' + jclassId + ' 抢答人姓名:' + name);
    var interval = setInterval(function() {
        t++;
        console.log('监控抢答第 ' + t + ' 次');
        $.ajaxSettings.async = false;
        $.getJSON('/ppt/activeAPI/taskactivelist?courseId=' + courseId + '&classId=' + jclassId, function(json) {
            //console.log(json.activeList)
            for (var i = json.activeList.length - 1; i >= 0; i--) {
                if (json.activeList[i]['activeType'] == 4 && json.activeList[i]['status'] == 1) {
                    $.getJSON('/pptAnswer/stuAnswer?answerId=' + json.activeList[i]['id'] + '&classId=' + jclassId + '&role=&courseId=' + courseId + '&general=&appType=15&stuMiddlePage=1&stuName=' + name);
                    //console.log(json.activeList[i]);
                    if (autoStop == 1) {
                        console.log('抢答成功!监控抢答已结束,如需继续监控请刷新页面。');
                        alert('抢答成功!监控抢答已结束,如需继续监控请刷新页面。');
                        clearInterval(interval);
                    }
                }
            }
        })
    }, time * 1000);
})();