Closed sampaccoud closed 3 years ago
@sampaccoud we have the same need for multi-tenant support on our Tahoe platform. Does it make sense to have this setting at the XBlock level or at the Django site level (so that you can specify the storage location for all XBlocks added to a particular site - not the whole Open edX site, just the individual microsites). We have been historically doing this in the SiteConfiguration object.
Hi all! The approach I'm currently leaning towards is very generic, where you can implement just any function to override the Scorm storage backend. Something along the lines of:
def scorm_storage_function(xblock):
# return an instance of a Django storage backend. You can add as much code as you want here,
# including imports and accessing the xblock instance attributes.
...
XBLOCK_SETTINGS["ScormXBlock"] = {
"STORAGE_FUNC": scorm_storage_function
}
Alternatively, an importable string could be passed to the XBlock settings:
XBLOCK_SETTINGS["ScormXBlock"] = {
"STORAGE_FUNC": "my.custom.storage.module.get_scorm_storage"
}
Would that work for you?
Is "ScormXBlock" the Python entry point of the XBlock?
Is "ScormXBlock" the Python entry point of the XBlock?
No, it's "scorm". https://github.com/overhangio/openedx-scorm-xblock#usage https://github.com/overhangio/openedx-scorm-xblock/blob/master/setup.py#L44
Problem description
We are interested to install this XBlock on existing sites. We absolutely need to use object storage for Scorm uploads but will not be able to modify the storage backend for the whole Django OpenEdX project on which the XBlock is installed.
Solution proposed
Add a separte setting to configure the storage backend for the XBlock. If this setting is not set, default to Django's main storage backend.