Skip to content

Commit

Permalink
V1.3.2
Browse files Browse the repository at this point in the history
更新答题规则
  • Loading branch information
Huozzzy committed May 26, 2022
1 parent b1d1efd commit 8051cf4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
本插件基于原开源插件`学习小熊`的版本,针对新的文章视频阅读规则开发的二次版本。

## 更新说明
v1.3.1(2022-04-24):
v1.3.2(2022-05-26):

优化部分逻辑。
5.24起,每周答题官方不再出题。故自动学习每日总分为30+10(如有专项答题)

已知问题:每日答题和专项答题在关闭时会出现一个重定向的问题,但是不影响学习过程。

## 下载
* [最新发布](https://github.com/Huozzzy/Learning-Learner/releases/)
Expand All @@ -24,10 +26,6 @@ v1.3.1(2022-04-24):

其余浏览器安装方法,请自行搜索!

## 多账号
* 在Chrome中创建多个用户,使用不同的用户运行。
* 或在多个不同的浏览器中运行。

## 许可证
![GPLv3](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)
* 本程序为自由软件,在自由软件联盟发布的GNU通用公共许可协议的约束下,你可以对其进行再发布及修改。协议版本为第三版或(随你)更新的版本。
Expand Down
43 changes: 22 additions & 21 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let urlMap = {
"scoreApi": "https://pc-proxy-api.xuexi.cn/api/score/days/listScoreProgress?sence=score&deviceType=2",
"channelApi": "https://www.xuexi.cn/lgdata/",
"dailyAsk": ["https://pc.xuexi.cn/points/exam-practice.html"],
"weeklyAsk": ["https://pc.xuexi.cn/points/exam-weekly-list.html"],
// "weeklyAsk": ["https://pc.xuexi.cn/points/exam-weekly-list.html"],
"paperAsk": ["https://pc.xuexi.cn/points/exam-paper-list.html"]
};
let channel = {
Expand Down Expand Up @@ -179,32 +179,33 @@ function autoEarnPoints(timeout) {
case 200:
if (score[key].currentScore < score[key].dayMaxScore) {
type = "article";
newTime = 60 * 1000 + Math.floor(Math.random() * 3 * 1000);
newTime = 60 * 1000 + Math.floor(Math.random() * 1 * 1000);
}
break;
case 300:
case 400:
if (score[key].currentScore < score[key].dayMaxScore) {
type = "video";
newTime = 60 * 1000 + Math.floor(Math.random() * 3 * 1000);
newTime = 60 * 1000 + Math.floor(Math.random() * 1 * 1000);
}
break;
case 500:
if (score[key].currentScore < score[key].dayMaxScore) {
type = "exam-practice";
newTime = 50 * 1000 + Math.floor(Math.random() * 1 * 1000);
}
break;
case 600:
if (weeklyTitle == 0 && score[key].currentScore <= 0) {
type = "exam-weekly";
newTime = 50 * 1000 + Math.floor(Math.random() * 2 * 1000);
newTime = 20 * 1000 + Math.floor(Math.random() * 1 * 1000);
}
break;
// 2022-5-24 每周答题不再有新题,跳过每周答题积分的检查
// case 1700:
// if (weeklyTitle == 0 && score[key].currentScore <= 0) {
// type = "exam-weekly";
// newTime = 50 * 1000 + Math.floor(Math.random() * 2 * 1000);
// }
// break;
case 700:
if (paperTitle == 0 && score[key].currentScore <= 0) {
type = "exam-paper";
newTime = 60 * 1000 + Math.floor(Math.random() * 3 * 1000);
newTime = 30 * 1000 + Math.floor(Math.random() * 3 * 1000);
}
break;

Expand All @@ -225,9 +226,9 @@ function autoEarnPoints(timeout) {
if (type === 'exam-practice') {
channelUrls["exam-practice"] = urlMap.dailyAsk;
}
if (type === 'exam-weekly') {
channelUrls["exam-weekly"] = urlMap.weeklyAsk;
}
// if (type === 'exam-weekly') {
// channelUrls["exam-weekly"] = urlMap.weeklyAsk;
// }
if (type === 'exam-paper') {
channelUrls["exam-paper"] = urlMap.paperAsk;
}
Expand Down Expand Up @@ -450,7 +451,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
notice(chrome.i18n.getMessage("extWorking"), chrome.i18n.getMessage("extWarning"));
setTimeout(function () {
channelUrls["exam-practice"] = urlMap.dailyAsk;
channelUrls["exam-weekly"] = urlMap.weeklyAsk;
// channelUrls["exam-weekly"] = urlMap.weeklyAsk;
channelUrls["exam-paper"] = urlMap.paperAsk;
getChannelData("article", function (list) {
channelUrls["article"] = list;
Expand Down Expand Up @@ -511,12 +512,12 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
}
}
break;
case "weeklyTitle":
weeklyTitle = 1;
sendResponse({
"weeklyTitle": weeklyTitle
});
break;
// case "weeklyTitle":
// weeklyTitle = 1;
// sendResponse({
// "weeklyTitle": weeklyTitle
// });
// break;
case "paperTitle":
paperTitle = 1;
sendResponse({
Expand Down
10 changes: 9 additions & 1 deletion js/exampractice.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@ chrome.runtime.sendMessage({"method": "checkTab"}, {}, function (response) {
function answerSubmit(options = 0) {
if (options > 0 && ManageType == 'auto') {
setTimeout(function (){
!document.querySelector(".next-btn").disabled ? document.querySelector(".next-btn").click() : document.querySelector(".submit-btn").click();
if(document.querySelector(".action") == null ){
if(document.querySelector(".submit-btn") != null){
document.querySelector(".submit-btn").click();
}else{
document.querySelector(".next-btn").click();
}
}else {
closeWindow();
}
},1000);
setTimeoutFunc = setTimeout(getAnswers, parseInt(Math.random() * 1000));
}
Expand Down
10 changes: 1 addition & 9 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_extName__",
"version": "1.3.1",
"version": "1.3.2",
"default_locale": "zh_CN",
"description": "__MSG_extDescription__",
"icons": {
Expand Down Expand Up @@ -64,14 +64,6 @@
"*://pc.xuexi.cn/points/exam-paper-detail.html*"
]
},
{
"js": [
"js/examweek.js"
],
"matches": [
"*://pc.xuexi.cn/points/exam-weekly-list.html*"
]
},
{
"js": [
"js/exampaper.js"
Expand Down

0 comments on commit 8051cf4

Please sign in to comment.