Greasy Fork is available in English.

升学 E 网通 (EWT360) 试题分析获取 - Beta

此脚本在 EWT 试题中获取试题分析。

< Feedback on 升学 E 网通 (EWT360) 试题分析获取 - Beta

Review: Good - script works

§
Posted: 4.8.2022

大佬能出一个看答案的插件嘛qwp

houtarAuthor
§
Posted: 7.8.2022

大佬能出一个看答案的插件嘛qwp

@Mydreams-awa 抱歉,由于我的能力很差,除了 答案分析 部分的答案外,我不能在新版本的 升学e网通 的网络请求中找到任何关于答案的内容。在以后的更新中,我可能会添加诸如自动从分析中获取答案的功能。

§
Posted: 22.8.2022

大佬,我一个朋友写了个软件可以获取答案qwp
不过他是基于易语言的
附其开源链接:https://github.com/zhicheng233/EWT-get-answer
望大佬出一个脚本!!

§
Posted: 23.8.2022

大佬,我一个朋友写了个软件可以获取答案qwp
不过他是基于易语言的
附其开源链接:https://github.com/zhicheng233/EWT-get-answer
望大佬出一个脚本!!

冒泡doge

houtarAuthor
§
Posted: 24.8.2022

大佬,我一个朋友写了个软件可以获取答案qwp不过他是基于易语言的附其开源链接:https://github.com/zhicheng233/EWT-get-answer望大佬出一个脚本!!

@Mydreams-awa 可惜了 我已经没有多余的考试了

我花了大约六个小时把它改成了JS版本 等以后有机会测试了 再写成脚本吧

附代码:

/* 
This program is modified to the JavaScript version based on the program "EWT选择答案获取 V1.3".
The program is for learning and communication purposes only, and commercial or other illegal uses are not allowed.

The author of "EWT选择答案获取 V1.3" is 志成zhi_cheng, and its source code is published at <https://github.com/zhicheng233/EWT-get-answer>.
Both "EWT选择答案获取 V1.3" and this program are released under the GNU General Public License v3.0.
A copy of the license can be found at <http://www.gnu.org/licenses/>

This program comes with ABSOLUTELY NO WARRANTY.

The copyright of "EWT选择答案获取 V1.3" belongs to its author (ie 志成zhi_cheng).
The copyright of this program is: Copyright (C) 2022-2025 Houtar

Email address of the author of "EWT选择答案获取 V1.3": 2473367376@qq.com
Email address of the author of this program: houtarchaat@gmail.com

Houtar, August 24, 2022
 */


let answerPageData // 取返回的数据
let questionNumber
let secondaryQuestionNumber

const getIntermediateText = (text, previousText, laterText) => {
    var m = text.match(new RegExp(previousText + '(.*?)' + laterText));
    return m ? m[1] : '';
}
const delay = ms => new Promise((resolve) => setTimeout(resolve, ms))

const getAnswerByUrl = async (url) => {
    url = url + "&"  // 必须!!否则有些题目会获取不了
    result = '';
    questionNumber = 0;
    // 获取paperId
    paperId = getIntermediateText(url, "paperId=", "&")
    // 获取platform
    platform = getIntermediateText(url, "platform=", "&")
    // 获取bizCode
    bizCode = getIntermediateText(url, "bizCode=", "&")
    // Cookie 更新、获取Cookie
    // 注:浏览器中运行无需Cookie
    // 获取解析
    await getWebData(paperId, platform, bizCode)
    return await getId(result, paperId, platform, bizCode)

}

