@@ -24,7 +24,7 @@ class TestResult:
24
24
Error = 1
25
25
Timeout = 2
26
26
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 ):
28
28
old_path = PathManager .problem_dir (old_problem_id )
29
29
new_path = PathManager .problem_dir (new_problem_id )
30
30
os .makedirs (new_path , exist_ok = True )
@@ -67,8 +67,8 @@ def run_command_with_timeout(command: list, timeout: float) -> int:
67
67
68
68
class PathManager :
69
69
@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 ) )
72
72
73
73
@staticmethod
74
74
def submission_dir (user_id : str , submission_id : str ) -> str :
@@ -91,7 +91,7 @@ def __init__(self, uploaded_file, problem: Problem):
91
91
else :
92
92
raise Exception ("zipfile is None" )
93
93
self .problem = problem
94
- self .problem_dir_path = PathManager .problem_dir (problem ._id )
94
+ self .problem_dir_path = PathManager .problem_dir (problem .id )
95
95
if not exists (self .problem_dir_path ):
96
96
os .makedirs (self .problem_dir_path )
97
97
self ._error_message : str = ""
@@ -165,7 +165,7 @@ def __init__(self, submission: Submission):
165
165
if not exists (self .sub_dirpath ):
166
166
os .makedirs (self .sub_dirpath , exist_ok = True )
167
167
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
169
169
if not exists (prob_dir ):
170
170
raise Exception ("problem dir {} not exists" .format (prob_dir ))
171
171
for filename in os .listdir (prob_dir ):
0 commit comments