提交 420f9470 编写于 作者: C CodFrm

v1.5.2 & fix 题目随机bug & 说明修改

上级 65e7d30e
{
"manifest_version": 2,
"name": "超星慕课小工具",
"version": "1.5.1",
"version": "1.5.2",
"description": "用于超星慕课的小工具",
"icons": {
"16": "img/logo.png",
......
{
"name": "cxmooc-tools",
"version": "1.5.1",
"version": "1.5.2",
"description": "> 一个快速学习超星慕课的chrome扩展工具(੧ᐛ੭挂科模式,启动)\r > 初次开发chrome扩展,有兴趣的朋友可以一起来哦",
"main": "mooc.js",
"scripts": {
......
module.exports = {
url: "https://blog.icodef.com:8081/",
version: 1.51,
version: 1.52,
update: 'https://github.com/CodFrm/cxmooc-tools/releases',
enforce: false,
cx: {
......
......@@ -50,7 +50,8 @@
</style>
<body>
<h4>题库内容:</h4>
<h3 style="margin:0;">题库内容:</h3>
<span style="font-size:10px;font-weight:400;">(这并不是一个完善的功能)</span>
<textarea id="content" class="content bor"></textarea>
<br>
<input id="regx" class="ipt-text bor" type="text" value="" placeholder="正则表达式,题目用 {topic} 代替 答案用{answer} 代替">
......
......@@ -57,16 +57,16 @@
<input type="checkbox" id="auto" />
<label for="auto" title="进入一个页面就会自动开始挂机,完成一个任务之后会自动进行下一个">全自动挂机</label>
</div>
<div id="auto-m" class="config-item" style="display: none;">
<div id="auto-m" class="config-item" style="display: none;width:120px">
<label for="interval" title="播放(题目)完成后n分钟再继续下一个任务">间隔时间:</label>
<input type="text" id="interval" style="font-size: 10px;width: 30%" placeholder="分钟" />
<input type="text" id="interval" style="font-size: 10px;width: 30%" placeholder="分钟" />分钟
</div>
<br>
<a href="import.html" target="_black">题库导入</a>
</div>
<div>
<h4>其他说明:</h4>
<p>1.4之后采用了修改的播放器,需要能够从服务器下载才能使用全自动挂机</p>
<span>时间间隔单位为分钟,可以有小数点,例如,0.1为6秒</span>
<p>GitHub开源地址:
<br>
<a href="https://github.com/CodFrm/cxmooc-tools" target="_black">https://github.com/CodFrm/cxmooc-tools</a>
......
......@@ -59,15 +59,22 @@ module.exports = function (_this, elLogo, index, over) {
}
} else {
var json = JSON.parse(this.responseText);
var answer_null = false;
//填入答案
for (let i in json) {
fillIn(json[i].topic, json[i].result == undefined ? [] : json[i].result);
if (fillIn(json[i].topic, json[i].result == undefined ? [] : json[i].result) == 'null answer') {
answer_null = true;
}
}
var config = JSON.parse(localStorage['config']);
//如果是自动挂机,填入之后自动提交
if (!config['auto']) {
return;
}
if (answer_null) {
alert('有题目没有找到答案,并且未设置随机答案,请手动填入');
return;
}
setTimeout(function () {
//提交操作
var submit = topicDoc.getElementsByClassName('Btn_blue_1');
......@@ -306,9 +313,9 @@ module.exports = function (_this, elLogo, index, over) {
return;
}
var options = topicEl.nextSibling.nextSibling.getElementsByTagName('li');
var rand = document.head.getAttribute('rand-answer');
if (result.length <= 0) {
//没有在线上检索到答案,先在检索本地题库
var rand = document.head.getAttribute('rand-answer');
//从本地题库读取内容
var localTopic = getLocalTopic(topicMsg.topic);
if (localTopic != undefined) {
......@@ -346,7 +353,7 @@ module.exports = function (_this, elLogo, index, over) {
//无答案,检索配置有没有设置随机答案....
if (rand == 'false') {
prompt.innerHTML = "没有从题库中获取到相应记录";
return;
return 'null answer';
}
prompt.style.fontWeight = 600;
prompt.innerHTML = "请注意这是随机生成的答案!<br/>";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册