Skip to content

Commit 4276e7d

Browse files
pkulkarkAgrendalath
andcommitted
refactor: rename descriptor -> block within lms/djangoapps/lti_provider
Co-authored-by: Agrendalath <[email protected]>
1 parent 5cc6aca commit 4276e7d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lms/djangoapps/lti_provider/outcomes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def generate_replace_result_xml(result_sourcedid, score):
9797
return etree.tostring(xml, xml_declaration=True, encoding='UTF-8')
9898

9999

100-
def get_assignments_for_problem(problem_descriptor, user_id, course_key):
100+
def get_assignments_for_problem(problem_block, user_id, course_key):
101101
"""
102102
Trace the parent hierarchy from a given problem to find all blocks that
103103
correspond to graded assignment launches for this user. A problem may
@@ -107,13 +107,13 @@ def get_assignments_for_problem(problem_descriptor, user_id, course_key):
107107
problem and as a problem in a vertical, for example).
108108
109109
Returns a list of GradedAssignment objects that are associated with the
110-
given descriptor for the current user.
110+
given block for the current user.
111111
"""
112112
locations = []
113-
current_descriptor = problem_descriptor
114-
while current_descriptor:
115-
locations.append(current_descriptor.location)
116-
current_descriptor = current_descriptor.get_parent()
113+
current_block = problem_block
114+
while current_block:
115+
locations.append(current_block.location)
116+
current_block = current_block.get_parent()
117117
assignments = GradedAssignment.objects.filter(
118118
user=user_id, course_key=course_key, usage_key__in=locations
119119
)

lms/djangoapps/lti_provider/signals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def increment_assignment_versions(course_key, usage_key, user_id):
2222
Update the version numbers for all assignments that are affected by a score
2323
change event. Returns a list of all affected assignments.
2424
"""
25-
problem_descriptor = modulestore().get_item(usage_key)
25+
problem_block = modulestore().get_item(usage_key)
2626
# Get all assignments involving the current problem for which the campus LMS
2727
# is expecting a grade. There may be many possible graded assignments, if
2828
# a problem has been added several times to a course at different
2929
# granularities (such as the unit or the vertical).
3030
assignments = outcomes.get_assignments_for_problem(
31-
problem_descriptor, user_id, course_key
31+
problem_block, user_id, course_key
3232
)
3333
for assignment in assignments:
3434
assignment.version_number += 1

lms/djangoapps/lti_provider/tests/test_tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ class SendCompositeOutcomeTest(BaseOutcomeTest):
9797

9898
def setUp(self):
9999
super().setUp()
100-
self.descriptor = MagicMock()
101-
self.descriptor.location = BlockUsageLocator(
100+
self.block = MagicMock()
101+
self.block.location = BlockUsageLocator(
102102
course_key=self.course_key,
103103
block_type='problem',
104104
block_id='problem',
@@ -108,7 +108,7 @@ def setUp(self):
108108
'lms.djangoapps.lti_provider.tasks.CourseGradeFactory.read', self.course_grade
109109
)
110110
self.module_store = MagicMock()
111-
self.module_store.get_item = MagicMock(return_value=self.descriptor)
111+
self.module_store.get_item = MagicMock(return_value=self.block)
112112
self.check_result_mock = self.setup_patch(
113113
'lms.djangoapps.lti_provider.tasks.modulestore',
114114
self.module_store

0 commit comments

Comments
 (0)