From ac292ed1099b49f9d0e8a7ed3699bacdd8031de3 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Sat, 11 Mar 2017 02:17:41 +0530 Subject: made minor template changes and fixed test_models --- yaksh/models.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index a323994..d583f7b 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1163,13 +1163,14 @@ class AnswerPaper(models.Model): result['success'] = True result['error'] = ['Correct answer'] else: - if testcase.correct.splitlines() == user_answer.splitlines(): + if testcase.correct.splitlines()\ + == user_answer.splitlines(): result['success'] = True result['error'] = ['Correct answer'] elif question.type == 'float': testcase = question.get_test_case() - if abs(testcase.correct-user_answer) <= testcase.error_margin: + if abs(testcase.correct - user_answer) <= testcase.error_margin: result['success'] = True result['error'] = ['Correct answer'] @@ -1353,6 +1354,6 @@ class FloatTestCase(TestCase): "error_margin":self.error_margin} def __str__(self): - return u'Testcase | Correct: {0} | Error Margin: +or- {1}'.format(self.correct, - self.error_margin - ) + return u'Testcase | Correct: {0} | Error Margin: +or- {1}'.format( + self.correct, self.error_margin + ) -- cgit