Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
东方怂天
cxmooc-tools
提交
4f1c6c02
C
cxmooc-tools
项目概览
东方怂天
/
cxmooc-tools
通知
11
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cxmooc-tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4f1c6c02
编写于
5月 18, 2019
作者:
C
CodFrm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复考试题目无法搜索的bug
上级
fc54cdf2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
16 deletion
+23
-16
src/cxmooc-tools/chaoxing/exam.js
src/cxmooc-tools/chaoxing/exam.js
+13
-5
src/cxmooc-tools/common.js
src/cxmooc-tools/common.js
+7
-8
src/cxmooc-tools/zhihuishu/topic.js
src/cxmooc-tools/zhihuishu/topic.js
+3
-3
未找到文件。
src/cxmooc-tools/chaoxing/exam.js
浏览文件 @
4f1c6c02
...
...
@@ -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
'
);
...
...
src/cxmooc-tools/common.js
浏览文件 @
4f1c6c02
...
...
@@ -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
;
}
...
...
@@ -363,7 +363,7 @@ export function requestAnswer(topic, platform, page, answer, compile, error, cou
time
=
time
||
2000
;
let
post
=
''
;
for
(
let
i
=
(
page
*
count
),
n
=
0
;
i
<
topic
.
length
&&
n
<
count
;
i
++
,
n
++
)
{
post
+=
'
topic[
'
+
n
+
'
]=
'
+
topic
[
i
].
topic
+
'
&type[
'
+
n
+
'
]=
'
+
topic
[
i
].
type
+
'
&
'
;
post
+=
'
topic[
'
+
n
+
'
]=
'
+
'
我们现在看不到《红楼梦》哪个章节?()
'
+
'
&type[
'
+
n
+
'
]=
'
+
topic
[
i
].
type
+
'
&
'
;
}
if
(
post
==
''
)
{
compile
&&
compile
();
...
...
@@ -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
;
}
...
...
src/cxmooc-tools/zhihuishu/topic.js
浏览文件 @
4f1c6c02
...
...
@@ -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
(
'
网络错误
'
);
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录