//获取网页数据
let getWebData = async (paperId, platform, bizCode) => {
    // https://web.ewt360.com/customerApi/api/studyprod/web/answer/paper?paperId=填写&platform=填写&bizCode=填写&reportId=0&isRepeat=0
    //   ewt流出的API 用来获取questionId


    answerPageData = await (await fetch("https://web.ewt360.com/customerApi/api/studyprod/web/answer/paper?paperId=" + paperId + "&platform=" + platform + "&bizCode=" + bizCode + "&reportId=0&isRepeat=0")).text()

}
//拆分解析数据
let getId = async (result, paperId, platform, bizCode) => {
    let questionId;

    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看
    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看
    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看

    questionId = "null"  // 初始化变量,不然循环跑不起来!!


    // 已弃用
    // |这里先跑一次防止最前面的ID获取不了!!是[{ 不是 },{
    // |questionId = 文本_取出中间文本 (答题页面数据, "[{" + '"' + "id" + '"' + ":" + '"', '"' + "," + '"' + "scoreCriterion", , )
    // |答题页面数据 = 子文本替换 (答题页面数据, "[{" + '"' + "id" + '"' + ":" + '"' + questionId + '"' + "," + '"' + "scoreCriterion", " ", , , 假)
    // |获取答案 (questionId)
    // 传递questionId为 获取答案的参数



    await delay(500)
    // 一个简单的循环,如果id为空时停止循环(就是判断获取完没)
    while (questionId != "") {

        // 取出文本,但有些在这里取出会有问题所以下面还加个判断再处理一次
        questionId = getIntermediateText(answerPageData, "{" + '"' + "id" + '"' + ":" + '"', '"' + "," + '"' + "scoreCriterion")

        // 正常取出是没有"ID"这给字符串的,应该为整数数据,所以如果questionId里有"id"则进行处理
        if ((questionId.indexOf("id")) != -1) {  // 找到了就执行下面
            questionId = questionId + "!"  // 加个标识符,不然下面行运行不了
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")  // 取id
        }
        // 有时取出来还是有问题的,但里面没有"id"所以判断是否有"title"
        if ((questionId.indexOf("title")) != -1) {
            questionId = questionId + "!"
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")
        }

        while ((questionId.indexOf("title")) != -1) {
            questionId = questionId + "!"
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")
        }


        // 取完后删除取出的文本(替换成"")避免干扰,不然只会一直取出一个数据
        answerPageData = (answerPageData.replace("{" + '"' + "id" + '"' + ":" + '"' + questionId + '"' + "," + '"' + "scoreCriterion", " ",))

        if (secondaryQuestionNumber != 0) {  // 通过为真这跳过获取答案子程序
            secondaryQuestionNumber = secondaryQuestionNumber - 1
        }
        else {
            result = await getAnswer(questionId, result, paperId, platform, bizCode)  // 传递questionId为 获取答案的参数
        }

        await delay(500)
        return result;

    }




}
//调用api获取答案
let getAnswer = async (questionId, result, paperId, platform, bizCode) => {
    let correctAnswer;
    let answerWebData;



    // "https://web.ewt360.com/customerApi/api/studyprod/web/answer/quesiton/analysis?questionId=填写&paperId=填写&reportId=填写&platform=填写&bizCode=填写"
    // EWT新流出的API
    // 发现 By 志成zhi_cheng#2885


    correctAnswer = "null"  // 初始化

    answerWebData = await (await fetch("https://web.ewt360.com/customerApi/api/studyprod/web/answer/quesiton/analysis?questionId=" + questionId + "&paperId=" + paperId + "&reportId=1&platform=" + platform + "&bizCode=" + bizCode)).text()

    questionNumber = questionNumber + 1
    while (correctAnswer != "") {

        correctAnswer = getIntermediateText(answerWebData, "rightAnswer" + '"' + ":[" + '"', '"' + "]",)
        // 取完后删除取出的文本(替换成"")避免干扰,不然只会一直取出一个数据
        answerWebData = (answerWebData.replace("rightAnswer" + '"' + ":[" + '"', " "))  // 我是傻逼,因为这里没写全导致排
        if (correctAnswer = "") {  // 如果取到的是 空 就跳出循环
            break
        }

        // 对HTML预留字符进行替换(如果有的话)
        correctAnswer = correctAnswer.replace("&nbsp;", " ")  // 空格
        correctAnswer = correctAnswer.replace("&lt;", "<")  // <
        correctAnswer = correctAnswer.replace("&gt;", ">")  // <
        correctAnswer = correctAnswer.replace("&amp;", "&")  // &
        correctAnswer = correctAnswer.replace("&quot;", '"')  // "
        correctAnswer = correctAnswer.replace("&apos;", ",")  // ,

        secondaryQuestionNumber = secondaryQuestionNumber + 1


        result = result + questionNumber.toString() + "(" + secondaryQuestionNumber.toString() + ")" + ":" + correctAnswer + "!" + '\n'
        await delay(500)

    }


    if (secondaryQuestionNumber = 1) {  // 1=单题,要重置一下,不然会漏掉,我当时又傻逼了Debug了一个小时才想到
        secondaryQuestionNumber = 0
    }

    // 如果 (correctAnswer = "" 或 文本_寻找文本 (correctAnswer, "<", , ) != -1)
    // 编辑框EX6.内容 = 编辑框EX6.内容 + "非选择题已忽略!!!" + #换行符

    return result


}
§
Posted: 25.8.2022

