From 99f0c944fafec51b9327fe5dea01096842788e03 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Wed, 4 Jul 2018 16:34:56 +0530 Subject: Raise appropriate exceptions for C and Java language to the Grader - Raise AssertionError,CompilationError and TestCaseError for assertion, user answer compilation and testcase compilation errors respectively. - Add test case for C/C++ and Java --- yaksh/cpp_stdio_evaluator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'yaksh/cpp_stdio_evaluator.py') diff --git a/yaksh/cpp_stdio_evaluator.py b/yaksh/cpp_stdio_evaluator.py index 4e8f8df..26d655f 100644 --- a/yaksh/cpp_stdio_evaluator.py +++ b/yaksh/cpp_stdio_evaluator.py @@ -7,7 +7,7 @@ from os.path import isfile # Local imports from .stdio_evaluator import StdIOEvaluator from .file_utils import copy_files, delete_files - +from .grader import CompilationError class CppStdIOEvaluator(StdIOEvaluator): """Evaluates C StdIO based code""" @@ -104,5 +104,6 @@ class CppStdIOEvaluator(StdIOEvaluator): err = err + "\n" + e except Exception: err = err + "\n" + stdnt_stderr + raise CompilationError(err) mark_fraction = 1.0 if self.partial_grading and success else 0.0 return success, err, mark_fraction -- cgit From ec0903e00ffab1f0f0e6e674637243cd6a548115 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Wed, 4 Jul 2018 17:07:01 +0530 Subject: Make pep8 changes --- yaksh/cpp_stdio_evaluator.py | 1 + 1 file changed, 1 insertion(+) (limited to 'yaksh/cpp_stdio_evaluator.py') diff --git a/yaksh/cpp_stdio_evaluator.py b/yaksh/cpp_stdio_evaluator.py index 26d655f..3f44cb2 100644 --- a/yaksh/cpp_stdio_evaluator.py +++ b/yaksh/cpp_stdio_evaluator.py @@ -9,6 +9,7 @@ from .stdio_evaluator import StdIOEvaluator from .file_utils import copy_files, delete_files from .grader import CompilationError + class CppStdIOEvaluator(StdIOEvaluator): """Evaluates C StdIO based code""" def __init__(self, metadata, test_case_data): -- cgit