From b4f18f63ef50eb6867a6771db3cbaf17d982a726 Mon Sep 17 00:00:00 2001 From: Huozy <42334632+Huozzzy@users.noreply.github.com> Date: Tue, 21 Jun 2022 16:56:44 +0800 Subject: [PATCH] =?UTF-8?q?V1.3.4=20=E4=B8=93=E9=A1=B9=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E5=8F=AA=E7=AD=94=E5=BD=93=E5=B9=B4=E9=A2=98=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++--- js/exampaper.js | 5 ++++- js/exampractice.js | 14 ++++++-------- manifest.json | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3f63f5c..802bd4e 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,9 @@ 本插件基于原开源插件`学习小熊`的版本,针对新的文章视频阅读规则开发的二次版本。 ## 更新说明 -v1.3.3(2022-06-02): +v1.3.4(2022-06-21): - 1.5月24日起每周答题官方不再出题,故自动学习每日总分为30+10(如有专项答题) - 2.优化一些小问题 + 1.专项答题只答当年题目 ## 下载 * [最新发布](https://github.com/Huozzzy/Learning-Learner/releases/) diff --git a/js/exampaper.js b/js/exampaper.js index c536231..3b86dc7 100644 --- a/js/exampaper.js +++ b/js/exampaper.js @@ -7,9 +7,12 @@ chrome.runtime.sendMessage({"method": "checkTab"}, {}, function (response) { document.querySelectorAll('.item .right > button').forEach(function (e, b, c) { if (isNextPage) { let i = e.innerText; + let year = e.parentNode.parentNode.firstElementChild.lastElementChild.innerText.slice(0, 4); if (i != "" && (i == '开始答题' || i == '继续答题')) { isNextPage = false; - e.click(); + if ((new Date().getFullYear() == year)) { + e.click(); + } return; } } diff --git a/js/exampractice.js b/js/exampractice.js index a2e9d9a..417188f 100755 --- a/js/exampractice.js +++ b/js/exampractice.js @@ -124,15 +124,13 @@ chrome.runtime.sendMessage({"method": "checkTab"}, {}, function (response) { function answerSubmit(options = 0) { if (options > 0 && ManageType == 'auto') { - setTimeout(function (){ - if(document.querySelector(".action") == null ){ - if(document.querySelector(".submit-btn") != null){ - document.querySelector(".submit-btn").click(); - }else{ - document.querySelector(".next-btn").click(); - } + if ($(".submit-btn").length) { + $(".submit-btn").click(); + } else { + if ($(".next-btn").length) { + $(".next-btn").click(); } - },500); + } setTimeoutFunc = setTimeout(getAnswers, parseInt(Math.random() * 1000)); } } diff --git a/manifest.json b/manifest.json index 2c541de..f1e2aff 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_extName__", - "version": "1.3.3", + "version": "1.3.4", "default_locale": "zh_CN", "description": "__MSG_extDescription__", "icons": {