From 9cd359f6b1b301cb790b4b3cd84a7c2ee87e4592 Mon Sep 17 00:00:00 2001 From: Coaixy Date: Sat, 28 Dec 2024 20:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeiBanHelper.py | 8 ++++++-- main.py | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/WeiBanHelper.py b/WeiBanHelper.py index 0d2c15e..220e029 100644 --- a/WeiBanHelper.py +++ b/WeiBanHelper.py @@ -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 = { @@ -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( diff --git a/main.py b/main.py index d98fbf3..5ae6f9e 100644 --- a/main.py +++ b/main.py @@ -4,8 +4,6 @@ import sys import re - - from QuestionBank import QuestionBank import WeiBanHelper @@ -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'] @@ -146,5 +153,3 @@ def print_help_info(): Instance.finish_exam_time = auto_exam Instance.exam_threshold = exam_threshold Instance.autoExam() - -