2021公需课《人工智能发展与产业应用》试题自动答题并提交

《人工智能发展与产业应用》试题自动答题并提交

As of 2021-07-13. See the latest version.

// ==UserScript==
// @name         2021公需课《人工智能发展与产业应用》试题自动答题并提交
// @description  《人工智能发展与产业应用》试题自动答题并提交
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://jsglpt.gdedu.gov.cn/ncts/a_b23243b083e449e79f1c6c269575e7ea/study/course/c_f03e978ceb05464095427119fd8c9ada?offsetTop=*&goLastActivity=N
// @icon         https://jsglpt.gdedu.gov.cn/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var answers = ['A','A','B','B','B','A','A','B','A','A','A','B','C','B','B','B','A','A','D','B','AC','ABD','ABCD','ACD','ACD','AB','ABCD','ABCD','BD','ABC']
    for(var i = 0; i < answers.length; i++){
        var val = answers[i];
        if(val.search('A') != -1)$('.m-topic-item:eq(' + i + ') input:eq(1)')[0].click();
        if(val.search('B') != -1)$('.m-topic-item:eq(' + i + ') input:eq(2)')[0].click();
        if(val.search('C') != -1)$('.m-topic-item:eq(' + i + ') input:eq(3)')[0].click();
        if(val.search('D') != -1)$('.m-topic-item:eq(' + i + ') input:eq(4)')[0].click();
    }
    finishTest();
})();