From 7c8cd4632bef5ab6f20eddf68b1afff3e373d315 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 29 Jul 2020 16:36:54 -0500 Subject: [PATCH] Handle AC display in partial checker --- templates/about/custom-checker-sample.html | 2 +- validator_template/template.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/about/custom-checker-sample.html b/templates/about/custom-checker-sample.html index ebbf580..ad353c4 100644 --- a/templates/about/custom-checker-sample.html +++ b/templates/about/custom-checker-sample.html @@ -102,7 +102,7 @@ main.exe [input_file] [output_file] [ans_file] Những thông tin được viết ra stdout (bằng cout) sẽ được in ra màn hình cho người nộp bài(feedback)

diff --git a/validator_template/template.py b/validator_template/template.py index c131b9b..9144f70 100644 --- a/validator_template/template.py +++ b/validator_template/template.py @@ -39,9 +39,11 @@ class Module: if not match: raise InternalError('Invalid stderr for partial points: %r' % stderr) points = float(match.group(0)) - if not 0 <= points < 1: + if not 0 <= points <= 1: raise InternalError('Invalid partial points: %d' % points) - return CheckerResult(False, points * point_value, feedback=feedback) + + ac = (points == 1) + return CheckerResult(ac, points * point_value, feedback=feedback) elif proc.returncode == cls.WA: return CheckerResult(False, 0, feedback=feedback) else: