From 1de3c98825266de63a837a863d14a007e548e9d1 Mon Sep 17 00:00:00 2001 From: CodFrm Date: Sun, 1 Nov 2020 15:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 8 ++++++++ docs/.vuepress/config.js | 2 +- docs/Develop/Component.md | 2 +- docs/Develop/Platform.md | 21 ++++++++++++++------- docs/Develop/QuestionBank.md | 6 +++--- src/internal/app/question.ts | 3 --- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad22fa88..7a7ea9c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,8 +35,16 @@ jobs: ${{ runner.OS }}-node- ${{ runner.OS }}- + - name: Write Key File + env: + CHROME_PEM: ${{ secrets.CHROME_PEM }} + run: | + echo $CHROME_PEM > build/cxmooc-tolls.pem + - name: Package with Node run: | npm ci npm test npm run build + npm run tampermonkey + npm run pack diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a4e3a8eb..944a963c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -59,7 +59,7 @@ module.exports = { 'Component.html', 'Platform.html', 'QuestionBank.html', - 'Utils.html' + 'Utils.html', ], }, serviceWorker: { diff --git a/docs/Develop/Component.md b/docs/Develop/Component.md index 6ab0eba9..4cbf7920 100644 --- a/docs/Develop/Component.md +++ b/docs/Develop/Component.md @@ -1,5 +1,5 @@ --- -title: 内置组件 +title: 系统组件 --- > 为了方便开发,提供了很多内置组件来进行调用,每一个组件都提供了接口可以定制化 diff --git a/docs/Develop/Platform.md b/docs/Develop/Platform.md index 032e03b9..13cb5476 100644 --- a/docs/Develop/Platform.md +++ b/docs/Develop/Platform.md @@ -15,16 +15,23 @@ title: 平台开发 ## 实现Mooc接口 -还在优化中,具体请看已有平台 +具体请看已有平台 #### 接口定义 ```ts +// 单个Mooc任务 export interface Mooc { - Init(): void - // TODO: 实现各种流程流转 - // Start() - // Stop() - // OnFinished() - // Next() + Init(): any +} + +// Mooc任务集 +export interface MoocTaskSet extends Mooc, IEventListener { + Init(): Promise + + Stop(): Promise + + Next(): Promise + + SetTaskPointer(index: number): void; } ``` diff --git a/docs/Develop/QuestionBank.md b/docs/Develop/QuestionBank.md index 287322bd..dbc962cc 100644 --- a/docs/Develop/QuestionBank.md +++ b/docs/Develop/QuestionBank.md @@ -2,7 +2,7 @@ title: 题库和答题功能 --- -> 扩展抽象了题库,方便切换或者增加题库使用 +> 扩展抽象了题库,方便切换或者增加题库使用,题库后端和数据请自行整理 > > 源码请看`internal/app/question.ts`和`internal/app/topic.ts` @@ -10,7 +10,7 @@ title: 题库和答题功能 ## 题库接口 题库的接口 ```ts -// 题库操作具体实现 +// 题库操作实现 export interface QuestionBankFacade { ClearQuestion(): void @@ -22,7 +22,7 @@ export interface QuestionBankFacade { CheckCourse(): Promise } -// 题库存储具体实现 +// 题库存储实现 export interface QuestionBank { Answer(topic: Topic[], resolve: QuestionBankCallback): void; diff --git a/src/internal/app/question.ts b/src/internal/app/question.ts index a7baaa83..76853130 100644 --- a/src/internal/app/question.ts +++ b/src/internal/app/question.ts @@ -351,9 +351,6 @@ export class ToolsQuestionBankFacade implements QuestionBankFacade { if (correct == null || correct.correct == null || correct.type == -1) { return; } - correct.topic = correct.topic; - correct.answers = correct.answers; - correct.correct = correct.correct; answer.push(correct); }); this.bank.Push(answer).then((ret: QuestionStatus) => {