summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-03-16 12:02:00 +0530
committerGitHub2017-03-16 12:02:00 +0530
commit6ff0e4213ab1685200b71ad6bcc1fcdabd6ebf78 (patch)
treebda80a9f39ffe3bb6b8529c69e16762519bb6833
parente2b461ebbd64fe07f588dd9f83121d1618461b87 (diff)
parent24db3d6821fba560da4c3a4ca03f96ba6daae5a6 (diff)
downloadonline_test-6ff0e4213ab1685200b71ad6bcc1fcdabd6ebf78.tar.gz
online_test-6ff0e4213ab1685200b71ad6bcc1fcdabd6ebf78.tar.bz2
online_test-6ff0e4213ab1685200b71ad6bcc1fcdabd6ebf78.zip
Merge pull request #250 from ankitjavalkar/minorfix223
Multiple fixes in stdio_evaluator and models:
-rw-r--r--yaksh/models.py2
-rw-r--r--yaksh/stdio_evaluator.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 398f508..103504e 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -66,7 +66,7 @@ test_status = (
def get_assignment_dir(instance, filename):
return os.sep.join((
- instance.user.user, instance.assignmentQuestion.id, filename
+ instance.user.user.username, str(instance.assignmentQuestion.id), filename
))
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