大佬,我一个朋友写了个软件可以获取答案qwp不过他是基于易语言的附其开源链接:https://github.com/zhicheng233/EWT-get-answer望大佬出一个脚本!!

@Mydreams-awa 可惜了
我已经没有多余的考试了

我花了大约六个小时把它改成了JS版本
等以后有机会测试了
再写成脚本吧

附代码:

/* 
This program is modified to the JavaScript version based on the program "EWT选择答案获取 V1.3".
The program is for learning and communication purposes only, and commercial or other illegal uses are not allowed.

The author of "EWT选择答案获取 V1.3" is 志成zhi_cheng, and its source code is published at <https://github.com/zhicheng233/EWT-get-answer>.
Both "EWT选择答案获取 V1.3" and this program are released under the GNU General Public License v3.0.
A copy of the license can be found at <http://www.gnu.org/licenses/>

This program comes with ABSOLUTELY NO WARRANTY.

The copyright of "EWT选择答案获取 V1.3" belongs to its author (ie 志成zhi_cheng).
The copyright of this program is: Copyright (C) 2022-2025 Houtar

Email address of the author of "EWT选择答案获取 V1.3": 2473367376@qq.com
Email address of the author of this program: houtarchaat@gmail.com

Houtar, August 24, 2022
 */


let answerPageData // 取返回的数据
let questionNumber
let secondaryQuestionNumber

const getIntermediateText = (text, previousText, laterText) => {
    var m = text.match(new RegExp(previousText + '(.*?)' + laterText));
    return m ? m[1] : '';
}
const delay = ms => new Promise((resolve) => setTimeout(resolve, ms))

const getAnswerByUrl = async (url) => {
    url = url + "&"  // 必须!!否则有些题目会获取不了
    result = '';
    questionNumber = 0;
    // 获取paperId
    paperId = getIntermediateText(url, "paperId=", "&")
    // 获取platform
    platform = getIntermediateText(url, "platform=", "&")
    // 获取bizCode
    bizCode = getIntermediateText(url, "bizCode=", "&")
    // Cookie 更新、获取Cookie
    // 注:浏览器中运行无需Cookie
    // 获取解析
    await getWebData(paperId, platform, bizCode)
    return await getId(result, paperId, platform, bizCode)

}

