@@ -14,7 +14,9 @@ export class CourseQueryAnswer implements QueryQuestions {
1414 }
1515
1616 protected createQuestion ( el : HTMLElement ) {
17- if ( el . querySelector ( "input[type='radio']" ) != null ) {
17+ if ( el . querySelector ( ".optionCnt span.u-icon-correct" ) ) {
18+ return new JudgeQuestion ( el , 3 ) ;
19+ } else if ( el . querySelector ( "input[type='radio']" ) != null ) {
1820 return new CourseQuestion ( el , 1 ) ;
1921 } else if ( el . querySelector ( "input[type='checkbox']" ) != null ) {
2022 return new CourseQuestion ( el , 2 ) ;
@@ -82,7 +84,7 @@ class CourseQuestion implements Question {
8284
8385 protected dealImgDomain ( content : string ) : string {
8486 //移除域名对比,也不知道还有没有花里胡哨的
85- return content . replace ( / h t t p s : \/ \/ ( .* ?) \/ / , "" ) ;
87+ return content . replace ( / " h t t p s : \/ \/ ( .* ?) \/ / , "\ "") ;
8688 }
8789
8890 public Fill ( answer : Answer ) : TopicStatus {
@@ -123,6 +125,21 @@ class FillQuestion extends CourseQuestion {
123125
124126}
125127
128+ class JudgeQuestion extends CourseQuestion {
129+
130+ public Fill ( answer : Answer ) : TopicStatus {
131+ let el : HTMLElement ;
132+ if ( answer . correct [ 0 ] . content ) {
133+ el = this . el . querySelector ( ".u-tbl.f-pr.f-cb .u-icon-correct" ) . parentElement . parentElement ;
134+ } else {
135+ el = this . el . querySelector ( ".u-tbl.f-pr.f-cb .u-icon-wrong" ) . parentElement . parentElement ;
136+ }
137+ this . fill ( el , this . getContent ( el ) )
138+ return "ok" ;
139+ }
140+
141+ }
142+
126143export class CourseTopic extends Topic {
127144
128145 public Init ( ) : Promise < any > {
0 commit comments