diff options
Diffstat (limited to 'yaksh/python_stdout_evaluator.py')
-rw-r--r-- | yaksh/python_stdout_evaluator.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yaksh/python_stdout_evaluator.py b/yaksh/python_stdout_evaluator.py index 8f3eb65..815752f 100644 --- a/yaksh/python_stdout_evaluator.py +++ b/yaksh/python_stdout_evaluator.py @@ -35,8 +35,12 @@ class PythonStdoutEvaluator(CodeEvaluator): g = {} exec submitted in g raw_output_value = output_buffer.getvalue() - output_value = raw_output_value.encode('string_escape').strip() - if output_value == expected_output: + # output_value = raw_output_value.encode('string_escape').strip() + output_value = raw_output_value.strip() + if expected_output in user_answer: + success = False + err = "Incorrect Answer: Please avoid printing the expected output directly" + elif output_value == expected_output: success = True err = "Correct answer" @@ -46,3 +50,4 @@ class PythonStdoutEvaluator(CodeEvaluator): del tb return success, err + |