fix many feather
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
|
||||
import os
|
||||
from ..models.function import FunctionResponse
|
||||
def judge(filepath:str, name: str, course_id: str, lesson_name: str, root_path:str):
|
||||
|
||||
|
||||
|
||||
|
||||
def judge(filepath:str, name: str, course_id: str, root_path:str):
|
||||
"""Call this method to judge the student's solution after they have completed the problem.
|
||||
|
||||
Args:
|
||||
filepath (`str`): The path to the file containing the student's solution.
|
||||
filepath (`str`): The path from root_path to the file containing the student's solution.
|
||||
name (`str`): The name of the problem.
|
||||
course_id (`str`): The id of the course.
|
||||
lesson_name (`str`): The name of the lesson.
|
||||
root_path (`str`): The root path of the user's workspace project.
|
||||
|
||||
Returns:
|
||||
@@ -17,6 +20,7 @@ def judge(filepath:str, name: str, course_id: str, lesson_name: str, root_path:s
|
||||
# 从books/code_tests/name/中获取所有.in文件
|
||||
|
||||
directory = 'books/code_tests/'+course_id+'/'+name
|
||||
print(f"Directory: {directory}")
|
||||
# 如果目录不存在,报错
|
||||
if not os.path.exists(directory):
|
||||
return FunctionResponse("judge", False, f"The name {name} is not found.")
|
||||
@@ -30,6 +34,7 @@ def judge(filepath:str, name: str, course_id: str, lesson_name: str, root_path:s
|
||||
erroroutput = ""
|
||||
exceptoutput=""
|
||||
for file in in_files:
|
||||
print(f"Testing {file}")
|
||||
file_path = os.path.join(save_dir, f"_{name}.out")
|
||||
if os.path.exists(file_path):
|
||||
os.remove(file_path)
|
||||
|
||||
Reference in New Issue
Block a user