//获取网页数据
let getWebData = async (paperId, platform, bizCode) => {
    // https://web.ewt360.com/customerApi/api/studyprod/web/answer/paper?paperId=填写&platform=填写&bizCode=填写&reportId=0&isRepeat=0
    //   ewt流出的API 用来获取questionId


    answerPageData = await (await fetch("https://web.ewt360.com/customerApi/api/studyprod/web/answer/paper?paperId=" + paperId + "&platform=" + platform + "&bizCode=" + bizCode + "&reportId=0&isRepeat=0")).text()

}
//拆分解析数据
let getId = async (result, paperId, platform, bizCode) => {
    let questionId;

    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看
    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看
    // 重点!!!!这里写了好久,所以特意把注释写的非常详细,慢慢看

    questionId = "null"  // 初始化变量,不然循环跑不起来!!


    // 已弃用
    // |这里先跑一次防止最前面的ID获取不了!!是[{ 不是 },{
    // |questionId = 文本_取出中间文本 (答题页面数据, "[{" + '"' + "id" + '"' + ":" + '"', '"' + "," + '"' + "scoreCriterion", , )
    // |答题页面数据 = 子文本替换 (答题页面数据, "[{" + '"' + "id" + '"' + ":" + '"' + questionId + '"' + "," + '"' + "scoreCriterion", " ", , , 假)
    // |获取答案 (questionId)
    // 传递questionId为 获取答案的参数



    await delay(500)
    // 一个简单的循环,如果id为空时停止循环(就是判断获取完没)
    while (questionId != "") {

        // 取出文本,但有些在这里取出会有问题所以下面还加个判断再处理一次
        questionId = getIntermediateText(answerPageData, "{" + '"' + "id" + '"' + ":" + '"', '"' + "," + '"' + "scoreCriterion")

        // 正常取出是没有"ID"这给字符串的,应该为整数数据,所以如果questionId里有"id"则进行处理
        if ((questionId.indexOf("id")) != -1) {  // 找到了就执行下面
            questionId = questionId + "!"  // 加个标识符,不然下面行运行不了
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")  // 取id
        }
        // 有时取出来还是有问题的,但里面没有"id"所以判断是否有"title"
        if ((questionId.indexOf("title")) != -1) {
            questionId = questionId + "!"
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")
        }

        while ((questionId.indexOf("title")) != -1) {
            questionId = questionId + "!"
            questionId = getIntermediateText(questionId, "{" + '"' + "id" + '"' + ":" + '"', "!")
        }


        // 取完后删除取出的文本(替换成"")避免干扰,不然只会一直取出一个数据
        answerPageData = (answerPageData.replace("{" + '"' + "id" + '"' + ":" + '"' + questionId + '"' + "," + '"' + "scoreCriterion", " ",))

        if (secondaryQuestionNumber != 0) {  // 通过为真这跳过获取答案子程序
            secondaryQuestionNumber = secondaryQuestionNumber - 1
        }
        else {
            result = await getAnswer(questionId, result, paperId, platform, bizCode)  // 传递questionId为 获取答案的参数
        }

        await delay(500)
        return result;

    }




}
//调用api获取答案
let getAnswer = async (questionId, result, paperId, platform, bizCode) => {
    let correctAnswer;
    let answerWebData;



    // "https://web.ewt360.com/customerApi/api/studyprod/web/answer/quesiton/analysis?questionId=填写&paperId=填写&reportId=填写&platform=填写&bizCode=填写"
    // EWT新流出的API
    // 发现 By 志成zhi_cheng#2885


    correctAnswer = "null"  // 初始化

    answerWebData = await (await fetch("https://web.ewt360.com/customerApi/api/studyprod/web/answer/quesiton/analysis?questionId=" + questionId + "&paperId=" + paperId + "&reportId=1&platform=" + platform + "&bizCode=" + bizCode)).text()

    questionNumber = questionNumber + 1
    while (correctAnswer != "") {

        correctAnswer = getIntermediateText(answerWebData, "rightAnswer" + '"' + ":[" + '"', '"' + "]",)
        // 取完后删除取出的文本(替换成"")避免干扰,不然只会一直取出一个数据
        answerWebData = (answerWebData.replace("rightAnswer" + '"' + ":[" + '"', " "))  // 我是傻逼,因为这里没写全导致排
        if (correctAnswer = "") {  // 如果取到的是 空 就跳出循环
            break
        }

        // 对HTML预留字符进行替换(如果有的话)
        correctAnswer = correctAnswer.replace("&nbsp;", " ")  // 空格
        correctAnswer = correctAnswer.replace("&lt;", "<")  // <
        correctAnswer = correctAnswer.replace("&gt;", ">")  // <
        correctAnswer = correctAnswer.replace("&amp;", "&")  // &
        correctAnswer = correctAnswer.replace("&quot;", '"')  // "
        correctAnswer = correctAnswer.replace("&apos;", ",")  // ,

        secondaryQuestionNumber = secondaryQuestionNumber + 1


        result = result + questionNumber.toString() + "(" + secondaryQuestionNumber.toString() + ")" + ":" + correctAnswer + "!" + '\n'
        await delay(500)

    }


    if (secondaryQuestionNumber = 1) {  // 1=单题,要重置一下,不然会漏掉,我当时又傻逼了Debug了一个小时才想到
        secondaryQuestionNumber = 0
    }

    // 如果 (correctAnswer = "" 或 文本_寻找文本 (correctAnswer, "<", , ) != -1)
    // 编辑框EX6.内容 = 编辑框EX6.内容 + "非选择题已忽略!!!" + #换行符

    return result


}


感谢~,刚准备移植

Post reply

Sign in to post a reply.