qhts

storehouse

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/492473/1375805/qhts.js

  1. // ==UserScript==
  2. // @name qhts
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.4
  5. // @description storehouse
  6. // @author Xiguayaodade
  7. // @license MIT
  8. // @match *://www.tcm512.com/*
  9. // @grant GM_info
  10. // @grant GM_getTab
  11. // @grant GM_saveTab
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_addStyle
  15. // @grant unsafeWindow
  16. // @grant GM_listValues
  17. // @grant GM_deleteValue
  18. // @grant GM_notification
  19. // @grant GM_xmlhttpRequest
  20. // @grant GM_getResourceText
  21. // @grant GM_registerMenuCommand
  22. // @grant GM_unregisterMenuCommand
  23. // @grant GM_addValueChangeListener
  24. // @grant GM_removeValueChangeListener
  25. // @namespace http://tampermonkey.net/
  26. // @homepage http://8.130.116.135/?article/
  27. // @source http://8.130.116.135/?article/
  28. // @icon https://picx.zhimg.com/v2-ce62b58ab2c7dc67d6cabc3508db5795_l.jpg?source=32738c0c
  29. // @connect icodef.com
  30. // @connect localhost
  31. // @antifeature free 限时免费
  32. // @require https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js
  33. // ==/UserScript==
  34.  
  35. (function() {
  36. 'use strict';
  37. /* globals jQuery, $, waitForKeyElements */
  38.  
  39. // 检查当前窗口是否为顶层窗口
  40. if (window.self !== window.top) {
  41. }else{
  42. return; // 如果是顶层窗口,则不执行脚本
  43. }
  44.  
  45. var ddds3 = null;
  46. var addMessage = null;
  47.  
  48. let btn1=GM_registerMenuCommand ("\u4f5c\u8005\uff1a\ud83c\udf49\u897f\u74dc\u8981\u5927\u7684\ud83c\udf49", function(){
  49. confirm("Hello,\u611f\u8c22\u4f7f\u7528\ud83c\udf49\u897f\u74dc\u5237\u8bfe\u52a9\u624b\ud83c\udf49\uff01\u591a\u591a\u53cd\u9988\u54e6");
  50. GM_unregisterMenuCommand(btn1);
  51. }, "");
  52. let btn2=GM_registerMenuCommand ("\u4ed8\u8d39\u5185\u5bb9", function(){
  53. alert("\u9650\u65f6\u514d\u8d39\uff0c\u5168\u529b\u5f00\u53d1\u4e2d...");
  54. }, "p");
  55.  
  56. var chapterCount = 0;
  57. var chapterId = 1;
  58. var sectionCount = 0;
  59. var sectionId = 1;
  60. var search = null;
  61. var searchVD = null;
  62. var searchFC = null;
  63. let uL = null;
  64. var courseCount = 0;
  65. var courseIndex = 0;
  66.  
  67.  
  68. //----解决重复监听start----
  69. //视频组件
  70. var elevideo = null;
  71. //视频开始的公共方法
  72. var vdplay = null;
  73. //视频正在播放的公共方法
  74. var vdplaying = null;
  75. //视频暂停的公共方法
  76. var vdpause = null;
  77. //视频结束的公共方法
  78. var vdended = null;
  79. //监听音量的公共方法
  80. var vdvolume = null;
  81. //----解决重复监听end----
  82.  
  83. var isListening = false;
  84.  
  85. //-----添加监听start------
  86. function addLisenner() {
  87.  
  88. //获取播放器组件
  89. elevideo = document.getElementsByTagName("video")[0];
  90.  
  91. vdplay = function(){
  92. console.log("xigua:\u5f00\u59cb\u64ad\u653e");
  93. addMessage("xigua:\u5f00\u59cb\u64ad\u653e");
  94. };
  95. vdpause = function(){
  96. console.log("xigua:\u6682\u505c\u64ad\u653e");
  97. addMessage("xigua:\u6682\u505c\u64ad\u653e");
  98. setTimeout(function(){
  99. let x = document.getElementsByClassName('creatGroupBox')[0].style.display;
  100. if(x != '' && x != 'none'){
  101. addMessage("xigua:滑块认证");
  102. setTimeout(function(){
  103. moveLabel();
  104. },500);
  105. }else{
  106. addMessage("xigua:手动暂停");
  107. }
  108. },1500);
  109. };
  110. vdended = function(){
  111. console.log("xigua:结束播放");
  112. addMessage("xigua:结束播放");
  113. setTimeout(function(){
  114. //总课程数
  115. courseCount = document.getElementsByClassName('new_bg').length;
  116. selectStudying(0,courseCount);
  117. },5000)
  118. };
  119. vdvolume = function(){
  120. if(elevideo.volume < 1 && elevideo.volume > 0){
  121. let vlum = elevideo.volume.toString();
  122. console.log("xigua:当前音量("+vlum.substring(2,4)+"%)");
  123. addMessage("xigua:当前音量("+vlum.substring(2,4)+"%)");
  124. }else if(elevideo.volume == 0){
  125. console.log("xigua:当前音量(0%)");
  126. addMessage("xigua:当前音量(0%)");
  127. }else{
  128. console.log("xigua:当前音量(100%)");
  129. addMessage("xigua:当前音量(100%)");
  130. }
  131. }
  132.  
  133. elevideo.addEventListener('play',vdplay);
  134. elevideo.addEventListener('playing',vdplaying);
  135. elevideo.addEventListener('pause',vdpause);
  136. elevideo.addEventListener('ended',vdended);
  137. elevideo.addEventListener('volumechange',vdvolume);
  138.  
  139. elevideo.volume = 0.5;
  140. setTimeout(function(){
  141. elevideo.play();
  142. },1500);
  143. }
  144. //-----添加监听end------
  145.  
  146. //-----移除监听start---
  147. function removeLisenner(){
  148. if(vdplay != null){
  149. elevideo.removeEventListener("play", vdplay);
  150. }
  151. if(vdplaying != null){
  152. elevideo.removeEventListener("playing", vdplaying);
  153. }
  154. if(vdpause != null){
  155. elevideo.removeEventListener("pause", vdpause);
  156. }
  157. if(vdended != null){
  158. elevideo.removeEventListener("ended", vdended);
  159. }
  160. if(vdended != null){
  161. elevideo.removeEventListener("ended", vdended);
  162. }
  163. if(vdvolume != null){
  164. elevideo.removeEventListener("volumechange",vdvolume);
  165. }
  166. }
  167. //-----移除监听end---
  168.  
  169.  
  170. search = function(){
  171. if(chapterId <= chapterCount){
  172. if(sectionId <= sectionCount){
  173. addMessage("\u5171"+chapterCount+"\u7ae0\uff0c\u5f53\u524d\u7b2c"+chapterId+"\u7ae0\u7b2c"+sectionId+"\u8282\uff0c\u5171"+sectionCount+"\u8282\u3002");
  174. var xxjd = document.getElementsByClassName("subject-catalog subject-catalog-new")[0].getElementsByTagName("li")[chapterId-1].getElementsByClassName("item current-hover")[sectionId-1].getElementsByClassName("iconfont m-right")[1].innerText;
  175. if(xxjd === '重新学习'){
  176. addMessage("\u7b2c"+chapterId+"\u7ae0\u7b2c"+sectionId+"\u8282\u5df2\u5b8c\u6210\uff0c\u68c0\u7d22\u4e0b\u4e00\u8282\u3002");
  177. sectionId++;
  178. search();
  179. }else{
  180. addMessage("\u7b2c"+chapterId+"\u7ae0\u7b2c"+sectionId+"\u8282\u672a\u5b8c\u6210\uff0c\u5373\u5c06\u8fdb\u5165\u5b66\u4e60\u3002");
  181. setTimeout(function(){
  182. document.getElementsByClassName("subject-catalog subject-catalog-new")[0].getElementsByTagName("li")[chapterId-1].getElementsByClassName("item current-hover")[sectionId-1].getElementsByClassName("iconfont m-right")[1].click();
  183. },1000);
  184. }
  185. }else{
  186. addMessage("\u5f53\u524d\u7ae0\u8282\u5df2\u5b8c\u6210\uff0c\u68c0\u7d22\u4e0b\u4e00\u7ae0\u3002");
  187. sectionId = 1;
  188. chapterId++;
  189. if(chapterId <= chapterCount){
  190. sectionCount = document.getElementsByClassName("subject-catalog subject-catalog-new")[0].getElementsByTagName("li")[chapterId-1].getElementsByClassName("item current-hover").length;
  191. }
  192. search();
  193. }
  194. }else{
  195. addMessage("\u5b66\u4e60\u5b8c\u6210\uff0c\u9000\u51fa\uff01");
  196. }
  197. }
  198.  
  199. searchVD = function(){
  200. if(document.getElementsByTagName('video')[0].ended){
  201. //总课程数
  202. courseCount = document.getElementsByClassName('new_bg').length;
  203. selectStudying(0,courseCount);
  204. }else{
  205. document.getElementsByTagName('video')[0].play();
  206. }
  207. }
  208.  
  209. const panel = function(){
  210. var container = $('<div id="gm-interface"></div>');
  211. var titleBar = $('<div id="gm-title-bar">\ud83c\udf49\u897f\u74dc\u7f51\u8bfe\u52a9\u624b\ud83c\udf49</div>');
  212. var minimizeButton = $('<div title="\u6536\u8d77" style="display:black"><svg id="gm-minimize-button" class="bi bi-dash-square" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/><path fill-rule="evenodd" d="M3.5 8a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.5-.5z"/></svg></div>');
  213. var maxButton = $('<div title="\u5c55\u5f00" style="display:none"><svg id="gm-minimize-button" class="bi bi-plus-square" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 3.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H4a.5.5 0 0 1 0-1h3.5V4a.5.5 0 0 1 .5-.5z"/><path fill-rule="evenodd" d="M7.5 8a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1H8.5V12a.5.5 0 0 1-1 0V8z"/><path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/></svg></div>');
  214. var content = $('<div id="gm-content"></div>');
  215. var tips = $('<div class="tip" style="display:none;">\u957f\u6309\u62d6\u62fd</div>');
  216. var scrollText = $('<marquee>').text('\u4e7e\u5764\u672a\u5b9a\uff0c\u4f60\u6211\u7686\u662f\u9ed1\u9a6c----\u4f5c\u8005\uff1a\u897f\u74dc\u8981\u5927\u7684\uff08\u611f\u8c22\u652f\u6301\uff01\uff09').css({
  217. 'position': 'absolute',
  218. 'top': '15%',
  219. 'left': '50%',
  220. 'transform': 'translate(-50%, -50%)',
  221. 'width': '90%',
  222. 'height': '25px',
  223. 'font-size': '16px',
  224. 'line-height': '1.5',
  225. 'white-space': 'nowrap'
  226. }).appendTo(content);
  227. //var ddds1 = $('<div style="position: absolute;top: 20%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u70b9\u51fb\u542f\u52a8\uff1a<button id="startxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">\u542f\u52a8</button></div>');
  228. //var ddds5 = $('<div style="position: absolute;top: 35%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u70b9\u51fb\u542f\u52a8\uff1a<button id="stopxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">暂停</button></div>');
  229. //var ddds2 = $('<div style="position: absolute;top: 50%;width:90%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;">\u89c6\u9891\u500d\u901f\uff1a<button id="speedxg" style="position: absolute;width:48px;right: 10px;background-color: #ffe5e5;border-radius: 4px;border-color: #ffc0c0;color: grey;">X16</button></div>');
  230. ddds3 = $('<div id="message-container" style="position: absolute;display: grid;align-content: center;justify-content: center;top: 20%;width:94%;height:62%;max-height:62%;overflow-y:auto;padding: 3px;background: #ffffff;border-radius: 5px;"></div>');
  231. var ddds4 = $('<div style="position: absolute;top: 85%;width:94%;height:10%;padding: 3px;background: #ffedf0;border-radius: 5px;"><a href="http://8.130.116.135/?article/" style="position: absolute;right: 10px;text-decoration: none;color: pink;">\u003e\u003e\u003e\u8054\u7cfb\u003a\u0031\u0039\u0030\u0038\u0032\u0034\u0035\u0033\u0030\u0032\u0040\u0071\u0071\u002e\u0063\u006f\u006d</a></div>');
  232.  
  233. container.append(titleBar);
  234. //content.append(ddds1);
  235. //content.append(ddds5);
  236. //content.append(ddds2);
  237. content.append(ddds3);
  238. content.append(ddds4);
  239. container.append(content);
  240. container.append(maxButton);
  241. container.append(minimizeButton);
  242. $('body').append(container);
  243. $('body').append(tips);
  244.  
  245. GM_addStyle(`
  246. #gm-interface {
  247. position: fixed;
  248. top: 50%;
  249. left: 50%;
  250. border-radius: 5px;
  251. background-color: white;
  252. z-index: 9999;
  253. }
  254.  
  255. #gm-title-bar {
  256. padding: 5px;
  257. background-color: #ffc0c0;
  258. border: 1px solid black;
  259. border-radius: 5px;
  260. cursor: grab;
  261. }
  262.  
  263. #gm-minimize-button {
  264. position: absolute;
  265. top: 2px;
  266. right: 2px;
  267. width: 30px;
  268. height: 30px;
  269. border-radius: 5px;
  270. padding: 0;
  271. font-weight: bold;
  272. background-color: #ffc0c0;
  273. cursor: pointer;
  274. }
  275.  
  276. #gm-content {
  277. padding: 10px;
  278. border: 1px solid black;
  279. border-radius: 2px 2px 5px 5px;
  280. background-color: #ffe5e5;
  281. width: 400px;
  282. height: 300px;
  283. }
  284. .tip{
  285. font-family: "黑体";
  286. color: black;
  287. -webkit-transform: scale(0.8);
  288. position:absolute;
  289. padding: 6px 5px;
  290. background-color:#ffe8f0;
  291. border-radius: 4px;
  292. z-index: 9999;
  293. }
  294. `);
  295.  
  296. titleBar.on('mousemove',function(e){
  297. tips.attr("style", "display:black;");
  298. var top = e.pageY+5;
  299. var left = e.pageX+5;
  300. tips.css({
  301. 'top' : top + 'px',
  302. 'left': left+ 'px'
  303. });
  304. });
  305.  
  306. titleBar.on('mouseout',function(){
  307. tips.hide();
  308. });
  309.  
  310. titleBar.on('mousedown', function(e) {
  311. var startX = e.pageX - container.offset().left + window.scrollX;
  312. var startY = e.pageY - container.offset().top + window.scrollY;
  313.  
  314. $(document).on('mousemove', function(e) {
  315. e.preventDefault();
  316. var newX = e.pageX - startX;
  317. var newY = e.pageY - startY;
  318. container.css({ left: newX, top: newY });
  319. });
  320.  
  321. $(document).on('mouseup', function() {
  322. $(document).off('mousemove');
  323. $(document).off('mouseup');
  324. });
  325. });
  326.  
  327.  
  328. minimizeButton.on('click', function() {
  329. minimizeButton.attr("style", "display:none;");
  330. maxButton.attr("style", "display:black;");
  331. content.slideToggle(0);
  332. container.css({ width: 200 });
  333. });
  334.  
  335. maxButton.on('click', function() {
  336. minimizeButton.attr("style", "display:black;");
  337. maxButton.attr("style", "display:none;");
  338. content.slideToggle(0);
  339. container.css({ width: 400 });
  340. });
  341.  
  342. ddds3.on('mousewheel', function(event) {
  343. event.preventDefault();
  344. var scrollTop = ddds3.scrollTop();
  345. ddds3.scrollTop(scrollTop + event.originalEvent.deltaY);
  346. });
  347.  
  348. addMessage = function(message){
  349. if (ddds3.children().length >= 288) {
  350. ddds3.children().first().remove();
  351. }
  352. var messageElement = $('<div class="message"></div>').text(message).css({
  353. 'margin-bottom': '10px'
  354. }).appendTo(ddds3);
  355. }
  356.  
  357. }
  358.  
  359. panel();
  360. addMessage("\u002d\u002d\u002d\u002d\u6b63\u5728\u542f\u52a8\uff0c\u8bf7\u7a0d\u540e\u002e\u002e\u002e\u002d\u002d\u002d\u002d");
  361.  
  362. var wait = setInterval(function (){
  363. ddds3.children().remove();
  364. addMessage(window.location.href);
  365. if(window.location.href.substring(0,65) === 'https://www.tcm512.com/pages_jsp/mobile/courseLearn.html?courseId' || window.location.href.substring(0,64) === 'http://www.tcm512.com/pages_jsp/mobile/courseLearn.html?courseId'){
  366. try{
  367. //总课程数
  368. courseCount = document.getElementsByClassName('new_bg').length;
  369. selectStudying(0,courseCount);
  370. clearInterval(wait);
  371. }catch(e){
  372. addMessage(e);
  373. addMessage("请登录(不可用)");
  374. }
  375. }
  376. else if(window.location.href === 'https://www.tcm512.com/pages_jsp/sk_8zhongxin/s81_study_log.jsp' || window.location.href === 'http://www.tcm512.com/pages_jsp/sk_8zhongxin/s81_study_log.jsp'){
  377. try{
  378. addMessage("学习的课程");
  379. clearInterval(wait);
  380. }catch(e){
  381. addMessage(e);
  382. addMessage("请登录(不可用)");
  383. }
  384. }
  385. else if(window.location.href.substring(0,55) === 'https://www.tcm512.com/pages_jsp/mobile/courseExam.html' || window.location.href.substring(0,54) === 'http://www.tcm512.com/pages_jsp/mobile/courseExam.html'){
  386. try{
  387. addMessage("请开始考试");
  388. clearInterval(wait);
  389. }catch(e){
  390. addMessage(e);
  391. addMessage("请登录(不可用)");
  392. }
  393. }
  394. else if(window.location.href.substring(0,57) === 'https://www.tcm512.com/pages_jsp/mobile/courseAnswer.html' || window.location.href.substring(0,56) === 'http://www.tcm512.com/pages_jsp/mobile/courseAnswer.html'){
  395. try{
  396. addMessage("题库异步加载...");
  397. setTimeout(function(){
  398. exam();
  399. clearInterval(wait);
  400. },2500);
  401. }catch(e){
  402. addMessage(e);
  403. addMessage("请登录(不可用)");
  404. }
  405. }
  406. else{
  407. addMessage("请登录(不可用)");
  408. }
  409. }, 2000);
  410.  
  411.  
  412. function selectStudying(index,count){
  413. if(index < count){
  414. let studystate = document.getElementsByClassName('new_bg')[index].getElementsByClassName('studystate')[0].innerText;
  415.  
  416. if(studystate === '未学' || studystate === '学习中'){
  417. addMessage(index+"|未完成");
  418. //选择课程
  419. document.getElementsByClassName('new_bg')[index].click();
  420. setTimeout(function(){
  421. removeLisenner();
  422. addLisenner();
  423. },1500);
  424. }
  425.  
  426. if(studystate === '已学完'){
  427. addMessage(index+"|学习完毕");
  428. selectStudying(++index,count)
  429. }
  430. }
  431. else{
  432. addMessage("|所有课程学习完毕");
  433. }
  434. }
  435.  
  436. function moveLabel(){
  437.  
  438. // 获取要模拟长按和拖动的元素
  439. var element = document.getElementById('label');
  440.  
  441. // 模拟鼠标按下事件
  442. var mouseDownEvent = new MouseEvent('mousedown', {
  443. bubbles: true,
  444. cancelable: true,
  445. view: null,
  446. clientX: element.getBoundingClientRect().left,
  447. clientY: element.getBoundingClientRect().top
  448. });
  449.  
  450. // 模拟鼠标移动事件
  451. var mouseMoveEvent = new MouseEvent('mousemove', {
  452. bubbles: true,
  453. cancelable: true,
  454. view: null,
  455. clientX: element.getBoundingClientRect().left + 256,
  456. clientY: element.getBoundingClientRect().top
  457. });
  458.  
  459. // 模拟鼠标松开事件
  460. var mouseUpEvent = new MouseEvent('mouseup', {
  461. bubbles: true,
  462. cancelable: true,
  463. view: null,
  464. clientX: element.getBoundingClientRect().left + 10,
  465. clientY: element.getBoundingClientRect().top
  466. });
  467.  
  468. // 模拟长按事件
  469. element.dispatchEvent(mouseDownEvent);
  470.  
  471. setTimeout(function(){
  472. element.dispatchEvent(mouseMoveEvent);
  473. },2000);
  474.  
  475. }
  476.  
  477. function exam(){
  478. //获取答案
  479. getAnswerList();
  480. }
  481.  
  482. var answerList;
  483. var questionCount;
  484. var questionIndex = 0;
  485. function getAnswerList(){
  486. $.post("/xxpt/getTestQuestion.do",{subid:localStorage.getItem("sid"),batchId:localStorage.getItem("batchId")},function(data) {
  487. if (data.code === 20000){
  488. answerList = data.data.testQuestionlist;
  489. console.log(answerList);
  490. questionCount = document.querySelector("#qusData").childElementCount;
  491. examAction();
  492. }
  493. else{
  494. addMessage(data.message);
  495. }
  496. },"json");
  497. }
  498.  
  499. function examAction(){
  500. if(questionIndex < questionCount){
  501. document.querySelector("body > div.tibox").children[questionIndex].click()
  502. let dataId = parseInt(getTidByIndex(questionIndex));
  503.  
  504. let result = answerList.reduce((index,awObj) => {
  505. if (dataId === awObj.t_id) {
  506. console.log('dataId === awObj.t_id');
  507. return awObj.epr_acswer.split('#');
  508. }
  509. return index;
  510. }, undefined);
  511.  
  512. if (result !== undefined) {
  513.  
  514. console.log('result',result);
  515. inputRadio(0,result.length,result);
  516.  
  517. } else {
  518. console.log('未找到答案');
  519. }
  520.  
  521. }
  522. else{
  523. console.log("答题结束");
  524. }
  525. }
  526.  
  527. function getTidByIndex(tIndex){
  528. return document.querySelector("#qusData").children[tIndex].dataset.id;
  529. }
  530.  
  531. function optionTrue(radioIndex){
  532. var parentElement = trueAnswrItem[radioIndex].getElementsByClassName("ant-radio-group ant-radio-group-outline")[0];
  533.  
  534. var childElement = trueAnswrItem[radioIndex].getElementsByClassName("ant-radio-group ant-radio-group-outline")[0].getElementsByClassName("ant-radio-wrapper ant-radio-wrapper-checked ant-radio-wrapper-in-form-item")[0];
  535.  
  536. var children = Array.from(parentElement.children);
  537.  
  538. var index = children.indexOf(childElement);
  539. switch(index)
  540. {
  541. case 0:
  542. return 'A';
  543. case 1:
  544. return 'B';
  545. case 2:
  546. return 'C';
  547. case 3:
  548. return 'D';
  549. case 4:
  550. return 'E';
  551. case 5:
  552. return 'F';
  553. default:
  554. console.log("未知题型,需更新!");
  555. return '未知';
  556. }
  557.  
  558. }
  559.  
  560. function examCheckbox(){
  561. if(checkboxIndex < checkboxCount){
  562. console.log("多选题开始作答");
  563. let qusetionStr = document.querySelector(".questionList").children[1].children[1].children[checkboxIndex].innerText;
  564. let newQusetionStr = qusetionStr.replace(/\n/g, '');
  565. console.log(checkboxIndex,examCheckboxText,newQusetionStr);
  566. wait1(examCheckboxText,newQusetionStr);
  567. }else{
  568. console.log("多选题作答完毕");
  569. checkboxIndex = 0;
  570. addMessage("作答完毕,请手动提交");
  571. }
  572. }
  573.  
  574. function inputRadio(index,count,result){
  575. if(index < count){
  576. switch(result[index])
  577. {
  578. case 'A':
  579. console.log("第"+(questionIndex+1)+"题选","A");
  580. radioOk(1)
  581. break;
  582. case 'B':
  583. console.log("第"+(questionIndex+1)+"题选","B");
  584. radioOk(2)
  585. break;
  586. case 'C':
  587. console.log("第"+(questionIndex+1)+"题选","C");
  588. radioOk(3)
  589. break;
  590. case 'D':
  591. console.log("第"+(questionIndex+1)+"题选","D");
  592. radioOk(4)
  593. break;
  594. case 'E':
  595. console.log("第"+(questionIndex+1)+"题选","E");
  596. radioOk(5)
  597. break;
  598. }
  599. setTimeout(function(){
  600. inputRadio(index+1,count,result);
  601. },200);
  602. }
  603. else{
  604. document.querySelector("#next").click();
  605. setTimeout(function(){
  606. addMessage((questionIndex+1)+"ok");
  607. questionIndex++;
  608. examAction();
  609. },500);
  610. }
  611. }
  612.  
  613. function radioOk(index){
  614. if(document.querySelector("#qusData").children[questionIndex].children[1].children[index].className != 'option choose'){
  615. document.querySelector("#qusData").children[questionIndex].children[1].children[index].click();
  616. }
  617. }
  618.  
  619. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址