diff options
author | prathamesh | 2020-06-10 11:56:49 +0530 |
---|---|---|
committer | prathamesh | 2020-06-10 11:56:49 +0530 |
commit | c27bc87afd68266da59af6e7f2b3b8cc8db13fad (patch) | |
tree | 9075a0019cbba086f4bdefb54346b259d8580cb6 /yaksh/cpp_code_evaluator.py | |
parent | 73dc8f6820c6c86fd8e70a68456ca2e541801bde (diff) | |
download | online_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.tar.gz online_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.tar.bz2 online_test-c27bc87afd68266da59af6e7f2b3b8cc8db13fad.zip |
Allow moderator to hide test cases from the user
Diffstat (limited to 'yaksh/cpp_code_evaluator.py')
-rw-r--r-- | yaksh/cpp_code_evaluator.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/cpp_code_evaluator.py b/yaksh/cpp_code_evaluator.py index d249c66..0f19596 100644 --- a/yaksh/cpp_code_evaluator.py +++ b/yaksh/cpp_code_evaluator.py @@ -8,6 +8,7 @@ import subprocess from .file_utils import copy_files, delete_files from .base_evaluator import BaseEvaluator from .grader import CompilationError, TestCaseError +from .error_messages import prettify_exceptions class CppCodeEvaluator(BaseEvaluator): @@ -29,6 +30,7 @@ class CppCodeEvaluator(BaseEvaluator): # Set test case data values self.test_case = test_case_data.get('test_case') self.weight = test_case_data.get('weight') + self.hidden = test_case_data.get('hidden') def teardown(self): # Delete the created file. @@ -142,7 +144,8 @@ class CppCodeEvaluator(BaseEvaluator): mark_fraction = 1.0 if self.partial_grading else 0.0 else: err = "{0} \n {1}".format(stdout, stderr) - raise AssertionError(err) + err = prettify_exceptions('AssertionError', err) + return success, err, mark_fraction else: err = "Test case Error:" try: |