How to delete SCORM files from the database with deleting the activity

How to delete SCORM files from the database with deleting the activity

by Nicolas Dalpe -
Number of replies: 3

Hey Moodlers,
Quick question about scorm package.

Current Situation
Our SORM package are uploaded in a zip file in a SCORM activity.

Problematic
During the course backup, all the SCORM packages contained in the course are also backed up. This bloat the backup file size, taking a long time to create the backup, and depending on how the SCORM pkg is added it creates an error during the backup process.

Solution
Manage the SCORM package outside Moodle. Activate the option "Enable external package type" (scorm | allowtypeexternal). Upload the scorm pkg to a folder on the server, unzipped the pkg and modify the imsmanifest.xml file. Go to you SCORM activity settings, set Package -> type as "External SCORM manifest", enter the URL of the imsmanifest.xml in the URL field and save. No grades and logs seems to be lost.

The problem with this solution:
Even if the SCORM is read from an external source, if the SCORM package was previously added added into Moodle, Moodle will still backup the SCORM pkg files because the SCORM files are in the mdl_files database table.

My question:
How to delete the SCORM package files from the mdl_files database table without deleting the SCORM activity (which would also delete the grades) ?

I hope this all make sense

Thank you in advance for your answer

PS: I know I can delete them them manually from the db and disk but this will be my very very very very last resort... so please don't suggest this solution.

Average of ratings: -
In reply to Nicolas Dalpe

Re: How to delete SCORM files from the database with deleting the activity

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Nicolas,
never tried by myself, but it sounds like a bug: if you update the SCORM Activity, the underline process should take care to update the activity with the new "SCORM Package" and eventually remove those files no more required (as well as those orphan tracking experiences due to changes into the IDs in the manifest file).

What version of Moodle?

HTH,
Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: How to delete SCORM files from the database with deleting the activity

by Nicolas Dalpe -
Hi Matteo,
Good point. The files could (should?) be removed. I'll see if there is any ticket related to this in tracker.moodle.org.

I am running Moodle 3.8.1+ (Build: 20200221).

thx
In reply to Nicolas Dalpe

Re: How to delete SCORM files from the database with deleting the activity

by Angela Hans -

Hi Nicolas,

sorry, I have no Idea but I would like to know the "Enable external package type" stuff works.

Is that kind of a link to the scorm-Package? So if once set up, could you just change the Package on the Server and refer to that from all current trainings? I am looking for a solution cause we do not actually have an overview over our versions.

And what exactly do you have to change in den imsmanifest.xml file?

Would be great if you can provide any advice.

Thanks,

Angela