Skip to content

Do not grade empty groups #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions problemtools/verifyproblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ def check(self, args):
if not f[:-4] + '.in' in infiles:
self.error("No matching input file for answer '%s'" % f)

if not self.get_subgroups() and not self.get_testcases():
self.error('Test case group is empty')

# Check whether a <= b according to a natural sorting where numeric components
# are compactified, so that e.g. "a" < "a1" < "a2" < "a10" = "a010" < "a10a".
def natural_sort_le(a, b):
Expand Down Expand Up @@ -1320,6 +1323,10 @@ def grade(self, sub_results, testcasegroup, shadow_result=False):
verdict = 'AC'
score = 0

if not sub_results:
self.info('No results on %s, so no graders ran' % (testcasegroup,))
return (verdict, score)

grader_flags = testcasegroup.config['grader_flags'].split()
self.debug('Grading %d results:\n%s' % (len(sub_results), grader_input))
self.debug('Grader flags: %s' % grader_flags)
Expand Down
2 changes: 1 addition & 1 deletion support/default_grader/default_grader
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ try:
score = aggregate_scores(scores)
print('%s %f' % (verdict, score))
except:
print('JE')
print('JE 0')