Fix problem code change bug
This commit is contained in:
parent
b053c43b19
commit
7a05ad1c3b
6 changed files with 23 additions and 8 deletions
|
@ -56,6 +56,7 @@ from judge.utils.fine_uploader import (
|
|||
FineUploadForm,
|
||||
)
|
||||
from judge.views.problem import ProblemMixin
|
||||
from judge.logging import log_exception
|
||||
|
||||
mimetypes.init()
|
||||
mimetypes.add_type("application/x-yaml", ".yml")
|
||||
|
@ -249,6 +250,9 @@ class ProblemDataView(TitleMixin, ProblemManagerMixin):
|
|||
return ZipFile(data.zipfile.path).namelist()
|
||||
except BadZipfile:
|
||||
return []
|
||||
except FileNotFoundError as e:
|
||||
log_exception(e)
|
||||
return []
|
||||
return []
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
|
|
@ -195,8 +195,8 @@ def get_cases_data(submission):
|
|||
continue
|
||||
count += 1
|
||||
problem_data[count] = {
|
||||
"input": case_data[case.input_file] if case.input_file else "",
|
||||
"answer": case_data[case.output_file] if case.output_file else "",
|
||||
"input": case_data.get(case.input_file, "") if case.input_file else "",
|
||||
"answer": case_data.get(case.output_file, "") if case.output_file else "",
|
||||
}
|
||||
|
||||
return problem_data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue