diff options
-rw-r--r-- | yaksh/models.py | 7 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 2 |
2 files changed, 5 insertions, 4 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() diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 832e343..0bfd00e 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -76,7 +76,7 @@ User IP address: {{ paper.user_ip }} {% endif %} {% endfor %} - {{% elif question.type == "integer" or "string" or "float" %} + {% elif question.type == "integer" or "string" or "float" %} <h5> <u>Correct Answer:</u></h5> {% for testcase in question.get_test_cases %} <strong>{{ testcase.correct|safe }}</strong> |