The core XBlock library is built around the assumption that Runtimes will be implemented for each application. Because of that design intention, there are methods on Runtimes such as handler_url
and local_resource_url
which really only make sense to be implemented by the hosting application. Unfortunately, in the existing edx-platform implementation, some of the XBlock runtimes are actually supplied by the Modulestore (upon construction of XBlocks and XModuleDescriptors), rather than being supplied by the runtime. This leads to a number of workarounds for those application specific methods, as well as an amount of trickery and juggling so that XBlocks, XModules, and XModuleDescriptors are provided with both the appropriate Runtime and appropriate FieldData for the Application context that they are being used in.
In this proposal, we would make two fundamental changes to the platform, while preserving backwards compatibility with XModules.
ModuleSystem
and DescriptorSystem
to those runtimes as XBlock services, rather than as runtimes themselves.In order for these changes to be successful would need the following:
ModuleSystem
and DescriptorSystem
Modulestore
and bind_for_children
to attach services, rather than modifying runtimesself.system
to access ModuleSystem
and DescriptorSystem
self.system
to read either ModuleSystem
or DescriptorSystem
out of the runtime as services, depending on whether self
is an XModule or an XModuleDescriptorSome possible gotchas in the proposal are
DescriptorSystem
constructed by the Modulestore. Will that still work in the new proposal?ModuleSystem
per XBlock, and depending on the Modulestore, construct one or many DescriptorSystems
. How will these be bound onto the Application runtime in order to preserve the current properties, once we switch to having them as XBlock services.In this proposal, we would create an XBlock-only runtime that LMS and Studio could use for courses that contain only pure XBlocks.
The precursor to XBlock. This class is responsible for generating a student-facing HTML rendering of course content. It is bound to a particular student on instantiation.
This class provides an interface between XModuleDescriptors and the rest of edx-platform. The intention is to abstract the XModuleDescriptor away from the details about how external systems are implemented.
As with DescriptorSystem, this class exists to provide an interface between the XModule and the rest of the LMS. It has become a dumping ground for many responsibilities, which will in the future be abstracted as XBlock services instead.
This is used to mean an XBlock that doesn't inherit from XModule or XModuleDescriptor, and accesses none of the DescriptorSystem or ModuleSystem interfaces to access edx-platform.