XBlock ID's and SCORM removal

Hello all!

I’am using ironwood release from bitnami distribution
Git say it is edx-platform on 441d6384ee (grafted, tag: open-release/ironwood.2, origin/open-release/ironwood.master, origin/nedbat/test/i.2.2)

Me and my colleagues in university faced a problem what XBlock location ID’s is not unique around the edX which led to:

  1. If in all xblocks with same id was uploaded SCORM zip, all courses points to same directory
  2. If we replace one zip to another in one course, previously unpacked zip removes and and links to it in another courses becomes broken

Let me illustrate

(edxapp) root@debian:~# find /opt/bitnami/apps/edx/var/media/ -name 600508e8d34041a4b59e4b1a4c5f3b4a
/opt/bitnami/apps/edx/var/media/scorm/600508e8d34041a4b59e4b1a4c5f3b4a
/opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_3/scorm/600508e8d34041a4b59e4b1a4c5f3b4a
/opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_4/scorm/600508e8d34041a4b59e4b1a4c5f3b4a
/opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_2/scorm/600508e8d34041a4b59e4b1a4c5f3b4a
/opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_1/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

We see what we have xblock with id 600508e8d34041a4b59e4b1a4c5f3b4a collision in 4 courses

Let’s see what scorm zip files we have in corresponding xblocks in this courses

ls -l /opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_3/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

792965ef48d6dd6c29a18d8108605b689c8baa0b.zip

ls -l /opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_4/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

ba829fe2aa483eb4cd1ab098e1a849c9d05e23a8.zip

ls -l /opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_2/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

ba829fe2aa483eb4cd1ab098e1a849c9d05e23a8.zip

ls -l /opt/bitnami/apps/edx/var/media/MyDemoCollege/Bio_1/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

9ea9b78aea3b6de29c94c370e687ab92f7577953.zip cf238d2aa5ac8779b56a2e578f2ca831d8665948.zip

Let’s see what we have in dir where zip files extracted:

ls -l /opt/bitnami/apps/edx/var/media/scorm/600508e8d34041a4b59e4b1a4c5f3b4a

792965ef48d6dd6c29a18d8108605b689c8baa0b
9ea9b78aea3b6de29c94c370e687ab92f7577953
ba829fe2aa483eb4cd1ab098e1a849c9d05e23a8
cf238d2aa5ac8779b56a2e578f2ca831d8665948

And the problem is all this directories is wiped except the latest 792965ef48d6dd6c29a18d8108605b689c8baa0b
Because course maker uploaded scorm zip 792965ef48d6dd6c29a18d8108605b689c8baa0b.zip
in course Bio_3
in block 600508e8d34041a4b59e4b1a4c5f3b4a
and when he did it, previously extracted zips in
/opt/bitnami/apps/edx/var/media/scorm/600508e8d34041a4b59e4b1a4c5f3b4a
was removed. But another courses still point to them!

Sorry for so long description but actually my question is: Is it a bug if xblocks from different courses have same id?

If it is not a bug how you can recommend to solve a problem with erasing unpacked scorms?

I can just comment out corresponding line of code in scormxblock.py but I’am afraid to broke everything by doing it.

# Then, extract zip file
if default_storage.exists(self.extract_folder_base_path):
    logger.info(
        'Removing previously unzipped "%s"', self.extract_folder_base_path
    )
    recursive_delete(self.extract_folder_base_path)

Thanks!

Looks like there are some confusing, May you please mentions which scrom package are you using? please mention github link and branch as well. because this “600508e8d34041a4b59e4b1a4c5f3b4a” id must be xblock_id which should be unique within same course.

Our bitnami distribution uses open-release/ironwood.master branch


at commit

I figure out my problem last night. And applied temporary solution by removing code from scormxblock.py what I provide in my first post what deletes unpacked scorms.

The source of problem is if we are Export course what contains xblock with scorms and then Import it, xblock ids still the same as in exported course. This cause what xblocks from different courses pointed to same directory what contains unpacked scorm.

It seem like a bug for me, because when I copy block what contains xblocks, new xblocks obtain a new id’s but when I kinda copy whole course by Export/Import - they doesn’t.

Probably I should create a issue or feature request but I’am to busy right now with courses.

1 Like