clarify comments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user