// ==UserScript== // @name 超星学习通网课助手自动学习考试 // @namespace genggongzi_cx // @version 0.2 // @description 开放优化收录系统,超过1600W自收录题库,支持自动答题,支持视频自动完成,章节测验自动答题提交,支持自动切换任务点等,开放自定义参数 // @author genggongzi // @match *://*.chaoxing.com/* // @match *://*.edu.cn/* // @connect api.gochati.cn // @connect up.gochati.cn // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // @run-at document-end // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @license MIT // @original-author qq:2621905853 // @original-license MIT // @downloadURL none // ==/UserScript== function sleepBySeconds(delay) { return new Promise(reslove => { setTimeout(reslove, delay * 1000) }) } function sleepByMillis(delay) { return new Promise(reslove => { setTimeout(reslove, delay) }) } window.setTimeout(studyPage, 5000); async function studyPage() { if (location.pathname.includes("mycourse/studentstudy")) { console.log("chaoxing script run") let sum = 0; let chapters = $('div.posCatalog_level div.posCatalog_select') for(let i = 0; i < chapters.length; i++) { if ($(chapters[i]).find('span.icon_Completed').length == 0) { $(chapters[i]).find('span.posCatalog_name').eq(0).click() while ($($('div.posCatalog_level div.posCatalog_select')[i]).find('span.icon_Completed').length == 0) { await sleepBySeconds(1) } sum++ } else { console.log("i: " + i + ", 已经学习完成") } } } }