Skip to content

Commit

Permalink
修改文档
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 1, 2020
1 parent be792cc commit 1de3c98
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = {
'Component.html',
'Platform.html',
'QuestionBank.html',
'Utils.html'
'Utils.html',
],
},
serviceWorker: {
Expand Down
2 changes: 1 addition & 1 deletion docs/Develop/Component.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 内置组件
title: 系统组件
---

> 为了方便开发,提供了很多内置组件来进行调用,每一个组件都提供了接口可以定制化
Expand Down
21 changes: 14 additions & 7 deletions docs/Develop/Platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<MoocEvent> {
Init(): Promise<any>

Stop(): Promise<any>

Next(): Promise<Task>

SetTaskPointer(index: number): void;
}
```
6 changes: 3 additions & 3 deletions docs/Develop/QuestionBank.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: 题库和答题功能
---

> 扩展抽象了题库,方便切换或者增加题库使用
> 扩展抽象了题库,方便切换或者增加题库使用,题库后端和数据请自行整理
>
> 源码请看`internal/app/question.ts``internal/app/topic.ts`
> ps:这个模块其实挺乱的...想优化
## 题库接口
题库的接口
```ts
// 题库操作具体实现
// 题库操作实现
export interface QuestionBankFacade {
ClearQuestion(): void

Expand All @@ -22,7 +22,7 @@ export interface QuestionBankFacade {

CheckCourse(): Promise<number>
}
// 题库存储具体实现
// 题库存储实现
export interface QuestionBank {
Answer(topic: Topic[], resolve: QuestionBankCallback): void;

Expand Down
3 changes: 0 additions & 3 deletions src/internal/app/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 1de3c98

Please sign in to comment.