Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
服务器优化&答题优化
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed May 10, 2019
1 parent b7bbacf commit a0c5d18
Show file tree
Hide file tree
Showing 18 changed files with 111 additions and 108 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/codfrm/cxmooc-tools.svg?label=version)

## 关于超星慕课小工具
一个超星慕课刷课工具,火狐,谷歌,油猴支持.全自动任务,视频倍速秒过,作业考试题库,验证码自动打码(੧ᐛ੭挂科模式,启动)
一个超星(学习通)和智慧树(知到)刷课工具,火狐,谷歌,油猴支持.全自动任务,视频倍速秒过,作业考试题库,验证码自动打码(੧ᐛ੭挂科模式,启动)

### 浏览器适配列表
* [x] Chrome for PC
Expand All @@ -14,6 +14,8 @@
* [x] Tampermonkey

### 功能支持列表
> 详情请看使用文档
* [x] 视频挂机
* [x] 视频秒过
* [x] 视频倍速
Expand Down
2 changes: 1 addition & 1 deletion build/cxmooc-tools/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "超星慕课小工具",
"version": "2.0.8",
"version": "2.1",
"description": "用于超星慕课的小工具",
"icons": {
"16": "img/logo.png",
Expand Down
18 changes: 10 additions & 8 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
{ text: 'Chrome 扩展', link: '/1-UserGuide/1-1-chrome.html' },
{ text: 'FireFox 扩展', link: '/1-UserGuide/1-2-firefox.html' },
{ text: 'Tampermonkey 脚本', link: '/1-UserGuide/1-3-tampermonkey.html' },
{ text: '功能说明', link: '/1-UserGuide/featured.html' },
{ text: '配置说明', link: '/1-UserGuide/1-4-config.html' }
]
},
Expand All @@ -43,6 +44,7 @@ module.exports = {
'1-1-chrome.html', /* /foo/ */
'1-2-firefox.html', /* /foo/one.html */
'1-3-tampermonkey.html',
'featured.html',
'1-4-config.html'
],
},
Expand All @@ -53,10 +55,10 @@ module.exports = {
// message: "New content is available.",
// buttonText: "Refresh"
// }
updatePopup: {
message: "文档有更新,新的内容已准备就绪",
buttonText: "刷新获取新内容"
}
updatePopup: {
message: "文档有更新,新的内容已准备就绪",
buttonText: "刷新获取新内容"
}
},
// 假定是 GitHub. 同时也可以是一个完整的 GitLab URL
repo: 'CodFrm/cxmooc-tools',
Expand All @@ -78,11 +80,11 @@ module.exports = {
},
plugins: [
['@vuepress/back-to-top'],
[
[
'@vuepress/google-analytics',
{
'ga': 'UA-138255059-2'
'ga': 'UA-138255059-2'
}
]
]
]
]
}
2 changes: 1 addition & 1 deletion docs/1-UserGuide/1-1-chrome.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ title: Chrome插件
下载[发布版本](https://github.com/CodFrm/cxmooc-tools/releases)cxmooc-tools.crx文件,直接拖入浏览器安装
某些浏览器允许直接拖入扩展进行安装。(内核为Chromium,如果不行,请按照方法2来)

- 支持列表
#### 支持列表
> 可以通过下方**在 GitHub 上编辑此页**来进行补充
* 360极速浏览器
Expand Down
2 changes: 0 additions & 2 deletions docs/1-UserGuide/1-2-firefox.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ title: FireFox插件
[应用市场](https://addons.mozilla.org/zh-CN/firefox/addon/%E8%B6%85%E6%98%9F%E6%85%95%E8%AF%BE%E5%B0%8F%E5%B7%A5%E5%85%B7/)
下载安装插件。

如果火狐出现题库错误等问题,请访问一次这个网址:[https://blog.icodef.com:8081/](https://blog.icodef.com:8081/),允许访问通过

## 火狐手机版(Android)
> 待完善,可以下载app后在商店安装,但是功能并不保证稳定(超星手机浏览器无法完成视频任务点)
13 changes: 10 additions & 3 deletions docs/1-UserGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ title: 开始
本插件提供多种使用方式,请按照需求查阅相应的文档支持

## 小白
小白用户建议使用FireFox浏览器,前往FireFox商店下载更新:[FireFox](/1-UserGuide/1-2-firefox.html)
小白用户建议使用FireFox浏览器,前往FireFox商店下载更新:[**FireFox**](/1-UserGuide/1-2-firefox.html)

或者使用已经打包好了的浏览器版本使用:[打包版浏览器](/1-UserGuide/1-1-chrome.html#%E6%89%93%E5%8C%85%E7%89%88%E6%B5%8F%E8%A7%88%E5%99%A8),但是这个更新速度较慢,也可以自己手动更新
或者使用已经打包好了的浏览器版本使用:[**打包版浏览器**](/1-UserGuide/1-1-chrome.html#打包版浏览器),但是这个更新速度较慢,也可以自己手动更新

最近也发布了一个智慧树的版本,油猴脚本:[https://greasyfork.org/zh-CN/scripts/382037-%E6%99%BA%E6%85%A7%E6%A0%91%E5%B0%8F%E5%B7%A5%E5%85%B7](https://greasyfork.org/zh-CN/scripts/382037-%E6%99%BA%E6%85%A7%E6%A0%91%E5%B0%8F%E5%B7%A5%E5%85%B7),插件是全部整合的
## 油猴

超星油猴脚本:[https://greasyfork.org/zh-CN/scripts/376190-超星慕课小工具](https://greasyfork.org/zh-CN/scripts/376190-%E8%B6%85%E6%98%9F%E6%85%95%E8%AF%BE%E5%B0%8F%E5%B7%A5%E5%85%B7)

智慧树油猴脚本:[https://greasyfork.org/zh-CN/scripts/382037-智慧树小工具](https://greasyfork.org/zh-CN/scripts/382037-%E6%99%BA%E6%85%A7%E6%A0%91%E5%B0%8F%E5%B7%A5%E5%85%B7)

**插件是全部整合的**

[telegram群](https://t.me/joinchat/MHU8Gg2fP3Q51HLY2wqmQA) [QQ群](https://shang.qq.com/wpa/qunwpa?idkey=9bddd2564d84bd999940de422d1c0c70f87ecaf02fe9d7c60389fc2b376179eb)

- 开发者
- Chrome插件
- FireFox插件
- 油猴脚本
- 功能说明
- 使用说明
23 changes: 23 additions & 0 deletions docs/1-UserGuide/featured.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: 功能说明
---

## 超星
* [x] 视频挂机
* [x] 视频秒过
* [x] 视频倍速
* [x] 静音播放
* [x] 自动答题
* [x] 自动阅读
* [x] 自动填写验证码
* [x] 考试答题
* [x] 作业答题
* [x] 手机任务解锁

## 智慧树
* [x] 视频挂机
* [x] 视频秒过
* [x] 视频倍速
* [x] 静音播放
* [x] 题目屏蔽
* [x] 检测答题
11 changes: 1 addition & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,4 @@ footer: MIT Licensed | Copyright © 2018 CXmooc-tool developer Team
* Chrome 系浏览器

### 功能支持列表

* 视频挂机
* 视频秒过
* 视频倍速
* 静音播放
* 自动答题
* 自动阅读
* 自动填写验证码
* 考试答题

**详情请看->[功能说明](/1-UserGuide/featured.html)**
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cxmooc-tools",
"version": "2.0.8",
"version": "2.1.0",
"description": "> 一个快速学习超星慕课的chrome扩展工具(੧ᐛ੭挂科模式,启动)\r > 初次开发chrome扩展,有兴趣的朋友可以一起来哦",
"main": "mooc.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
url: "https://cx.icodef.com/",
version: 2.09,
version: 2.10,
update: 'https://github.com/CodFrm/cxmooc-tools/releases',
enforce: false,
cx: {
Expand Down
45 changes: 15 additions & 30 deletions src/cxmooc-tools/chaoxing/exam.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
text = text.substr(0, text.lastIndexOf('('));
return text;
},
geTHomeworkTopic: function () {
getHomeworkTopic: function () {
let topic = $('.Zy_TItle.clearfix .clearfix');
if (topic.length <= 0) {
return undefined;
Expand Down Expand Up @@ -62,35 +62,20 @@ module.exports = {
btn.onclick = function () {
$(btn).text('搜索中...');
//搜索答案
let topic = self.geTHomeworkTopic();
let topic = self.getHomeworkTopic();
if (topic == undefined) {
return false;
}
function requestAnswer(page) {
let post = '';
for (let i = (page * 5), n = 0; i < topic.length && n < 5; i++ , n++) {
post += 'topic[' + n + ']=' + topic[i].topic + '&type[' + n + ']=' + topic[i].type + '&';
}
if (post == '') {
$(btn).text('搜索完成');
common.requestAnswer(topic, 'cx', 0, function (topic, answer) {
let index = topic.index;
if (answer == undefined) {
common.signleLine('无答案', 'answer' + index, undefined, topic.options);
return;
}
common.gm_post(moocServer.url + 'v2/answer', post, false, function (data) {
let json = JSON.parse(data);
for (let i = 0; i < json.length; i++) {
let index = json[i].index + page * 5;
if (json[i].result.length <= 0) {
common.signleLine('无答案', 'answer' + index, undefined, topic[index].options);
continue;
}
self.fillHomeWorkAnswer(topic[index], json[i].result[Math.floor(Math.random() * Math.floor(json[i].result.length))]);
}
setTimeout(() => { requestAnswer(page + 1); }, 1000);
}).error(function () {
$(btn).text('网络错误');
});
}
requestAnswer(0);
self.fillHomeWorkAnswer(topic, answer);
}, () => { $(btn).text('搜索完成'); },
() => { $(btn).text('网络错误'); }
);
return false;
}
},
Expand Down Expand Up @@ -138,7 +123,7 @@ module.exports = {
if (topic == undefined) {
return false;
}
common.gm_post(moocServer.url + 'v2/answer', 'topic[0]=' + topic, false, function (data) {
common.gm_post(moocServer.url + 'v2/answer?platform=cx', 'topic[0]=' + topic, false, function (data) {
let json = JSON.parse(data);
if (json[0].result.length <= 0) {
return self.notic.text('未找到答案');
Expand Down Expand Up @@ -258,7 +243,7 @@ module.exports = {
options = $(timu[i]).find('.Cy_ulTop li');
topicText = topicText.substr(0, topicText.lastIndexOf('('));
}
let pushOption = { topic: topicText, answer: [], correct: [] };
let pushOption = { topic: topicText, answers: [], correct: [] };
if (options.length <= 0) {
//非选择
let is = false;
Expand Down Expand Up @@ -306,15 +291,15 @@ module.exports = {
if (correctText.indexOf(option) >= 0) {
pushOption.correct.push(tmp);
}
pushOption.answer.push(tmp);
pushOption.answers.push(tmp);
}
pushOption.type = correctText.length <= 1 ? 1 : 2;
}
answer.push(pushOption);
}
// console.log(answer);
common.gm_post(moocServer.url + 'answer', JSON.stringify(answer), true, function () {
let box = util.pop_prompt("√ 答案自动记录成功");
common.gm_post(moocServer.url + 'answer?platform=cx', JSON.stringify(answer), true, function () {
let box = common.pop_prompt("√ 答案自动记录成功");
$(document.body).append(box);
setTimeout(function () { box.style.opacity = "1"; }, 500);
});
Expand Down
6 changes: 3 additions & 3 deletions src/cxmooc-tools/chaoxing/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function () {
for (let i in topic) {
data += 'topic[' + i + ']=' + topic[i].topic + '&type[' + i + ']=' + topic[i].type + '&';
}
common.gm_post(moocServer.url + 'v2/answer', data, false, function (data) {
common.gm_post(moocServer.url + 'v2/answer?platform=cx', data, false, function (data) {
let json = JSON.parse(data);
let answer_null = false;
for (let i = 0; i < json.length; i++) {
Expand Down Expand Up @@ -151,10 +151,10 @@ module.exports = function () {
}
answer.push(tmp);
}
let box = until.pop_prompt("√ 答案自动记录成功");
let box = common.pop_prompt("√ 答案自动记录成功");
$(document.body).append(box);
setTimeout(function () { box.style.opacity = "1"; }, 500);
common.gm_post(moocServer.url + 'answer', JSON.stringify(answer), true, function () {
common.gm_post(moocServer.url + 'answer?platform=cx', JSON.stringify(answer), true, function () {
common.log(self.iframe.className + " topic answer complete")
self.complete(2);
}).error(function () {
Expand Down
27 changes: 0 additions & 27 deletions src/cxmooc-tools/chaoxing/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,3 @@ export function isTask(el) {
}
return false;
}


export function pop_prompt(text, sec = 4) {
var box = document.createElement('div');
box.style.position = "fixed";
box.style.background = "#aeffab";
box.style.fontSize = "18px";
box.style.padding = "4px 20px";
box.style.borderRadius = "20px";
box.style.top = "50%";
box.style.left = "50%";
box.style.transform = "translate(-50%,-50%)";
box.style.transition = "1s";
box.style.opacity = "0";
box.innerText = text;
setTimeout(function () {
box.style.opacity = "0";
setTimeout(function () {
box.remove();
}, 1000)
}, sec * 1000);
return box;
}

export function getAnswer() {

}
10 changes: 5 additions & 5 deletions src/cxmooc-tools/chaoxing/vcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function () {
$('input#code').val(code);
setTimeout(function () {
$('a#sub').click();
}, 2000);
}, 3000);
}, true);
});
}
Expand All @@ -40,7 +40,7 @@ module.exports = function () {
document.getElementById('ucode').value = code;
setTimeout(function () {
document.getElementsByClassName('submit')[0].click();
}, 2000);
}, 3000);
});
}
}
Expand All @@ -64,7 +64,7 @@ module.exports = function () {
$('input#identifyCodeRandom').val(code);
setTimeout(function () {
continueGetTeacherAjax();
}, 2000);
}, 3000);
});
}
}
Expand All @@ -76,7 +76,7 @@ module.exports = function () {
if (!show) {
img.src = base64;
}
if (config.is_ruokuai) {
if (false && config.is_ruokuai) {
//若快打码
} else {
common.gm_post(serverConfig.url + 'vcode', 'img=' + encodeURIComponent(base64.substr('data:image/jpeg;base64,'.length)), false, function (ret) {
Expand All @@ -87,7 +87,7 @@ module.exports = function () {
} else if (json.msg) {
callback(json.msg);
} else {
getVcode(url, img, callback);
setTimeout(() => { getVcode(url, img, callback); },3000);
}
}).error(function () {
callback(undefined, '网络请求失败');
Expand Down
Loading

0 comments on commit a0c5d18

Please sign in to comment.