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

Commit

Permalink
修复填空题采集bug #121
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Mar 24, 2020
1 parent a87000b commit 07e75e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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.11,
version: 2.12,
update: 'https://github.com/CodFrm/cxmooc-tools/releases',
enforce: false,
cx: {
Expand Down
8 changes: 6 additions & 2 deletions src/cxmooc-tools/chaoxing/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ function getAnswerInfo(TiMu) {
//验证正确
let title = $(answer).find('.clearfix');
let type = switchTopicType(common.substrEx(title.text(), '【', '】'));
let topic = common.removeHTML(title.html().substring(title.html().indexOf('】') + 1));
title = title.html().substring(title[0].innerHTML.indexOf('】') + 1);
if (/((.+?)分)($|\s+)/.test(title)) {
title = title.substring(0, title.lastIndexOf("("));
}
let topic = common.removeHTML(title);
let options = $(TiMu).find('.Zy_ulTop .clearfix');
let ret = {
answers: [],
Expand Down Expand Up @@ -215,7 +219,7 @@ function getAnswerInfo(TiMu) {
options = $(TiMu).find('.Py_tk span.font14');
if (options.length <= 0) {
isMy = true;
options = $(TiMu).find('.Py_answer.clearfix');
options = $(TiMu).find('.Py_answer.clearfix .font14');
}
for (let i = 0; i < options.length; i++) {
if (isMy) {
Expand Down

0 comments on commit 07e75e2

Please sign in to comment.