@@ -24,7 +24,7 @@ class TestResult:
2424 Error = 1
2525 Timeout = 2
2626
27- def create_new_problem_from_template (new_problem_id : str , old_problem_id : str ):
27+ def create_new_problem_from_template (new_problem_id : int , old_problem_id : int ):
2828 old_path = PathManager .problem_dir (old_problem_id )
2929 new_path = PathManager .problem_dir (new_problem_id )
3030 os .makedirs (new_path , exist_ok = True )
@@ -67,8 +67,8 @@ def run_command_with_timeout(command: list, timeout: float) -> int:
6767
6868class PathManager :
6969 @staticmethod
70- def problem_dir (problem_id : str ) -> str :
71- return join (DATA_DIR , PROBLEM_DIR , problem_id )
70+ def problem_dir (id : int ) -> str :
71+ return join (DATA_DIR , PROBLEM_DIR , str ( id ) )
7272
7373 @staticmethod
7474 def submission_dir (user_id : str , submission_id : str ) -> str :
@@ -91,7 +91,7 @@ def __init__(self, uploaded_file, problem: Problem):
9191 else :
9292 raise Exception ("zipfile is None" )
9393 self .problem = problem
94- self .problem_dir_path = PathManager .problem_dir (problem ._id )
94+ self .problem_dir_path = PathManager .problem_dir (problem .id )
9595 if not exists (self .problem_dir_path ):
9696 os .makedirs (self .problem_dir_path )
9797 self ._error_message : str = ""
@@ -165,7 +165,7 @@ def __init__(self, submission: Submission):
165165 if not exists (self .sub_dirpath ):
166166 os .makedirs (self .sub_dirpath , exist_ok = True )
167167 problem : Problem = submission .problem
168- prob_dir = PathManager .problem_dir (problem ._id ) # use display id
168+ prob_dir = PathManager .problem_dir (problem .id ) # use display id
169169 if not exists (prob_dir ):
170170 raise Exception ("problem dir {} not exists" .format (prob_dir ))
171171 for filename in os .listdir (prob_dir ):
0 commit comments