// ==UserScript== // @name 麦能网练习题自动答题 // @namespace https:/blog.luoyb.com // @version 1.3 // @description 麦能网课程作业、模拟试卷自动答题 // @author robin<37701233@qq.com> // @match http*://*.cjnep.net/lms/web/exam/exambegin* // @match http*://*.cjnep.net/lms/web/exam/examshow* // @license GPL // @icon http://fs.cjnep.net/resources/public/favicon.ico // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; function getanswer(){ var $question=$('.questiondiv>.ptypediv'); for(var i=0;i<$question.length;i++) { var $item=$($question[i]).find('.sdiv>.contdiv'); for(var j=0;j<$item.length;j++) { var $c=$($item[j]); var $t=$c.find('.namediv').text(); var $type=$c.find('.itemdiv>.optiondiv').length; var $a=$c.find('.ansdiv>span'); var $p=($a.length/2); var $ans=[]; var $ansind=0; for(var k=$p;k<$a.length;k++){ if($($($a[k]).find('input')[0]).is(':checked')){ $ans.push($type ? $($a[k]).text() : $ansind.toString()); } $ansind ++; } sessionStorage.setItem($t,$ans.join('|')); } } } function autoanswer(){ var $question=$('.questiondiv>.ptypediv'); $('.answerdiv>.btndiv').append('