Fix pretest wrong testcases
This commit is contained in:
parent
6da7630ba5
commit
388715bf3a
1 changed files with 9 additions and 3 deletions
|
@ -165,11 +165,17 @@ def get_problem_data(submission):
|
||||||
archive = zipfile.ZipFile(archive_path, 'r')
|
archive = zipfile.ZipFile(archive_path, 'r')
|
||||||
except zipfile.BadZipfile:
|
except zipfile.BadZipfile:
|
||||||
raise Exception('bad archive: "%s"' % archive_path)
|
raise Exception('bad archive: "%s"' % archive_path)
|
||||||
|
|
||||||
testcases = ProblemTestCase.objects.filter(dataset=submission.problem)\
|
testcases = ProblemTestCase.objects.filter(dataset=submission.problem)\
|
||||||
.order_by('order')
|
.order_by('order')
|
||||||
|
|
||||||
|
if (submission.is_pretested):
|
||||||
|
testcases = testcases.filter(is_pretest=True)
|
||||||
|
|
||||||
|
problem_data = {}
|
||||||
|
for count, case in enumerate(testcases):
|
||||||
|
problem_data[count + 1] = get_input_answer(case, archive)
|
||||||
|
|
||||||
problem_data = {case.order: get_input_answer(case, archive)
|
|
||||||
for case in testcases}
|
|
||||||
return problem_data
|
return problem_data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue