clarify comments

This commit is contained in:
Peter Pinch
2018-08-30 15:57:42 -04:00
parent ddd8d41906
commit 3763d26651
2 changed files with 5 additions and 2 deletions

View File

@@ -1216,7 +1216,9 @@ class CapaMixin(ScorableXBlockMixin, CapaFields):
}
try:
self.lcp.context['attempt'] = self.attempts + 1
# expose the attempt number to the python custom grader
# self.lcp.context['attempt'] is 1 based, but the self.attempts is 0 based
self.lcp.context['attempt'] = self.attempts + 1
correct_map = self.lcp.grade_answers(answers)
self.attempts = self.attempts + 1
self.lcp.done = True

View File

@@ -1116,7 +1116,8 @@ class CapaModuleTest(unittest.TestCase):
self.assertEqual(result['success'], 'incorrect')
self.assertEqual(module.get_score(), (0, 1))
self.assertEqual(module.correct_map[answer_id]['correctness'], 'incorrect')
# Expect that the number of attempts is incremented, still same attempt
# Expect that the number of attempts is not incremented
self.assertEqual(module.attempts, 1)
self.assertEqual(module.lcp.context['attempt'], 1)