1- import { Mooc } from "../factory" ;
2- import { Hook , Context } from "@App/internal/utils/hook" ;
3- import { createBtn , substrex , protocolPrompt } from "@App/internal/utils/utils" ;
1+ import { Mooc } from "../factory" ;
2+ import { Hook , Context } from "@App/internal/utils/hook" ;
3+ import { createBtn , substrex , protocolPrompt } from "@App/internal/utils/utils" ;
44import "../../views/common" ;
5- import { CourseTopic , CourseQueryAnswer } from "./question" ;
6- import { ToolsQuestionBankFacade , ToolsQuestionBank , QuestionBank , QuestionBankFacade , Answer , Option , PushAnswer } from "@App/internal/app/question" ;
7- import { Application } from "@App/internal/application" ;
5+ import { CourseTopic , CourseQueryAnswer } from "./question" ;
6+ import {
7+ ToolsQuestionBankFacade ,
8+ ToolsQuestionBank ,
9+ QuestionBank ,
10+ QuestionBankFacade ,
11+ Answer ,
12+ Option ,
13+ PushAnswer ,
14+ QuestionStatusString
15+ } from "@App/internal/app/question" ;
16+ import { Application } from "@App/internal/application" ;
817
918export class Course163 implements Mooc {
1019
@@ -22,12 +31,16 @@ export class Course163 implements Mooc {
2231 get : function ( ) {
2332 if ( this . response . indexOf ( "paper:s0" ) > 0 ) {
2433 self . collectAnswer ( this . response ) ;
25- setTimeout ( ( ) => { self . courseTopic ( ) } , 1000 ) ;
34+ setTimeout ( ( ) => {
35+ self . courseTopic ( )
36+ } , 1000 ) ;
2637 } else if ( this . response . indexOf ( "tname:\"" ) > 0 ) {
2738 if ( this . response . indexOf ( "answers:s0" ) > 0 ) {
2839 self . collectAnswer ( this . response ) ;
2940 }
30- setTimeout ( ( ) => { self . examTopic ( ) } , 1000 ) ;
41+ setTimeout ( ( ) => {
42+ self . examTopic ( )
43+ } , 1000 ) ;
3144 }
3245 return this . response ;
3346 }
@@ -53,8 +66,8 @@ export class Course163 implements Mooc {
5366 protocolPrompt ( "你正准备使用中国慕课的答题功能,相应的我们需要你的正确答案,同意之后插件将自动检索你的所有答案\n* 本项选择不会影响你的正常使用(协议当前版本有效)\n* 手动点击答题结果页面自动采集页面答案\n" , "course_answer_collect" , "我同意" ) ;
5467
5568 search . innerText = "搜索中..." ;
56- search . innerText = await topic . QueryAnswer ( ) ;
57- search . innerText = "搜索答案" ;
69+ let ret = await topic . QueryAnswer ( ) ;
70+ search . innerText = QuestionStatusString ( ret ) ;
5871 }
5972 divel . insertBefore ( search , divel . firstChild ) ;
6073 }
@@ -94,7 +107,7 @@ export class Course163 implements Mooc {
94107 tmpAnswer . topic = topic . title ;
95108 tmpAnswer . type = 4 ;
96109 tmpAnswer . correct = new Array < Option > ( ) ;
97- if ( ! topic . stdAnswer ) {
110+ if ( ! topic . stdAnswer ) {
98111 continue ;
99112 }
100113 tmpAnswer . correct . push ( {
@@ -106,13 +119,14 @@ export class Course163 implements Mooc {
106119 tmpAnswer . topic = topic . title ;
107120 tmpAnswer . type = 3 ;
108121 tmpAnswer . correct = new Array < Option > ( ) ;
109- if ( ! topic . optionDtos ) {
122+ if ( ! topic . optionDtos ) {
110123 continue ;
111124 }
112125 for ( let n = 0 ; n < topic . optionDtos . length ; n ++ ) {
113126 if ( topic . optionDtos [ n ] . answer ) {
114127 tmpAnswer . correct . push ( {
115- option : "正确" == topic . optionDtos [ n ] . content , content : "正确" == topic . optionDtos [ n ] . content ,
128+ option : "正确" == topic . optionDtos [ n ] . content ,
129+ content : "正确" == topic . optionDtos [ n ] . content ,
116130 } ) ;
117131 break ;
118132 }
@@ -121,7 +135,7 @@ export class Course163 implements Mooc {
121135 }
122136 continue ;
123137 }
124- if ( ! topic . optionDtos ) {
138+ if ( ! topic . optionDtos ) {
125139 continue ;
126140 }
127141 let option = new Array < Option > ( ) ;
@@ -130,7 +144,7 @@ export class Course163 implements Mooc {
130144 tmpAnswer . topic = topic . title ;
131145 tmpAnswer . type = topic . type ;
132146 for ( let i = 0 ; i < topic . optionDtos . length ; i ++ ) {
133- let opt = { content : topic . optionDtos [ i ] . content , option : String . fromCharCode ( 65 + i ) } ;
147+ let opt = { content : topic . optionDtos [ i ] . content , option : String . fromCharCode ( 65 + i ) } ;
134148 if ( topic . optionDtos [ i ] . answer ) {
135149 correct . push ( opt ) ;
136150 }
0 commit comments