diff options
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/forms.py | 2 | ||||
-rw-r--r-- | yaksh/models.py | 8 | ||||
-rw-r--r-- | yaksh/templatetags/test_custom_filters.py | 14 |
3 files changed, 13 insertions, 11 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index 4c690b1..cbf3033 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -35,7 +35,7 @@ question_types = ( ("integer", "Answer in Integer"), ("string", "Answer in String"), ("float", "Answer in Float"), - ("arrange", "Arrange Options in Correct Order"), + ("arrange", "Arrange in Correct Order"), ) test_case_types = ( diff --git a/yaksh/models.py b/yaksh/models.py index ffc3c56..b267641 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -54,7 +54,7 @@ question_types = ( ("integer", "Answer in Integer"), ("string", "Answer in String"), ("float", "Answer in Float"), - ("arrange", "Arrange Options in Correct Order"), + ("arrange", "Arrange in Correct Order"), ) @@ -1795,8 +1795,10 @@ class AnswerPaper(models.Model): result['error'] = ['Correct answer'] elif question.type == 'arrange': - tc_list = sorted([tc.id for tc in question.get_test_cases()]) - if user_answer == tc_list: + testcase_ids = sorted( + [tc.id for tc in question.get_test_cases()] + ) + if user_answer == testcase_ids: result['success'] = True result['error'] = ['Correct answer'] diff --git a/yaksh/templatetags/test_custom_filters.py b/yaksh/templatetags/test_custom_filters.py index 7f75b1f..7cef957 100644 --- a/yaksh/templatetags/test_custom_filters.py +++ b/yaksh/templatetags/test_custom_filters.py @@ -137,16 +137,16 @@ class CustomFiltersTestCases(unittest.TestCase): "101.0.0.1",2, self.course.id ) - tc = TestCaseOrder.objects.get(answer_paper=new_answerpaper, - question=self.question1 - ) - tc_list = [self.question1.get_test_case(id=ids) - for ids in tc.order.split(",") - ] + tc_order = TestCaseOrder.objects.get(answer_paper=new_answerpaper, + question=self.question1 + ) + testcases = [self.question1.get_test_case(id=ids) + for ids in tc_order.order.split(",") + ] ordered_testcases = get_ordered_testcases(self.question1, new_answerpaper ) - self.assertSequenceEqual(tc_list, ordered_testcases) + self.assertSequenceEqual(testcases, ordered_testcases) new_answerpaper.delete() |