提交 5ce7f776 编写于 作者: C CodFrm

Merge branch 'hotfix' into featured

# Conflicts:
#	src/config.js
#	src/cxmooc-tools/common.js
module.exports = {
url: "http://cx.icodef.com/",
version: 2.10,
url: "https://cx.icodef.com/",
version: 2.11,
update: 'https://github.com/CodFrm/cxmooc-tools/releases',
enforce: false,
cx: {
......@@ -15,8 +15,16 @@ module.exports = {
v2_06: 2.06,
},
getHotVersion: function (ver) {
let dealver = 'v' + ('' + ver || this.version).replace('.', '_');
let dealver = 'v' + pushZero(ver || this.version).replace('.', '_');
hotversion = this.hotversion[dealver] || this.version;
return hotversion;
}
}
\ No newline at end of file
}
function pushZero(num) {
num = "" + num;
for (; num.length < 4;) {
num = num + "0";
}
return num;
}
......@@ -84,7 +84,7 @@ module.exports = {
switch (topic.type) {
case 1:
case 2: {
let options = $(topic.options).find('input');
let options = $(topic.options).find('li input');
let noticText = this.fillSelect(options, correct);
common.signleLine(noticText, 'answer' + topic.index, undefined, topic.options);
break;
......@@ -143,12 +143,20 @@ module.exports = {
fillSelect: function (options, correct) {
let noticText = '';
$(options).removeAttr('checked');
let optionContent = $('.Cy_ulTop.w-top li div');
if (optionContent.length <= 0) {
optionContent = $(options).parents('li').find('a');
}
for (let i = 0; i < correct.length; i++) {
let index = (correct[i].option.charCodeAt() | 32) - 97;
$(options[index]).click();
noticText += correct[i].option + ':' + correct[i].content + '<br/>';
for (let n = 0; n < options.length; n++) {
let option = common.removeHTML($(optionContent[n]).html());
if (option == correct[i].option) {
$(options[n]).click();
noticText += correct[i].option + ':' + correct[i].content + '<br/>';
}
}
}
return noticText;
return noticText || '没有符合的答案';
},
fillJudge: function (options, correct) {
$(options).removeAttr('checked');
......
......@@ -72,21 +72,33 @@ module.exports = function () {
}
}
initVideoTopic();
initCdn(self.video);
// initCdn(self.video);
//点击切换记录cdn
$(self.document).find("[title='Playline']+.vjs-menu .vjs-menu-content .vjs-menu-item-text").click(function () {
localStorage['cdn'] = $(this).text();
});
//失败的切换记录
$(self.document).find('.vjs-error-display.vjs-modal-dialog').on('click', '.ans-vjserrdisplay-opts li.ans-vjserrdisplay-opt label"', function () {
localStorage['cdn'] = $(this).text();
});
// $(self.document).find("[title='Playline']+.vjs-menu .vjs-menu-content .vjs-menu-item-text").click(function () {
// localStorage['cdn'] = $(this).text();
// });
// //失败的切换记录
// $(self.document).find('.vjs-error-display.vjs-modal-dialog').on('click', '.ans-vjserrdisplay-opts li.ans-vjserrdisplay-opt label"', function () {
// localStorage['cdn'] = $(this).text();
// });
let play = function () {
//静音和倍速选项
self.video.muted = config.video_mute;
self.video.playbackRate = config.video_multiple;
let cdn = self.video.currentSrc;
cdn = cdn.substr(0, cdn.indexOf('/video/', 10));
localStorage['cdn_url'] = cdn;
self.loadover && self.loadover(self);
}
/**
* 对cdn进行处理
*/
if (localStorage['cdn_url'] != undefined) {
let url = self.video.src;
url = url.substr(url.indexOf('/video/'));
self.video.src = localStorage['cdn_url'] + url;
}
$(self.video).on('loadstart', play);
$(self.video).on('pause', function () {
......
......@@ -94,11 +94,11 @@ export function removeHTML(html) {
* @param {*} topic
*/
function dealSymbol(topic) {
topic = topic.replace('', ',');
topic = topic.replace('', '(');
topic = topic.replace('', ')');
topic = topic.replace('', '?');
topic = topic.replace('', ':');
topic = topic.replace(/,/g, ',');
topic = topic.replace(/(/g, '(');
topic = topic.replace(/)/g, ')');
topic = topic.replace(/?/g, '?');
topic = topic.replace(/:/g, ':');
topic = topic.replace(/[“”]/g, '"');
return topic;
}
......@@ -433,8 +433,7 @@ export function fillAnswer(topic, answer, fill, findOption) {
export function fillSelect(options, correct, isTrue) {
let noticText = '';
for (let i = 0; i < correct.length; i++) {
isTrue(options, correct[i], 2);
noticText += correct[i].option + ':' + correct[i].content + '<br/>';
noticText += isTrue(options, correct[i], 2) + ':' + correct[i].content + '<br/>';
}
return noticText;
}
......
......@@ -562,10 +562,10 @@
<h4 class="one_title">
<div class="one_title_show">
<span>插件配置:</span>
<button id="dama" class="button button--tamaya button--border-thick" data-text="打码设置">打码设置</button>
<button id="dama" style="display: none" class="button button--tamaya button--border-thick" data-text="打码设置">打码设置</button>
<input type="text" class="input_text edit" placeholder="token" config-key="vtoken">
</div>
<div id="dama-config">
<div id="dama-config" style="display: none">
<span>若快打码设置:</span>
<p class="comment">请自行注册若快购买进行配置</p>
<input type="text" class="input_text edit" config-key="ruokuai_user" placeholder="若快账号" style="height: 17px;">
......
......@@ -54,7 +54,7 @@ module.exports = {
let tmpContent = common.removeHTML($(options[i]).html());
if (tmpContent == correct.content) {
$(options[i]).parent().find('input').click();
return true;
return $(options[i]).text();
}
}
}
......@@ -94,7 +94,7 @@ module.exports = {
common.oaForEach(correct, function (item2) {
if (common.numToZh(index + 1) == item2.option) {
$(item).val(item2.content);
retNotic += '' + item2.option + '空:' + item2.content+'<br/>';
retNotic += '' + item2.option + '空:' + item2.content + '<br/>';
}
});
});
......@@ -105,7 +105,7 @@ module.exports = {
if (text == '') {
return common.signleLine('没有合适的答案', 'answer' + index, undefined, topic.options);;
}
common.signleLine(text, 'answer' + index, undefined, topic.options[topic.options.length-1]);
common.signleLine(text, 'answer' + index, undefined, topic.options[topic.options.length - 1]);
},
() => { $(self.btn).text('搜索完成'); },
() => { $(self.btn).text('网络错误'); },
......
// ==UserScript==
// @name 超星慕课小工具
// @namespace https://github.com/CodFrm/cxmooc-tools
// @version 2.0.8
// @version 2.10
// @description 一个超星慕课刷课工具,火狐,谷歌,油猴支持.全自动任务,视频倍速秒过,作业考试题库,验证码自动打码(੧ᐛ੭挂科模式,启动)
// @author CodFrm
// @match *://*/mycourse/studentstudy?*
......@@ -10,6 +10,8 @@
// @match *://*/html/processVerify.ac?*
// @match *://*/exam/test/reVersionPaperMarkContentNew?*
// @match *://*/exam/test/reVersionTestStartNew?*
// @match *://*/work/selectWorkQuestionYiPiYue?*
// @match *://*/work/doHomeWorkNew?*
// @grant GM_xmlhttpRequest
// @license MIT
// ==/UserScript==
......@@ -22,9 +24,6 @@ let config = {
video_multiple: 1, //视频播放倍速,视频播放的倍数,建议不要改动,为1即可,这是危险的功能
video_mute: true, //视频静音,视频自动静音播放
vtoken: "user", //鉴权token
is_ruokuai: false, //使用若快打码
ruokuai_user: "", //若快打码账号
ruokuai_pwd: "" //若快打码密码
};
localStorage['config'] = JSON.stringify(config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册