summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authorankitjavalkar2020-09-14 11:57:54 +0530
committerGitHub2020-09-14 11:57:54 +0530
commit2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c (patch)
tree711e958f20f7870d08cdb6be29014e5f1d258f56 /yaksh/test_models.py
parent6f5cefcd6614b53285f0747f940c64b97e3783cb (diff)
parenta80fef3789d970d3db17d72f761fe156fe735259 (diff)
downloadonline_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.tar.gz
online_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.tar.bz2
online_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.zip
Merge pull request #751 from CruiseDevice/partial_grade_user
Show max marks for all attempts in answerpaper
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r--yaksh/test_models.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index e24a38e..7ef1ca7 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -1791,12 +1791,14 @@ class AnswerPaperTestCases(unittest.TestCase):
answers_saved = Answer.objects.filter(question=question)
error_list = [json.loads(ans.error) for ans in answers_saved]
if answers_saved:
- self.assertEqual(len(answered[question]), len(answers_saved))
+ self.assertGreater(len(answered[question]), len(answers_saved))
ans = []
err = []
for val in answered[question]:
- ans.append(val.get('answer'))
- err.append(val.get('error_list'))
+ if val.get('answer') is not None:
+ ans.append(val.get('answer'))
+ if val.get('error_list') is not None:
+ err.append(val.get('error_list'))
self.assertEqual(set(ans), set(answers_saved))
self.assertEqual(error_list, err)