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

Commit 5866a24

Browse files
committed
fix 163选项为图片
1 parent 08d83f3 commit 5866a24

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/mooc/course163/question.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,18 @@ class CourseQuestion implements Question {
7979
protected options(): NodeListOf<HTMLLIElement> {
8080
return this.el.querySelectorAll(".u-tbl.f-pr.f-cb");
8181
}
82+
83+
protected dealImgDomain(content: string): string {
84+
//移除域名对比,也不知道还有没有花里胡哨的
85+
return content.replace(/https:\/\/(.*?)\//, "");
86+
}
87+
8288
public Fill(answer: Answer): TopicStatus {
8389
let options = this.options();
8490
let flag = false;
8591
for (let i = 0; i < answer.correct.length; i++) {
8692
for (let n = 0; n < options.length; n++) {
87-
if (answer.Equal(this.getContent(options[n]), answer.correct[i].content)) {
93+
if (answer.Equal(this.dealImgDomain(this.getContent(options[n])), this.dealImgDomain(answer.correct[i].content))) {
8894
this.fill(options[n], answer.correct[i].content);
8995
flag = true;
9096
}

0 commit comments

Comments
 (0)