Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加答题功能与支持需解锁章节的课程 #360

Merged
merged 42 commits into from
Oct 21, 2024

Conversation

sz134055
Copy link
Contributor

@sz134055 sz134055 commented Oct 18, 2024

添加答题功能与支持需解锁章节的课程

  • 添加题库模块,已支持言溪题库,更多题库可以自行模仿实现
  • 题库支持本地缓存
  • 支持章节需解锁的课程

main.py Show resolved Hide resolved
Copy link
Owner

@Samueli924 Samueli924 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢帮助,代码非常好

Copy link
Owner

@Samueli924 Samueli924 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我建议把完成章节检测作为一个实验性功能,默认是关闭状态,通过在命令行加experimental参数开启,在关闭状态时遇到workid还是默认continue跳过比较好。

@sz134055
Copy link
Contributor Author

我建议把完成章节检测作为一个实验性功能,默认是关闭状态,通过在命令行加experimental参数开启,在关闭状态时遇到workid还是默认continue跳过比较好。

有些课程当前章节不完成是没办法获取到下一章节的,不配置题库视为不答题,会自动跳过的,在学习方法Chaoxing().study_work()里开头进行了判断,相当于实现了你说的跳过吧

if self.tiku.DISABLE or not self.tiku:
            return None

@sz134055
Copy link
Contributor Author

感觉没什么好修复好更新的了(因为我刷完了),个别不支持的任务基本也是非任务点,且点进去就算完成,懒得找API跟进了。
不过感觉可以弄个Dockerfile。

Copy link
Owner

@Samueli924 Samueli924 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢帮助!已合并提交代码

@Samueli924 Samueli924 merged commit 79dce0e into Samueli924:main Oct 21, 2024
1 check failed
@Jaggersqewsd
Copy link

怎么添加题库啊??谁可以教我一下有偿QQ2160489511

@sz134055
Copy link
Contributor Author

怎么添加题库啊??谁可以教我一下有偿QQ2160489511

现在有人实现了tikuAdapter,支持多个题库。
如果你想要的不在里面,那就按下面的步骤写你自己的题库类:
你的题库类需要继承Tiku类,然后至少实现:

  • _query():在本地题库缓存里匹配不到的时候会调用该方法,即从你实现的题库中查询。
  • _init_tiku():用来初始化题库的,比如你的题库查询接口可能需要token之类的。

可以在配置文件里[tiku]下追加配置项。要启用你的题库就需要填写provider=你的题库类名(大小写一致)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants