summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index d60a377..fdf10bd 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1153,7 +1153,8 @@ class AnswerPaper(models.Model):
elif question.type == 'string':
testcase = question.get_test_case()
if testcase.string_check == "lower":
- if testcase.correct.lower().splitlines() == user_answer.lower().splitlines():
+ if testcase.correct.lower().splitlines()\
+ == user_answer.lower().splitlines():
result['success'] = True
result['error'] = ['Correct answer']
else:
@@ -1164,8 +1165,8 @@ class AnswerPaper(models.Model):
elif question.type == 'float':
testcase = question.get_test_case()
if abs(testcase.correct-user_answer) <= testcase.error_margin:
- result['success'] = True
- result['error'] = ['Correct answer']
+ result['success'] = True
+ result['error'] = ['Correct answer']
elif question.type == 'code':
user_dir = self.user.profile.get_user_dir()