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

[BUG反馈] 使用tikuAdapter接口报错 #405

Closed
ywxhqwq opened this issue Dec 9, 2024 · 3 comments · Fixed by #408
Closed

[BUG反馈] 使用tikuAdapter接口报错 #405

ywxhqwq opened this issue Dec 9, 2024 · 3 comments · Fixed by #408
Labels
bug Something isn't working

Comments

@ywxhqwq
Copy link

ywxhqwq commented Dec 9, 2024

代码报错截图
image

2024-12-09 06:05:31.891 | ERROR    | __main__:<module>:192 - 错误: IndexError: Cannot choose from an empty sequence
2024-12-09 06:05:31.892 | ERROR    | __main__:<module>:193 - Traceback (most recent call last):
  File "/root/chaoxing/main.py", line 183, in <module>
    chaoxing.study_work(course, job,job_info)
  File "/root/chaoxing/api/base.py", line 358, in study_work
    answer = answer if answer else random_answer(q['options'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/chaoxing/api/base.py", line 261, in random_answer
    _choice = random.choice(_op_list)
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/random.py", line 373, in choice
    raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence

Traceback (most recent call last):
  File "/root/chaoxing/main.py", line 194, in <module>
    raise e
  File "/root/chaoxing/main.py", line 183, in <module>
    chaoxing.study_work(course, job,job_info)
  File "/root/chaoxing/api/base.py", line 358, in study_work
    answer = answer if answer else random_answer(q['options'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/chaoxing/api/base.py", line 261, in random_answer
    _choice = random.choice(_op_list)
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/random.py", line 373, in choice
    raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence

使用tikuAdapter在答题时会出现这个错误

使用环境 debian11 python3.11

@ywxhqwq ywxhqwq added the bug Something isn't working label Dec 9, 2024
@ywxhqwq
Copy link
Author

ywxhqwq commented Dec 9, 2024

并且还有多选题只选择1个选项的问题
image

@sz134055
Copy link
Contributor

sz134055 commented Dec 9, 2024

相同问题: #391

@n-WN n-WN mentioned this issue Dec 22, 2024
@n-WN
Copy link
Contributor

n-WN commented Dec 23, 2024

相同问题: #391

The problem is simple: the comma is treated as an option delimiter and processed first, which causes the options to be incorrect.

n-WN added a commit to n-WN/chaoxing_fork that referenced this issue Dec 23, 2024
…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
n-WN added a commit to n-WN/chaoxing_fork that referenced this issue Dec 23, 2024
…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
n-WN added a commit to n-WN/chaoxing_fork that referenced this issue Dec 23, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants