diff options
author | adityacp | 2017-03-16 19:06:47 +0530 |
---|---|---|
committer | adityacp | 2017-03-16 19:06:47 +0530 |
commit | 6b4817fb731f9f61114b8395aaccdfd379589e28 (patch) | |
tree | 1bbe2f994502a16f8b158d40e5ef2ae1bb6044e9 | |
parent | c6b9b51a5c4b1c676c9784432435ccffb15335b6 (diff) | |
parent | 6ff0e4213ab1685200b71ad6bcc1fcdabd6ebf78 (diff) | |
download | online_test-6b4817fb731f9f61114b8395aaccdfd379589e28.tar.gz online_test-6b4817fb731f9f61114b8395aaccdfd379589e28.tar.bz2 online_test-6b4817fb731f9f61114b8395aaccdfd379589e28.zip |
Change get_assignment_dir to get username from user model
-rw-r--r-- | online_test/__init__.py | 1 | ||||
-rw-r--r-- | setup.py | 9 | ||||
-rw-r--r-- | yaksh/stdio_evaluator.py | 14 |
3 files changed, 16 insertions, 8 deletions
diff --git a/online_test/__init__.py b/online_test/__init__.py index e69de29..ef0b380 100644 --- a/online_test/__init__.py +++ b/online_test/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.3'
\ No newline at end of file @@ -6,6 +6,13 @@ README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) +def get_version(): + import os + data = {} + fname = os.path.join('online_test', '__init__.py') + exec(compile(open(fname).read(), fname, 'exec'), data) + return data.get('__version__') + install_requires = [ 'django==1.9.5', 'django-taggit==0.18.1', @@ -18,7 +25,7 @@ setup( name='yaksh', author='Python Team at FOSSEE, IIT Bombay', author_email='python@fossee.in', - version='0.1.3', + version=get_version(), packages=find_packages(), include_package_data=True, url='https://pypi.python.org/pypi/yaksh/', diff --git a/yaksh/stdio_evaluator.py b/yaksh/stdio_evaluator.py index fb9dfb3..fa78a68 100644 --- a/yaksh/stdio_evaluator.py +++ b/yaksh/stdio_evaluator.py @@ -14,17 +14,17 @@ class StdIOEvaluator(BaseEvaluator): output_err = output_err_bytes.decode('utf-8') expected_output = expected_output.replace("\r", "") if not expected_input: - error_msg = "Expected Output is {0} ".\ - format(repr(expected_output)) + error_msg = "Expected Output is\n{0} ".\ + format(str(expected_output)) else: - error_msg = " Given Input is\n {0} \n Expected Output is {1} ".\ - format(expected_input, repr(expected_output)) + error_msg = "Given Input is\n{0}\nExpected Output is\n{1}".\ + format(expected_input, str(expected_output)) if output_err == '': if user_output == expected_output: success, err = True, None else: - err = " Incorrect answer\n" + error_msg +\ - "\n Your output is {0}".format(repr(user_output)) + err = "Incorrect answer:\n" + error_msg +\ + "\nYour output is\n{0}".format(str(user_output)) else: - err = "Error:\n {0}".format(output_err) + err = "Error:\n{0}".format(output_err) return success, err |