From c27bc87afd68266da59af6e7f2b3b8cc8db13fad Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 10 Jun 2020 11:56:49 +0530 Subject: Allow moderator to hide test cases from the user --- yaksh/java_code_evaluator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'yaksh/java_code_evaluator.py') diff --git a/yaksh/java_code_evaluator.py b/yaksh/java_code_evaluator.py index 35573c0..9689c25 100644 --- a/yaksh/java_code_evaluator.py +++ b/yaksh/java_code_evaluator.py @@ -8,6 +8,7 @@ import subprocess from .base_evaluator import BaseEvaluator from .file_utils import copy_files, delete_files from .grader import CompilationError, TestCaseError +from .error_messages import prettify_exceptions class JavaCodeEvaluator(BaseEvaluator): @@ -27,6 +28,7 @@ class JavaCodeEvaluator(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. @@ -150,7 +152,8 @@ class JavaCodeEvaluator(BaseEvaluator): mark_fraction = 1.0 if self.partial_grading else 0.0 else: err = stdout + "\n" + stderr - raise AssertionError(err) + err = prettify_exceptions('AssertionError', err) + return success, err, mark_fraction else: err = "Test case Error:" try: -- cgit