@@ -386,15 +386,15 @@ class LTIBlock(
386386 @property
387387 def category (self ):
388388 """Return the block type/category."""
389- return self .scope_ids .block_type
389+ return self .usage_key .block_type
390390
391391 @property
392392 def url_name (self ):
393- return self .location .block_id
393+ return self .usage_key .block_id
394394
395395 @property
396396 def location (self ):
397- return self .scope_ids . usage_id
397+ return self .usage_key
398398
399399 @location .setter
400400 def location (self , value ):
@@ -518,7 +518,7 @@ def get_context(self):
518518
519519 # These parameters do not participate in OAuth signing.
520520 'launch_url' : self .launch_url .strip (),
521- 'element_id' : self .scope_ids . usage_id .html_id (),
521+ 'element_id' : self .usage_key .html_id (),
522522 'element_class' : self .scope_ids .block_type ,
523523 'open_in_a_new_page' : self .open_in_a_new_page ,
524524 'display_name' : self .display_name ,
@@ -752,7 +752,7 @@ def get_resource_link_id(self):
752752 i4x-2-3-lti-31de800015cf4afb973356dbe81496df this part of resource_link_id:
753753 makes resource_link_id to be unique among courses inside same system.
754754 """
755- return str (parse .quote (f"{ settings .LMS_BASE } -{ self .scope_ids . usage_id .html_id ()} " ))
755+ return str (parse .quote (f"{ settings .LMS_BASE } -{ self .usage_key .html_id ()} " ))
756756
757757 def get_lis_result_sourcedid (self ):
758758 """
@@ -778,8 +778,8 @@ def get_course(self):
778778 In general, please do not add new code that access Modulestore, because it
779779 will not work in Learning Core. We do it here just to support a legacy feature.
780780 """
781- if isinstance (self .scope_ids . usage_id . course_key , CourseKey ):
782- return self .runtime .modulestore .get_course (self .scope_ids . usage_id . course_key )
781+ if isinstance (self .context_key , CourseKey ):
782+ return self .runtime .modulestore .get_course (self .context_key )
783783 return None
784784
785785 @property
@@ -790,7 +790,7 @@ def context_id(self):
790790 context_id is an opaque identifier that uniquely identifies the context (e.g., a course)
791791 that contains the link being launched.
792792 """
793- return str (self .scope_ids . usage_id . course_key )
793+ return str (self .context_key )
794794
795795 @property
796796 def role (self ):
@@ -887,8 +887,8 @@ def oauth_params(self, custom_parameters, client_key, client_secret):
887887 # Stubbing headers for now:
888888 log .info (
889889 "LTI block %s in course %s does not have oauth parameters correctly configured." ,
890- self .scope_ids . usage_id ,
891- self .scope_ids . usage_id . course_key ,
890+ self .usage_key ,
891+ self .context_key ,
892892 )
893893 headers = {
894894 'Content-Type' : 'application/x-www-form-urlencoded' ,
0 commit comments