-
Notifications
You must be signed in to change notification settings - Fork 265
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
feat: Introduce chapter_test parameter and improve code readability #410
Conversation
…tion (Samueli924#405) - Added help and verbose options for better user control and logging. - Introduced random sleep between chapters for more realistic simulation. - Fixed multi_cut function to handle multiple-choice questions correctly. Fixes: Samueli924#405
- Added chapter_test parameter for configuring chapter quiz handling options: - 0: Skip - 1: Complete and save - 2: Complete and submit - Implemented functionality to skip quiz tasks when chapter_test is set to 0 - Background: Many users do not have a tiku token configured and do not want to use random selection. This is a simple solution to address that. Excerpt from main.py, lines 255 to 259: elif job['type'] == 'workid': # 检测配置文件是否跳过测验任务 if chapter_test == 0: logger.info(f'跳过章节测验任务, 任务章节: {course['title']}') continue
目前@sz134055的配置文件模式已经能提供是否开启题库的选项,不是很有必要再加一个配置参数 |
The newly added parameter in the PR is to configure whether to attempt the questions. |
- Optimize course list parsing from config files and command line arguments - Add parse_course_list function to handle course IDs containing whitespace - Simplify code with list comprehension Background: Previous version used simple .split(,) which ignored course IDs containing whitespace in configuration. The new parsing mechanism properly handles whitespace in course ID lists.
@sz134055 plz review |
Summary
This PR introduces a new feature to control chapter quiz handling and includes several code improvements for better maintainability and readability.
Features Added
chapter_test
parameter for configuring how chapter quizzes are handled:0
: Skip chapter quiz tasks.1
: Complete the quiz tasks.chapter_test
is set to0
.Code Improvements
Motivation
Many users do not have a
tiku
token configured and prefer not to use random answers for chapter quizzes. Thechapter_test
parameter provides flexibility to customize behavior while avoiding unnecessary tasks.Changes
main.py
(lines 255-259).Related Issues
Additional Notes
The PR includes merged changes from the upstream repository and resolves any conflicts with prior updates.