Skip to content

Commit

Permalink
fix(script): 修复超星章节测试题库被禁用的时候依然使用的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Oct 23, 2023
1 parent 1db793d commit fff8cc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/scripts/src/projects/cx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const CXProject = Project.create({
await study({
...this.cfg,
playbackRate: parseFloat(this.cfg.playbackRate.toString()),
workOptions: { ...CommonProject.scripts.settings.cfg }
workOptions: CommonProject.scripts.settings.methods.getWorkOptions()
});
}
}
Expand Down
11 changes: 1 addition & 10 deletions packages/scripts/src/utils/work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,7 @@ export function commonWork(
);
});

// 使用 json 深拷贝,防止修改原始配置
const workOptions: typeof CommonProject.scripts.settings.cfg = JSON.parse(
JSON.stringify(CommonProject.scripts.settings.cfg)
);
/**
* 过滤掉被禁用的题库
*/
workOptions.answererWrappers = workOptions.answererWrappers.filter(
(aw) => CommonProject.scripts.settings.cfg.disabledAnswererWrapperNames.find((daw) => daw === aw.name) === undefined
);
const workOptions = CommonProject.scripts.settings.methods.getWorkOptions();

/**
* 检查题库是否配置,并询问是否开始答题
Expand Down

0 comments on commit fff8cc4

Please sign in to comment.