From bbb0c7fd965cea22fcfc0a1976f8f422ddb7727b Mon Sep 17 00:00:00 2001 From: Phil McGachey Date: Thu, 16 Jul 2015 14:15:26 -0400 Subject: [PATCH] [LTI Provider] Grade passback for non-leaf blocks. This change allows graded assignments to be added to a campus LMS regardless of the granularity at which the problem sits. Previously a grade could only be returned if the usage ID for the problem itself was specified in the LTI launch. The code assumes that courses taking advantage of this functionality are arranged in a hiearchy (with sections being parents to verticals, and verticals being parents to problems). When a grading event occurs it traverses the parent hiearchy to identify any previous graded LTI launches for which the new scoring event should generate a grade update. It then calculates and sends scores to each of those outcome services. Since grade calculation is an expensive operation, the code optimizes the case where a problem has been added only once as a leaf unit. In that case it is able to behave as before, just taking the grade from the signal without having to calculate grades for the whole course. --- lms/djangoapps/courseware/tests/test_grades.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_grades.py b/lms/djangoapps/courseware/tests/test_grades.py index a8a26c0414ef..5c1e520129d4 100644 --- a/lms/djangoapps/courseware/tests/test_grades.py +++ b/lms/djangoapps/courseware/tests/test_grades.py @@ -4,9 +4,8 @@ from django.http import Http404 from django.test import TestCase -from django.test.client import RequestFactory -from mock import patch, MagicMock +from mock import MagicMock from django.test.client import RequestFactory from mock import patch