// ==UserScript== // @name 湖南大学继续教育 // @namespace Violentmonkey Scripts // @match http://jxjyjd.hnu.edu.cn/* // @grant none // @version 1.0 // @author - // @description 2024/6/22 08:05:32 // @license MIT // @downloadURL none // ==/UserScript== let hre = location.href //学习课程安全生产(一) if (hre.includes("http://jxjyjd.hnu.edu.cn/my/courses/learning")){ window.location.replace('http://jxjyjd.hnu.edu.cn/course/1756/task/49927/show') } if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1756/task/")){ //点击目录 setTimeout(() => { document.querySelector("#dashboard-toolbar-nav > li > a > div").click() }, 2000) //跳转未学的课程 setTimeout(() => { var aa = document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu").length var URL1 = window.location.pathname; var URL11 = String(URL1); //console.log(URL1) var anchor = document.getElementsByClassName("title")[aa]; var URL2 = anchor.getAttribute('href'); var URL22 = String(URL2); //console.log(URL2) if(URL11 != URL22){ document.getElementsByClassName("title")[aa].click() } }, 5000) //如果课程已学完“返回课程” setInterval(() => { if(document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu")[9]){ document.querySelector("a.back-link").click()} }, 2000); } //学习课程安全生产(二) if (hre.includes("http://jxjyjd.hnu.edu.cn/my/course/1756")){ window.location.replace('http://jxjyjd.hnu.edu.cn/course/1757/task/49938/show') } if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1757/task/")){ //点击目录 setTimeout(() => { document.querySelector("#dashboard-toolbar-nav > li > a > div").click() }, 2000) //跳转未学的课程 setTimeout(() => { var aa = document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu").length var URL1 = window.location.pathname; var URL11 = String(URL1); //console.log(URL1) var anchor = document.getElementsByClassName("title")[aa]; var URL2 = anchor.getAttribute('href'); var URL22 = String(URL2); //console.log(URL2) if(URL11 != URL22){ document.getElementsByClassName("title")[aa].click() } }, 5000) //如果课程已学完“返回课程” setInterval(() => { if(document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu")[10]){ document.querySelector("a.back-link").click()} }, 2000); } //学习《创新驱动发展》 if (hre.includes("http://jxjyjd.hnu.edu.cn/my/course/1757")){ window.location.replace('http://jxjyjd.hnu.edu.cn/course/1758/task/49950/show') } if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1758/")){ //点击目录 setTimeout(() => { document.querySelector("#dashboard-toolbar-nav > li > a > div").click() }, 2000) //跳转未学的课程 setTimeout(() => { var aa = document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu").length var URL1 = window.location.pathname; var URL11 = String(URL1); //console.log(URL1) var anchor = document.getElementsByClassName("title")[aa]; var URL2 = anchor.getAttribute('href'); var URL22 = String(URL2); //console.log(URL2) if(URL11 != URL22){ document.getElementsByClassName("title")[aa].click() } }, 5000) //如果课程已学完“返回课程” setInterval(() => { if(document.querySelectorAll("i.es-icon.es-icon-iccheckcircleblack24px.color-primary.left-menu")[6]){ document.querySelector("a.back-link").click()} }, 2000); } //if (hre.includes("http://jxjyjd.hnu.edu.cn/my/course/1758")){ // window.location.replace('http://jxjyjd.hnu.edu.cn/course/1756/task/49927/show')} //错误 if (hre.includes("http://jxjyjd.hnu.edu.cn/task/learn/repeat/error")){ //window.location.replace('http://jxjyjd.hnu.edu.cn/my/courses/learning') document.querySelector("#page-message-container > div > div.page-body > div.page-footer > a.btn.btn-info.mrl.btn-return-course-list").click() } setTimeout(() => { //进入创新驱动发展考试 if (hre.includes("http://jxjyjd.hnu.edu.cn/my/course/1758")){ window.location.replace("http://jxjyjd.hnu.edu.cn/course/1758/task/49957/activity_show")} //点击开始考试 if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1758/task/49957/activity_show")){ document.querySelector("a.btn.btn-primary").click()} //开始答题并提交 if (hre.includes("http://jxjyjd.hnu.edu.cn/testpaper/")){ if(document.querySelector("#question5043 > div.testpaper-question-body > ul > li:nth-child(1) > p").innerText== '工艺创新'){ document.querySelectorAll("label.radio-inline")[3].click() document.querySelectorAll("label.radio-inline")[5].click() document.querySelectorAll("label.radio-inline")[8].click() document.querySelectorAll("label.radio-inline")[12].click() document.querySelectorAll("label.radio-inline")[17].click() document.querySelectorAll("label.radio-inline")[20].click() document.querySelectorAll("label.radio-inline")[22].click() document.querySelectorAll("label.radio-inline")[24].click() document.querySelectorAll("label.radio-inline")[26].click() document.querySelectorAll("label.radio-inline")[28].click() document.querySelector("#finishPaper").click() document.querySelector("#testpaper-finish-btn").click() window.location.replace("http://jxjyjd.hnu.edu.cn/course/1756/task/49937/activity_show") } } }, 2000) //window.location.replace("http://jxjyjd.hnu.edu.cn/course/1758/task/49957/show") // // setTimeout(() => { //进入《安全生产(一)》 考试 //点击开始考试 if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1756/task/49937/activity_show")){ document.querySelector("a.btn.btn-primary").click()} //开始答题并提交 if (hre.includes("http://jxjyjd.hnu.edu.cn/testpaper/")){ if(document.querySelector("#question4933 > div.testpaper-question-body > ul > li:nth-child(1) > p").innerText == '15'){ document.querySelectorAll("label.radio-inline")[1].click() document.querySelectorAll("label.radio-inline")[7].click() document.querySelectorAll("label.radio-inline")[11].click() document.querySelectorAll("label.radio-inline")[12].click() document.querySelectorAll("label.radio-inline")[19].click() document.querySelectorAll("label.radio-inline")[21].click() document.querySelectorAll("label.radio-inline")[22].click() document.querySelectorAll("label.radio-inline")[24].click() document.querySelectorAll("label.radio-inline")[26].click() document.querySelectorAll("label.radio-inline")[28].click() document.querySelector("#finishPaper").click() document.querySelector("#testpaper-finish-btn").click() window.location.replace("http://jxjyjd.hnu.edu.cn/course/1757/task/49949/activity_show") } } }, 2000) //window.location.replace("http://jxjyjd.hnu.edu.cn/course/1756/task/49937/show") // setTimeout(() => { //进入《安全生产(二)》 考试 //点击开始考试 if (hre.includes("http://jxjyjd.hnu.edu.cn/course/1757/task/49949/activity_show")){ document.querySelector("a.btn.btn-primary").click()} //开始答题并提交 if (hre.includes("http://jxjyjd.hnu.edu.cn/testpaper/")){ if(document.querySelector("#question5023 > div.testpaper-question-body > ul > li:nth-child(1) > p").innerText == '50%'){ document.querySelectorAll("label.radio-inline")[2].click() document.querySelectorAll("label.radio-inline")[6].click() document.querySelectorAll("label.radio-inline")[11].click() document.querySelectorAll("label.radio-inline")[13].click() document.querySelectorAll("label.radio-inline")[17].click() document.querySelectorAll("label.radio-inline")[20].click() document.querySelectorAll("label.radio-inline")[23].click() document.querySelectorAll("label.radio-inline")[25].click() document.querySelectorAll("label.radio-inline")[26].click() document.querySelectorAll("label.radio-inline")[28].click() document.querySelector("#finishPaper").click() document.querySelector("#testpaper-finish-btn").click() } } }, 2000) //window.location.replace("http://jxjyjd.hnu.edu.cn/course/1757/task/49949/show") if (hre.includes("http://jxjyjd.hnu.edu.cn/*/learn/repeat/tips/modal")){ document.querySelector("button.cd-btn.cd-btn-link-primary.cd-btn-lg").click()}