Skip to content

Commit

Permalink
优化交互
Browse files Browse the repository at this point in the history
  • Loading branch information
Coaixy committed Dec 28, 2024
1 parent c7463d2 commit 9cd359f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions WeiBanHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ def ai_response(input, type):
print(f" - 当前时间: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")

if len(question_list) - match_count > self.exam_threshold:
print(f"题库匹配度过低, '{exam_plan_name}' 暂未提交,请重新考试")
print(f"题库匹配度过低, '{exam_plan_name}' 暂未提交,请再次打开程序别修改设置")
return

print("请耐心等待考试完成(等待时长为你填写的考试时间)\n")
print("请耐心等待考试完成(等待时长为你填写的考试时间 默人300秒\n")

# 提交考试
submit_data = {
Expand Down Expand Up @@ -827,6 +827,10 @@ def get_lab_id(user_id, tenant_code, token: str):
print("获取实验课程信息失败")
return None

# Todo(状态输出用于Web对接)
# def generate_finish(self):
#

@staticmethod
def get_tenant_code(school_name: str) -> str:
tenant_list = requests.get(
Expand Down
19 changes: 12 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import sys
import re



from QuestionBank import QuestionBank
import WeiBanHelper

Expand Down Expand Up @@ -90,16 +88,25 @@ def print_help_info():
if len(arguments) == 0:
total_courses = len(Instance.project_list) + (1 if lab_index is not None else 0)
if total_courses == 1:
project_index = int(input("已经识别到唯一项目, 请直接输入“0”开始执行: "))
# project_index = int(input("已经识别到唯一项目, 请直接输入“0”开始执行: "))
project_index = 0
else:
project_index = int(input("请输入项目编号: "))
if project_index < 0 or project_index >= total_courses:
print("输入的项目编号超出范围,请重新输入")
exit(1)

auto_exam = int(input("是否自动考试: 0: 不自动考试, >0 : 考试时间[总时长](单位秒)"))
auto_exam = input("请自定义考试时长(输入的考试时间 默认值 300 如果输入0 则代表不需要程序进行考试): ")
if auto_exam == "":
auto_exam = 300
else:
auto_exam = int(auto_exam)
if auto_exam >= 1:
exam_threshold = int(input("允许错的题目数(如填0是一题不错,填1是可以错一题): "))
exam_threshold = input("允许错的题数(将影响能否提交考试数据 默认值 5 ): ")
if exam_threshold == "":
exam_threshold = 5
else:
exam_threshold = int(exam_threshold)

if lab_index is not None and project_index == lab_index:
Instance.userProjectId = Instance.lab_info['userProjectId']
Expand Down Expand Up @@ -146,5 +153,3 @@ def print_help_info():
Instance.finish_exam_time = auto_exam
Instance.exam_threshold = exam_threshold
Instance.autoExam()


0 comments on commit 9cd359f

Please sign in to comment.