Greasy Fork is available in English.

AnswerTip

http://tampermonkey.net/

// ==UserScript==
// @name         AnswerTip
// @description  http://tampermonkey.net/
// @version      0.32
// @author       polygon
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAEwZJREFUeF7tnQ2QJVV1x8/peUNhEoPUrlJSErA0JuaDxDIFEvmYfX37sZOE1VVY1BBwZfEjfIQ1fhFNYGOCEDWsYUhM4gdKJAhCMOBO9vW5s29hE8SqNUTjVyUhqdUQo25GLZdF970+qQtvi91lXvft+7rf6+57umpqa2vuOfec/7m/6Y/bfS+CHKKAKDBSARRtRAFRYLQCAoiMDlEgRQEBRIaHKCCAyBgQBdwUkDOIm25i5YkCAognhZY03RQQQNx0EytPFBBAPCm0pOmmgADipptYeaKAAOJJoSVNNwUEEDfdxMoTBQQQTwotabopIIC46SZWnigggHhSaEnTTQEBxE03sfJEAQHEk0JLmm4KCCBuuomVJwoIIJ4UWtJ0U0AAcdNNrDxRQADxpNCSppsCAoibbmLliQICiCeFljTdFBBA3HQTK08UEEA8KbSk6aaAAOKmm1h5ooAA4kmhJU03BQQQN93EyhMFBBBPCi1puikggLjpJlaeKCCAeFJoSdNNAQHETTex8kQBAcSTQkuabgoIIG66Vd4qDMNViPhTAHDkzzEAsOfIn36/v6fX6/Urn9iEAxRAJix4Gd212+0TEVEh4q8BwAuHUPy4Q1+PGHAQccdgMLh3aWnpnxx8NMpEAKlhOc8555wf279//xnMfCYizgPAi0pKYy8z3xMEwRIz7yQic+bx6hBAalRupdQlALAWANoA8IwphL4DAHb2+/2ber3ed6bQ/8S7FEAmLnn+DpVSGwDgMgA4I791KRYPA8DC8vLywu7duw+U0kNFnAogFSnESmGEYbgWEQ0Yv17RMB9i5gWt9YcrGt/YYQkgY0tYvIMwDE8bgvGa4r2X4nFnEAQL3W73U6V4n6JTAWSK4o84a1yPiG+rWFi24dx11FFHXbpt27Zv2hpUvZ0AUqEKKaXuBIBX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440CAog3pZZEXRQQQFxUExtvFBBAvCm1JOqigADioprYeKOAAOJNqSVRFwUEEBfVxMYbBQQQb0otibooIIC4qCY23igggHhTaknURQEBxEU1sfFGAQHEm1JLoi4KCCAuqomNNwoIIN6UWhJ1UUAAcVFNbLxR4P8BHAwOMoxQKrMAAAAASUVORK5CYII=
// @match        https://changjiang.yuketang.cn/*/exercise/*
// @match        https://changjiang-exam.yuketang.cn/exam/*
// @match        https://changjiang.yuketang.cn/*
// @match        https://www.xuetangx.com/*/exercise/*
// @match        https://mooc1.chaoxing.com/work/doHomeWorkNew*
// @match        https://examination.xuetangx.com/exam/*
// @match        https://onlineexamh5new.zhihuishu.com/*
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_addElement
// @run-at       document-end
// @namespace http://tampermonkey.net/
// ==/UserScript==
(function() {
    const order = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
    const n = 10
    const wait = 3  // s
    const configs = {
        'onlineexamh5new.zhihuishu.com': {
            main: '.examPaper_subject',  // 答案要展示的父级元素节点,会append到该Node下
            question: '.subject_describe',  // 问题,题目所在位置,其innerText属性是问题(不含选项)
            options: '.subject_node p span, .node_detail p',  // 每个选项的位置,会根据它匹配多个Node
            select: 'onChecked',  // 点击后,相应属性增加值,因为有的选项需要多次点击,所以增加此用于判断是否点击上
            // 一些自定义添加的答案区域style
            style: `
                background-color: #f5f5f5;
                height: 200px;
                overflow-y: scroll;
            `
        },
        'changjiang.yuketang.cn': {
            main: '.item-body',  // 答案要展示的父级元素节点,会append到该Node下
            question: '.problem-body',  // 问题,题目所在位置,其innerText属性是问题(不含选项)
            options: '.item-body ul li label',  // 每个选项的位置,会根据它匹配多个Node
            select: 'is-checked',  // 点击后,相应属性增加值,因为有的选项需要多次点击,所以增加此用于判断是否点击上
            // 一些自定义添加的答案区域style
            style: `
                background-color: #f5f5f5;
            `
        },
        'changjiang-exam.yuketang.cn': {
            main: '.item-body',
            question: 'h4',
            options: '.item-body ul li label',
            select: 'is-checked',
            style: `
                background-color: #f5f5f5;
                height: 200px;
                overflow-y: scroll;
            `
        },
        'www.xuetangx.com': {
            main: '.courseActionLesson',
            question: '.leftQuestion',
            options: '.leftradio',
            select: 'active',
            style: `
                background-color: #fcfcfc;
                border: 1px solid hsla(0,0%,81.2%,.31);
                width: 500px;
                height: 200px;
                overflow-y: scroll;
            `
        },
        'mooc1.chaoxing.com': {
            main: '.TiMu',
            question: '.Zy_TItle div p',
            options: 'ul li',
            select: 'Hover',
            style: `
                background-color: #fcfcfc;
                height: 200px;
                overflow-y: scroll;
            `
        },
        'examination.xuetangx.com': {
            main: '.subject-item',
            question: '.item-body',
            options: 'ul li',
            select: 'is-checked',
            style: `
                background-color: #fcfcfc;
                height: 200px;
                overflow-y: scroll;
            `
        }
    }
    let url = window.location.href
    let host = Object.keys(configs).filter((host) => {
        if (url.includes(host)) {
            return true
        }
        return false
    })
    if (host.length == 0) return
    const config = configs[host[0]]
    GM_addStyle(`
            .answer-polygon {
                ${config.style};
                font-size: 14px;
                border-radius: 4px;
                padding: 10px 15px;
                margin-bottom: 20px;
                text-align: left;
                font-family: -apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,"sans-serif";
            }
        `)
    let cookieSet = () => {
        GM_xmlhttpRequest({
            method: 'POST',
            url: 'https://tiku.fenbi.com/android/tourist/enter',
            responseType: 'json',
            onload: (xhr) => {
                const data = xhr.response
                let cookie = `userid=${data.userId}; tourist=${data.touristToken};`
                console.log(cookie)
            }
        })
    }
    let clickOption = (optionNodes, text) => {
        optionNodes.forEach((optionNode) => {
            let option_text = optionNode.innerText.replaceAll('[p]', '').replaceAll('[/p]', '').split('\n').slice(-1)
            console.log(option_text, text)
            if (option_text.includes(text)||text.includes(option_text)) {
                let id = setInterval(() => {
                    if (!optionNode.innerHTML.includes(config.select)) {
                        optionNode.click()
                    } else {
                        clearInterval(id)
                    }
                }, 3000)
            }
        })
    }
    let answerParser = (data, answerNode, optionNodes, mainNode) => {
        let s = ''
        let answer_groups = []
        for (let i=0;i<n;i++) {
            let item = data['questionList'][i]
            // 1 题目
            s += item['content'].replaceAll('[', '<').replaceAll(']', '>') + '<br/>'
            const re = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?%+_]", 'g');
            let same = item['content'].replaceAll(re, '').includes(mainNode.getAttribute('currentQuestion').replaceAll(re, '').split('\n')[0])
            if (same) {
                answer_groups.push([])
            }
            // 2 正确答案
            // 2.1 选项形式 ABCD
            if (item['correctAnswer'].hasOwnProperty('choice')) {
                let choice_indexes = item['correctAnswer']['choice'].split(',')
                if (choice_indexes.length > 0) {
                    let choice_orders = []
                    for (let j=0;j<choice_indexes.length;j++) {
                        let choice_order = order[parseInt(choice_indexes[j])]
                        if (!choice_orders.includes(choice_order)) {
                            choice_orders.push(choice_order)
                        }
                    }
                    s += '<p>' + choice_orders.join('') + '</p><br/>'
                    // choice_orders = ['A', 'B', 'C']
                    // 选项
                    if (item['accessories'].length > 0){
                        item['accessories'] = item['accessories'].filter((item) => {
                            return (item.hasOwnProperty('options'))
                        })
                        if (item['accessories'].length > 0 && item['accessories'][0]['options'].length > 0) {
                            let options = item['accessories'][0]['options']
                            for (let j=0;j<options.length;j++) {
                                let option = options[j].replace('[p]', '').replace('[/p]', '')
                                if (choice_orders.includes(order[j])) {
                                    if (same) {
                                        answer_groups[answer_groups.length-1].push(options[j])
                                    }
                                    // if (same) clickOption(optionNodes, options[j])
                                    s += `<b>[${order[j]}] ` + option + '</b><br/>'
                                } else {
                                    s += `[${order[j]}] ` + option + '<br/>'
                                }

                            }

                        }
                    }
                }
            // 2.2 文字描述形式
            } else if (item['correctAnswer'].hasOwnProperty('answer')) {
                let text = item['correctAnswer']['answer']
                    .replace('', '<br/>')
                    .replace('\u0001', '<br/>')
                    .replace('\x01', '<br/>')
                    .replace(/-+/g, '<br/>')
                    .replaceAll('[', '<')
                    .replaceAll(']', '>')
                    .replace(';;', ';')
                if (same) {
                    text.replace('<p>', '')
                        .replace('</p>', '')
                        .split('<br/>')
                        .forEach((option_text) => {
                            answer_groups[answer_groups.length-1].push(option_text)
                            // clickOption(optionNodes, option_text)
                        })
                }
                s += '<b>' + text + '</b>'
            }
            if (i < n-1) {
                s += '<br/><hr/><br/>'
            }
        }
        // 判断是否为多选
        let multi = false
        answer_groups.forEach((group) => {
            if (group.length > 1) {
                multi = true
            }
        })
        if (multi) {
            answer_groups = answer_groups.filter((group) => {
                return group.length > 1
            })
        }
        let answers = []
        if (answer_groups.length == 1) {
            answers = answer_groups[0]
        } else {
            // 取交集
            // 得到所有答案元素
            let answer_items = []
            answer_groups.forEach((group) => {
                group.forEach((item) => {
                    if (!answer_items.includes(item)) {
                        answer_items.push(item)
                    }
                })
            })
            answers = answer_items.filter((item) => {
                let b = true
                answer_groups.forEach((group) => {
                    if (!group.includes(item)) {
                        b = false
                    }
                })
                return b
            })
        }
        console.log(answers)
        answers.forEach((answer) => {
            clickOption(optionNodes, answer)
        })
        answerNode.innerHTML = s
    }
    let searchAnswer = (text, answerNode, optionNodes, mainNode) => {
        GM_xmlhttpRequest({
            method: 'POST',
            url: 'https://schoolapi.fenbi.com/college/android/search-item/search?format=ubb&searchType=2&text=' + encodeURIComponent(text),
            responseType: 'json',
            onload: (xhr) => {
                let res = xhr.response
                let enc = res['data']
                if (enc == null) {
                    if (res.errMessage.includes('次数')) {
                        cookieSet()
                    }
                    answerNode.innerHTML = xhr.response.errMessage
                    setTimeout(() => {
                        mainNode.setAttribute('currentQuestion', '')
                    }, wait * 1000);
                    return
                }
                // 解密
                let t = new Date().valueOf()
                GM_xmlhttpRequest({
                    method: 'POST',
                    url: `http://101.35.131.22:5500/decrypt`,
                    headers:  {
                        "Content-Type": "application/x-www-form-urlencoded"
                    },
                    data: `enc=${enc}`,
                    responseType: 'text',
                    onload: (xhr) => {
                        let data = JSON.parse(xhr.responseText)
                        answerParser(data, answerNode, optionNodes, mainNode)
                    }
                })
            },
            ontimeout: function () {
                answer.innerHTML = "No Sugesstion"
            }
        })
    }
    cookieSet()
    let id = setInterval(() => {
        let mainNodes = document.querySelectorAll(config.main)
        if (mainNodes.length == 0) return
        clearInterval(id)
        mainNodes.forEach(function(mainNode) {
            mainNode.setAttribute('currentQuestion', '')
            setInterval(() => {
                let questionNode = mainNode.querySelector(config.question)
                if (questionNode == null) return
                let text = questionNode.innerText.slice(0, 233)
                if (text == mainNode.getAttribute('currentQuestion')) return
                mainNode.setAttribute('currentQuestion', text)
                let answerNode = mainNode.querySelector('.answer-polygon')
                if (answerNode == null) {
                    answerNode = document.createElement('div')
                    answerNode.setAttribute('class', 'answer-polygon')
                    mainNode.append(answerNode)
                }
                try {
                    answerNode.innerHTML = 'searching...'
                } catch {
                    return
                }
                let optionNodes = mainNode.querySelectorAll(config.options)
                searchAnswer(text, answerNode, optionNodes, mainNode)
            }, 6000)
        })
    }, 233)
})();